Add persistent memory to Google Agent Development Kit agents.

Google ADK Integration

CortexDB integrates with the Google Agent Development Kit (ADK) to provide persistent memory for agents built with Google's framework.

Installation

pip install cortexdbai[google-adk]

Setup

from google.adk import Agent
from cortexdb.integrations.google_adk import CortexMemoryTool

memory_tool = CortexMemoryTool(
    api_key="your-cortex-api-key",
    tenant_id="my-app",
)

agent = Agent(
    model="gemini-2.0-flash",
    tools=[memory_tool],
    instruction="You are an assistant with long-term memory. Use the memory tool to store and recall information across conversations.",
)

response = agent.generate_content("What did we discuss yesterday about the API redesign?")

Available Tools

The CortexMemoryTool exposes the following functions to the agent:

| Function | Description | |---|---| | remember | Store information in CortexDB (returns .event_id) | | recall | Retrieve relevant memories (returns single object with .context, .confidence, .latency_ms) | | forget | Remove specific memories |

Configuration

| Parameter | Default | Description | |---|---|---| | api_key | $CORTEX_API_KEY | CortexDB API key | | tenant_id | Required | Tenant identifier |

Under the Hood

The integration wrapper maps to CortexDB's REST API:

# memory_tool.remember("API redesign uses REST + gRPC dual protocol")
curl -X POST https://api.cortexdb.ai/v1/remember \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "API redesign uses REST + gRPC dual protocol",
    "tenant_id": "my-app"
  }'
# Returns: { "event_id": "019d6359-d3cc-7671-9e4c-9151011fa016" }

# memory_tool.recall("API redesign decisions")
curl -X POST https://api.cortexdb.ai/v1/recall \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "API redesign decisions",
    "tenant_id": "my-app"
  }'
# Returns: { "context": "...", "confidence": 0.91, "latency_ms": 14 }