Installation
Initialize
Core Methods
add(messages, …)
Add memories from a conversation. Automatically extracts entities, facts, episodes, and procedures.| Parameter | Type | Default | Description |
|---|---|---|---|
messages | list[dict] | required | Chat messages with role and content |
user_id | str | "default" | User identifier for multi-user isolation |
agent_id | str | None | Agent identifier |
run_id | str | None | Session/run identifier |
app_id | str | None | Application identifier |
expiration_date | str | None | ISO datetime — facts auto-expire |
source | str | None | Provenance source (e.g. "discord", "slack", "email") |
metadata | dict | None | Arbitrary provenance metadata |
agent_mode | bool | False | Extract from all speakers (user + assistant). Auto-enabled when agent_id is set. |
add_text(text, …)
Add memories from plain text instead of chat messages.add() except text instead of messages.
add_file(file_path, …)
Upload a file and extract structured memories. Supports PDF (vision AI extraction), DOCX, TXT, and MD. Each page/chunk counts as 1 add from your quota. Returns immediately — processing happens in background.| Parameter | Type | Default | Description |
|---|---|---|---|
file_path | str | required | Path to file (.pdf, .docx, .txt, .md) |
user_id | str | "default" | User identifier |
agent_id | str | None | Agent identifier |
run_id | str | None | Session/run identifier |
app_id | str | None | Application identifier |
search(query, …)
Semantic search across the knowledge graph with re-ranking.| Parameter | Type | Default | Description |
|---|---|---|---|
query | str | required | Natural language search query |
limit | int | 5 | Max results |
graph_depth | int | 2 | Knowledge graph traversal depth |
user_id | str | "default" | User to search |
agent_id | str | None | Filter by agent |
run_id | str | None | Filter by run |
app_id | str | None | Filter by app |
filters | dict | None | Metadata filters |
search_all(query, …)
Unified search across all 3 memory types.get_all() / get_all_full()
get(name) / delete(name)
Cognitive Profile
get_profile(…)
Generate a Cognitive Profile — a ready-to-use system prompt summarizing a user.| Parameter | Type | Default | Description |
|---|---|---|---|
user_id | str | "default" | User to profile |
force | bool | False | Regenerate (bypass cache) |
rules(…)
Generate a CLAUDE.md, .cursorrules, or .windsurfrules file from memory.| Parameter | Type | Default | Description |
|---|---|---|---|
format | str | "claude_md" | claude_md, cursorrules, or windsurf |
force | bool | False | Regenerate |
user_id | str | "default" | User |
Episodic Memory
episodes(…)
Search or list episodic memories (events, experiences, interactions).| Parameter | Type | Default | Description |
|---|---|---|---|
query | str | None | Search query (omit to list) |
limit | int | 20 | Max results |
after | str | None | ISO datetime start |
before | str | None | ISO datetime end |
user_id | str | "default" | User to query |
Procedural Memory
procedures(…)
Search or list learned workflows.procedure_feedback(id, …)
Report success/failure. On failure with context, triggers experience-driven evolution.procedure_history(id) / procedure_evolution(id)
Knowledge Graph & Timeline
graph(…)
Get the full knowledge graph — nodes and edges.timeline(…)
Temporal search — facts within a time range.feed(…)
Activity feed — recent memory changes.stats(…)
Get usage statistics.Memory Management
Insights & Reflections
Agents
Smart Triggers
Webhooks
Teams
API Keys
Billing
Jobs
Import Data
user_id, chunk_size/chunk_chars, and on_progress callback.
Error Handling
QuotaExceededError
Raised when your monthly plan limit is reached (HTTP 402). Not retried.| Attribute | Type | Description |
|---|---|---|
action | str | Which action was blocked (add, search, add_file) |
limit | int | Monthly limit for this action |
current | int | Current usage count |
plan | str | Current plan (free, starter, pro) |
Retry Behavior
The client automatically retries on transient errors (429, 502, 503, 504) with exponential backoff up to 3 attempts. 402 (quota exceeded) is never retried.Quota Usage
After any API call, check your current quota usage via the.quota property:
X-Quota-Add-Used, X-Quota-Add-Limit, X-Quota-Search-Used, X-Quota-Search-Limit) and reflects usage at the time of the last API call.