AutoGen Integration

The autogen-dakera package provides persistent semantic memory for AutoGen agents. Memories survive across sessions, enabling long-term context in multi-agent conversations.

Quick Start

pip install autogen-dakera

Requires Python ≥ 3.10 and a running Dakera server.

from autogen_dakera import DakeraMemory

memory = DakeraMemory(
    api_url="http://localhost:3300",
    api_key="dk-mykey",
    agent_id="autogen-assistant",
)

memory.add("User is building a chatbot for customer support.")
results = memory.query("what is the user building?")

Features

Examples

Basic agent memory

import os
from autogen_dakera import DakeraMemory

memory = DakeraMemory(
    api_url=os.environ.get("DAKERA_API_URL", "http://localhost:3300"),
    api_key=os.environ.get("DAKERA_API_KEY", ""),
    agent_id="autogen-assistant",
    recall_k=3,
    importance=0.8,
)

memory.add("User is building a chatbot for customer support.")
memory.add("The chatbot should handle returns, refunds, and order tracking.")
memory.add("Preferred tech stack: Python backend, React frontend.")

results = memory.query("what is the user building?")
for r in results:
    print(f"  [{r['score']:.3f}] {r['content']}")

Conversation history across sessions

from autogen_dakera import DakeraMemory

memory = DakeraMemory(
    api_url="http://localhost:3300",
    api_key="dk-mykey",
    agent_id="autogen-chat",
    recall_k=5,
    importance=0.7,
)

# Store conversation turns
memory.add("Human: What's the capital of France?
AI: Paris.")
memory.add("Human: I'm planning to visit.
AI: Great! Paris has amazing museums.")

# Later session — recall relevant context
results = memory.query("travel plans")
for r in results:
    print(f"  [{r['score']:.3f}] {r['content']}")

API Reference

DakeraMemory options

ParameterTypeDefaultDescription
api_urlstrDakera server URL
api_keystr""API key
agent_idstrAgent identifier
recall_kint5Results per query
importancefloat0.7Default importance for stored memories

Configuration

export DAKERA_API_URL=http://localhost:3300
export DAKERA_API_KEY=dk-your-key

Links