CortexDB Docs
Integrations

Smolagents

Give Hugging Face smolagents CortexDB search, store, and forget tools.

CortexDB exposes memory to smolagents as three tools the agent can call.

Install

pip install cortexdbai[smolagents]

Tools

from cortexdb import Cortex
from cortexdb.integrations.smolagents import (
    CortexDBSearchTool, CortexDBStoreTool, CortexDBForgetTool,
)

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

tools = [
    CortexDBSearchTool(client=client, scope=scope),
    CortexDBStoreTool(client=client, scope=scope),
    CortexDBForgetTool(client=client, scope=scope),
]
agent = CodeAgent(tools=tools, model=...)

See also

On this page