Persistent memory for AI agents. Store, recall, and learn from experience.
Project description
clude
Persistent memory for AI agents. Give your agent a brain that learns, remembers, and improves over time.
from clude import Clude
brain = Clude(api_key="your-cortex-api-key")
# Store a memory
await brain.store(
content="Auth bug was caused by expired JWT refresh token. Fixed by adding token expiry check before retry.",
type="procedural",
tags=["auth", "debugging"],
importance=0.8,
)
# Recall relevant memories
memories = await brain.recall("authentication issues")
for m in memories:
print(f"[{m.type}] {m.summary} (importance: {m.importance})")
Install
pip install clude
For self-hosted mode with Supabase:
pip install clude[supabase]
Quick Start
Hosted mode (recommended)
Get an API key at clude.io or run npx clude-bot register.
from clude import Clude
brain = Clude(api_key="your-api-key")
Self-hosted mode
Connect directly to your own Supabase + Voyage setup:
from clude import Clude
brain = Clude(
supabase_url="https://your-project.supabase.co",
supabase_key="your-service-key",
voyage_api_key="your-voyage-key",
owner_wallet="your-agent-id",
)
API
Store
memory_id = await brain.store(
content="Full memory content here",
summary="Short summary for recall matching", # optional, auto-generated if omitted
type="episodic", # episodic | semantic | procedural | self_model | introspective
tags=["project", "debugging"],
importance=0.7, # 0.0 to 1.0
)
Recall
memories = await brain.recall(
query="how did we fix the auth bug?",
limit=5,
types=["procedural", "episodic"], # optional filter
threshold=0.3,
)
Stats
stats = await brain.stats()
print(f"Total memories: {stats.total_memories}")
print(f"By type: {stats.by_type}")
Export / Import (MemoryPacks)
# Export
pack = await brain.export_pack(query="authentication", limit=50)
print(pack.to_json())
# Import
from clude import MemoryPack
pack = MemoryPack.from_json(raw_json)
count = await brain.import_pack(pack)
print(f"Imported {count} memories")
Forget
await brain.forget(memory_id="12345")
Framework Integration
LangChain
from clude import Clude
brain = Clude(api_key="...")
# In your LangChain agent's tool:
async def remember(query: str) -> str:
memories = await brain.recall(query, limit=3)
return "\n".join(m.content for m in memories)
async def learn(content: str) -> str:
mid = await brain.store(content=content, type="episodic")
return f"Stored memory {mid}"
CrewAI
from crewai import Agent, Task
from clude import Clude
brain = Clude(api_key="...")
# Add memory recall to agent context
memories = await brain.recall("project requirements")
context = "\n".join(m.content for m in memories)
agent = Agent(
role="Developer",
backstory=f"You have these memories:\n{context}",
# ...
)
Memory Types
| Type | Use For |
|---|---|
episodic |
Events, conversations, things that happened |
semantic |
Facts, knowledge, learned information |
procedural |
How-to knowledge, patterns, best practices |
self_model |
Self-awareness, capabilities, preferences |
introspective |
Reflections, journal entries, insights |
How It Works
Clude isn't a key-value store. It's a cognitive memory system:
- Four memory types with different decay curves
- Dream cycle consolidation every 6 hours
- Hebbian reinforcement - accessed memories grow stronger
- Association graph with typed bonds between memories
- Active reflection - the agent thinks about its own thinking
- Memory provenance - traceable ancestry for every memory
Learn more at clude.io.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clude-0.1.0.tar.gz.
File metadata
- Download URL: clude-0.1.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
093a0f1253b43ae5512f3057abaa22d8104560ec9ea0b97d26b0126bcf7e1d92
|
|
| MD5 |
660b13b5e41f18a65d6faa3e6ecfb07c
|
|
| BLAKE2b-256 |
46e935a626985ecdf6316976335d936eabb8fd98f0f42994d86a06f7812afd50
|
File details
Details for the file clude-0.1.0-py3-none-any.whl.
File metadata
- Download URL: clude-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be420e409924727dfab3cc11712289088268047f25afdb014bd71047325f82fc
|
|
| MD5 |
18e3337d39020a1df6ae000899eef9cc
|
|
| BLAKE2b-256 |
87a6cfce17d41c17af3759ed79f82fc345abe3e555c5c804e0c471167891a751
|