Agent Memory
Give your AI agents persistent memory across executions with semantic retrieval.
Overview
Retrace Memory gives your AI agents persistent, searchable memory across executions. Facts, preferences, corrections, and patterns are stored with vector embeddings for semantic retrieval.
Automatic Extraction
When a trace completes, Retrace automatically analyzes the execution and extracts actionable memories using GPT-4o-mini:
- Facts: "API endpoint returns 429 after 100 requests per minute"
- Preferences: "User prefers TypeScript over Python for new projects"
- Corrections: "The auth endpoint requires Bearer token, not API key in query params"
- Patterns: "Agent retries on 5xx errors with exponential backoff (1s, 2s, 4s)"
Storing Memories Manually
Via API
curl -X POST https://api.retrace.yashbogam.me/api/v1/memory \
-H "x-retrace-key: rt_live_..." \
-H "Content-Type: application/json" \
-d '{
"key": "api_rate_limit",
"value": "The payments API returns 429 after 100 requests per minute",
"scope": "project",
"category": "fact",
"confidence": 0.95
}'Semantic Search
Retrieve memories by meaning, not just keywords:
curl -X POST https://api.retrace.yashbogam.me/api/v1/memory/search \
-H "x-retrace-key: rt_live_..." \
-H "Content-Type: application/json" \
-d '{
"query": "What are the rate limits for the payments API?",
"scope": "project",
"limit": 5
}'Results include a similarity score (0-1) for each match.
Memory Scopes
| Scope | Visibility | Lifetime |
|---|---|---|
session | Current execution only | Until session ends |
project | All agents in a project | Until deleted |
global | Across all projects | Until deleted |
Categories
| Category | Use Case | Example |
|---|---|---|
fact | Learned information | "API returns JSON, not XML" |
preference | User preferences | "Prefers concise responses" |
correction | Mistake avoidance | "Use POST not GET for this endpoint" |
pattern | Behavioral patterns | "Always validate input before API call" |
instruction | Explicit directives | "Never expose API keys in responses" |
[!WARNING] Free plan stores up to 100 memories per project. Upgrade to Pro for unlimited memory storage.