CortexDB Docs
Integrations

OpenAI Agents SDK

Add CortexDB memory tools to the OpenAI Agents SDK.

CortexDB exposes memory to the OpenAI Agents SDK as function tools created from a client + scope.

Install

pip install cortexdbai[openai-agents]

Tools

from cortexdb import Cortex
from cortexdb.integrations.openai_agents import (
    create_cortexdb_search_tool, create_cortexdb_store_tool,
    create_cortexdb_forget_tool, get_cortexdb_tools,
)

client = Cortex(api_url="https://api-v1.cortexdb.ai", actor="agent:assistant",
                bearer=os.environ["CORTEX_TOKEN"])
scope = "org:acme/agent:assistant"

tools = get_cortexdb_tools(client=client, scope=scope)   # search + store + forget
# or build them individually:
search = create_cortexdb_search_tool(client=client, scope=scope)

agent = Agent(name="assistant", tools=tools)

See also

On this page