DEMO: Supervisor API + memory_store MCP tool on the OpenAI template#243
Draft
kevinyan122 wants to merge 2 commits into
Draft
DEMO: Supervisor API + memory_store MCP tool on the OpenAI template#243kevinyan122 wants to merge 2 commits into
kevinyan122 wants to merge 2 commits into
Conversation
Not for merge — shows the diff that turns agent-openai-agents-sdk into a Supervisor (MAS) agent whose long-term memory is the internal `memory_store` MCP tool (the UC memory-store APIs exposed as a hosted MCP tool). agent.py: - Replace the client-side Agents SDK loop with DatabricksOpenAI + responses.create() against the MAS endpoint (/api/2.0/mas). - Declare the `memory_store` hosted tool; its `scope` (partition) comes from resolve_scope() — verified OBO user id deployed; custom_inputs.user_id / X-Forwarded-User locally; fail closed. - Dev-only liteswap routing header (DATABRICKS_MEMORY_TRAFFIC_ID) since the memory_store tool is pre-GA. Store name from DATABRICKS_MEMORY_STORE. pyproject: databricks-openai>=0.14.0, databricks-sdk>=0.55.0. Deploy env (config.env): DATABRICKS_MEMORY_STORE, DATABRICKS_MEMORY_TRAFFIC_ID; grant the app SP READ+WRITE on the memory store. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the _scoped_tools / _memory_tool helpers; resolve scope, fail closed, and build the memory_store tool inline in each handler. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Draft / demo — not for merge. Shows the diff that turns the base
agent-openai-agents-sdktemplate into a Supervisor (MAS) API agent whose long-term memory is the internalmemory_storeMCP tool — i.e. the UC memory-store APIs exposed as a hosted MCP tool on the Supervisor API, instead of client-side function tools.The diff (2 files)
agent_server/agent.py— replaces the client-side OpenAI Agents SDK loop withDatabricksOpenAI+responses.create()against the MAS endpoint (/api/2.0/mas), declaring thememory_storehosted tool. Itsscope(the memory partition) is supplied byresolve_scope(): the verified OBO user id when deployed,custom_inputs.user_id/X-Forwarded-Userlocally, fail-closed otherwise. The model never sees the raw scope.pyproject.toml—databricks-openai>=0.14.0,databricks-sdk>=0.55.0.Pre-GA / demo caveats
memory_storetool is pre-GA, reached via a liteswap routing header (DATABRICKS_MEMORY_TRAFFIC_ID, dev-only — remove at GA).DATABRICKS_MEMORY_STORE; aDATABRICKS_MEMORY_DEV_SCOPElocal-only fallback makes the chat UI playable.config.envand the app SP grantedREAD+WRITEon the memory store (no DAB grant forMEMORY_STOREyet — manual permissions-API call).Verified locally (eng-ml-inference)
Save → recall → scope isolation all work end-to-end through the chat UI + API; the supervisor invokes the memory MCP tools (
create/get/list/search/delete_memory_entry) server-side.🤖 Generated with Claude Code