feat: add OpenAI Agents SDK integration#842
Merged
nicoloboschi merged 3 commits intomainfrom Apr 17, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… tests - Add memory_instructions() for auto-injecting memories into agent system prompt via a callable compatible with Agent(instructions=...) - Fix or-vs-is-not-None bugs in reflect_max_tokens and reflect_tags_match that silently ignored falsy values like 0 - Surface entity data in recall output when recall_include_entities=True - Add user_agent tracking in _client.py for analytics - Tighten openai-agents dependency to >=0.7.0 - Add CI test job for openai-agents integration in test.yml - Add 9 new unit tests (31→40 total): entity surfacing, memory_instructions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Deduplicate version string into _version.py to prevent drift - Fix memory_instructions to fall back to config.max_tokens - Simplify error handling: remove misleading HindsightError re-raise - Use `is not None` check for reflect response.text (empty != missing) - Use getattr for entity access instead of fragile hasattr chain - Add tests for memory_instructions config fallback (max_tokens, tags)
6dd9d13 to
2be4dc5
Compare
nicoloboschi
added a commit
that referenced
this pull request
Apr 17, 2026
* feat: add OpenAI Agents SDK integration for Hindsight Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(openai-agents): add memory_instructions, fix bugs, add CI, harden tests - Add memory_instructions() for auto-injecting memories into agent system prompt via a callable compatible with Agent(instructions=...) - Fix or-vs-is-not-None bugs in reflect_max_tokens and reflect_tags_match that silently ignored falsy values like 0 - Surface entity data in recall output when recall_include_entities=True - Add user_agent tracking in _client.py for analytics - Tighten openai-agents dependency to >=0.7.0 - Add CI test job for openai-agents integration in test.yml - Add 9 new unit tests (31→40 total): entity surfacing, memory_instructions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(openai-agents): address review findings from PR #842 - Deduplicate version string into _version.py to prevent drift - Fix memory_instructions to fall back to config.max_tokens - Simplify error handling: remove misleading HindsightError re-raise - Use `is not None` check for reflect response.text (empty != missing) - Use getattr for entity access instead of fragile hasattr chain - Add tests for memory_instructions config fallback (max_tokens, tags) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Nicolò Boschi <boschi1997@gmail.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hindsight-openai-agentspackage providingFunctionToolinstances for OpenAI Agents SDK agentshindsight_retain,hindsight_recall,hindsight_reflectvia@function_tooldecoratorcreate_hindsight_tools()factory with full parameter set (budget, tags, metadata, document_id, etc.)configure()/ env var fallback for connection settingsTest plan
uv run pytest tests/ -v— 31 tests passinguv run ruff check . && uv run ruff format --check .— clean🤖 Generated with Claude Code