Skip to content

DEMO: Supervisor API + memory_store MCP tool on the OpenAI template#243

Draft
kevinyan122 wants to merge 2 commits into
databricks:mainfrom
kevinyan122:demo/supervisor-memory-store
Draft

DEMO: Supervisor API + memory_store MCP tool on the OpenAI template#243
kevinyan122 wants to merge 2 commits into
databricks:mainfrom
kevinyan122:demo/supervisor-memory-store

Conversation

@kevinyan122

Copy link
Copy Markdown
Contributor

Draft / demo — not for merge. Shows the diff that turns the base agent-openai-agents-sdk template into a Supervisor (MAS) API agent whose long-term memory is the internal memory_store MCP 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 with DatabricksOpenAI + responses.create() against the MAS endpoint (/api/2.0/mas), declaring the memory_store hosted tool. Its scope (the memory partition) is supplied by resolve_scope(): the verified OBO user id when deployed, custom_inputs.user_id / X-Forwarded-User locally, fail-closed otherwise. The model never sees the raw scope.
  • pyproject.tomldatabricks-openai>=0.14.0, databricks-sdk>=0.55.0.

Pre-GA / demo caveats

  • The memory_store tool is pre-GA, reached via a liteswap routing header (DATABRICKS_MEMORY_TRAFFIC_ID, dev-only — remove at GA).
  • Store name comes from DATABRICKS_MEMORY_STORE; a DATABRICKS_MEMORY_DEV_SCOPE local-only fallback makes the chat UI playable.
  • Deploy needs those env vars in config.env and the app SP granted READ+WRITE on the memory store (no DAB grant for MEMORY_STORE yet — 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

Kevin Yan and others added 2 commits June 26, 2026 14:02
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>
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.

1 participant