Skip to content

feat: add OpenAI Agents SDK integration#842

Merged
nicoloboschi merged 3 commits intomainfrom
feat/openai-agents-integration
Apr 17, 2026
Merged

feat: add OpenAI Agents SDK integration#842
nicoloboschi merged 3 commits intomainfrom
feat/openai-agents-integration

Conversation

@DK09876
Copy link
Copy Markdown
Contributor

@DK09876 DK09876 commented Apr 2, 2026

Summary

  • Adds hindsight-openai-agents package providing FunctionTool instances for OpenAI Agents SDK agents
  • Three tools: hindsight_retain, hindsight_recall, hindsight_reflect via @function_tool decorator
  • create_hindsight_tools() factory with full parameter set (budget, tags, metadata, document_id, etc.)
  • Global configure() / env var fallback for connection settings
  • 31 unit tests, all passing
  • Docs page, SVG icon, integrations.json entry, release script update

Test plan

  • uv run pytest tests/ -v — 31 tests passing
  • uv run ruff check . && uv run ruff format --check . — clean
  • E2E test against running Hindsight server
  • Verify docs page renders correctly

🤖 Generated with Claude Code

@DK09876 DK09876 marked this pull request as draft April 7, 2026 17:48
@DK09876 DK09876 marked this pull request as ready for review April 16, 2026 15:30
DK09876 and others added 3 commits April 17, 2026 10:12
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)
@nicoloboschi nicoloboschi force-pushed the feat/openai-agents-integration branch from 6dd9d13 to 2be4dc5 Compare April 17, 2026 08:15
@nicoloboschi nicoloboschi merged commit b8da88c into main Apr 17, 2026
1 of 2 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants