Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clude-0.1.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clude-0.1.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file clude-0.1.1.tar.gz.

File metadata

  • Download URL: clude-0.1.1.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

Hashes for clude-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dd360ed5240c134510c38bc7c43cbd7650f849846f553c41c267b0a17c5f565e
MD5 8f91e8378982ea4ab8229e68f59ad27c
BLAKE2b-256 7c3f608906e9d48548b75683925380ff3dd47b76b41cf12d6e2bb16555f2d005

See more details on using hashes here.

File details

Details for the file clude-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: clude-0.1.1-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

Hashes for clude-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75a1e4608dbe421066e9c623a4ac4984d685fc45f9bdd479d17c2a339b4ec32a
MD5 2383dc3b26b40f4ad74706c143b23c72
BLAKE2b-256 7f4cbd72f5cc48dbdfa78bb65f7075ef4840be3e580ec48800b582a7f2627bec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page