AutoGen

Rekall-backed memory for Microsoft AutoGen. The rekall-autogen package implements the autogen_core.memory.Memory protocol, so an AgentChat agent retrieves relevant facts from Rekall on each turn and persists what it learns.

Overview

AutoGen's Memory protocol lets you attach a memory store to an AssistantAgent. On every turn AutoGen calls update_context, which queries Rekall with the latest message and injects the hits as a system message; add stores new facts. The adapter is stdlib-only (urllib) and duck-typed, so it works with or without autogen installed.

memory

Protocol-native

Implements the official autogen_core Memory protocol — no glue code.

auto_awesome

Auto-injected

Relevant memories are recalled and injected as a system message each turn.

share

Shared store

Memory is durable and shared with your other Rekall-connected agents.

Installation

Terminal
pip install rekall-autogen

Usage

Construct a RekallMemory and pass it in the agent's memory list:

agent.py
from autogen_agentchat.agents import AssistantAgent
from rekall_autogen import RekallMemory
memory = RekallMemory(
api_url="https://api.rekall.app", # or http://localhost:9876 in dev
api_key="rk_...", # or access_token="rat_..."
)
agent = AssistantAgent("assistant", model_client=..., memory=[memory])

What happens each turn

AutoGen calls update_context with the conversation so far. RekallMemory queries Rekall with the last message and injects the matching memories as a SystemMessage before the model runs. New facts you add are written to Rekall immediately.

How It Works

The adapter maps the AutoGen Memory protocol onto Rekall's v2 memory endpoints. Results returned from a query carry a relevance score. Because Rekall memory is durable and shared, clear() and close() are intentional no-ops — the adapter never wipes your server-side store on agent teardown.

Memory Contract

AutoGen MemoryRekall
add(MemoryContent)POST /api/v2/memories
query(query) → MemoryQueryResultPOST /api/v2/memories/search (results carry a score)
update_context(model_context)query with last message → inject a SystemMessage of the hits
clear() / close()no-op (Rekall memory is durable & shared)

Authentication

Pass an API key or an OAuth access token; both are sent as an Authorization: Bearer header. For local dev against a header-auth server, pass a headers dict instead.

auth.py
# API key (rk_...) or access token (rat_...)
RekallMemory(api_url="https://api.rekall.app", api_key="rk_...")
RekallMemory(api_url="https://api.rekall.app", access_token="rat_...")
# Local dev with header auth
RekallMemory(api_url="http://localhost:9876", headers={"x-user-id": "adam"})

Next Steps

Rekall
rekall