Repository navigation
feat(p1-11): add ebbmem-openai-agents package and ChatGPT MCP recipe - #8
Merged
Merged
Conversation
Signed-off-by: Bharat Joshi <200157101+sbharatjoshi@users.noreply.github.com>
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
Adds the
ebbmem-openai-agentsPython adapter package (packages/openai-agents-python/) for the OpenAI Agents SDK (openai-agents) and the ChatGPT Developer Mode / custom MCP connector recipe (docs/recipes/chatgpt.md):EbbmemSession(ebbmem_openai_agents/session.py): Implements the OpenAI Agents SDKSessionprotocol (get_items,add_items,pop_item,clear_session,SessionSettings, cancellation-safeawait_session_mutation) with pluggableRestEpisodicBackend(usingebbmem-integration-core'sAsyncIntegrationClient/IntegrationClientwith hex-encoded envelopes safe under IC-1 redaction) andMcpEpisodicBackend(backed bymemory_episodic_remember/memory_episodic_tailover Streamable HTTP or a user-provided MCP caller).ebbmem_tools/EbbmemToolkit/EbbmemRunHooks(ebbmem_openai_agents/tools.py): Strict-schema@function_toolwrappers (ebbmem_recall,ebbmem_remember,ebbmem_reinforce, optionalebbmem_forget) enforcing read-only recall,<ebbmem_untrusted_memory_context>framing, secret redaction before persistence,injected=Falsedefault, andrecall_id-correlated post-use reinforcement (via explicitebbmem_reinforcetool calls orEbbmemRunHooks.on_agent_end).ebbmem_mcp_server/ebbmem_mcp_stdio_server(ebbmem_openai_agents/mcp.py): ConfiguredMCPServerStreamableHttpandMCPServerStdiohelpers with IC-1 header-only credential validation,/mcp/{profile}targeting,X-Ebb-Namespace/X-Ebb-MCP-Profileheaders, and static tool filtering.docs/recipes/chatgpt.md: Step-by-step guide for registering an EbbMem HTTPS/mcpendpoint in ChatGPT Developer Mode / Connectors, clearly marked as not live-tested.Nothing published.
Acceptance & Test Summary
Executed in Python 3.12.16 (
openai-agents0.25.0; all LLM calls mocked viaagents.models.interface.Modelsubclasses against local mock servers — zero OpenAI API calls):ruff format --check packages/openai-agents-python: 7 files already formatted (exit 0)ruff check packages/openai-agents-python: All checks passed! (exit 0)pytest -v packages/openai-agents-python/tests conformance/tests/test_public_compliance.py: 12 passed, 0 failed (5.70s):tests/test_session_semantics.py(6 passed):Sessionprotocol semantics againstMockEbbmemServer(REST),McpEpisodicBackend(in-memory stub + Streamable HTTP/mcp/full),/api/v1/memorycursor pagination +SessionSettings,Runner.runmulti-turn session persistence with mockedModel, syncIntegrationClientwrapping, and validation errors.tests/test_tools_and_mcp.py(4 passed): read-only recall,EbbmemRunHookscited-only reinforcement (injected=False), explicitebbmem_reinforcerecall_idcorrelation without double-counting, secret redaction,<ebbmem_untrusted_memory_context>closing-tag escaping, fail-open on 503, soft-tombstoneebbmem_forget, andMCPServerStreamableHttp/MCPServerStdioattachment + URL/dual-auth rejection.conformance/tests/test_public_compliance.py(2 passed): public repository hygiene and README link/semantics checks.Architecture Review Note (Verifier PASS)
origin/main(8b7aaf43) addingpackages/openai-agents-python/(ebbmem-openai-agents) anddocs/recipes/chatgpt.md(10 files, max 758 lines, zero edits topackages/python/, DCO sign-off).EbbmemSessionimplements the OpenAI Agents SDKSessionprotocol (get_items,add_items,pop_item,clear_session,SessionSettings, cancellation-safeawait_session_mutation) with pluggableRestEpisodicBackend(hex-encoded envelopes safe under IC-1 redaction) andMcpEpisodicBackend(using EbbMem'smemory_episodic_remember/memory_episodic_tailschemas).ebbmem_tools/EbbmemToolkit/EbbmemRunHookspreserve read-only recall with<ebbmem_untrusted_memory_context>framing, secret redaction,injected=Falsedefault, andrecall_id-correlated post-use reinforcement;ebbmem_mcp_server/ebbmem_mcp_stdio_serverwrapMCPServerStreamableHttp/MCPServerStdiowith header-only credential validation.ruff checkandruff format --checkclean,pytest -v12/12 passed (all mockedModel+ local mock servers, zero OpenAI API calls),test_public_compliance.py2/2 passed, anddocs/recipes/chatgpt.mdis clearly marked not live-tested. Nothing published.