Universal memory runtime
for AI agents
Give your agents persistent, cross-session memory that learns and forgets like humans. SQLite-backed with ONNX embeddings, multi-signal retrieval, and spaced-repetition decay.
import pensyve
# Initialize with a namespace
p = pensyve.Pensyve("my-agent")
# Remember something
p.remember("User prefers dark mode and concise answers")
# Recall with multi-signal retrieval
memories = p.recall("What are the user's preferences?" )
# => [Memory(content="User prefers dark mode...", score=0.94)]Memory that actually works
Eight retrieval signals, spaced-repetition forgetting curves, and Bayesian procedural learning — built in Rust for speed.
Cross-Session Memory
SQLite-backed persistence with WAL mode. Memories survive restarts, scale across sessions, and sync across agent instances.
FSRS Memory Decay
Spaced-repetition forgetting curves based on the FSRS algorithm. Memories decay naturally, promoting important knowledge and archiving stale data.
Multi-Signal Retrieval
Fuses 8 retrieval signals — vector similarity, BM25, graph proximity, recency, frequency, confidence, type boost, and cross-encoder reranking.
Procedural Learning
Beta-binomial Bayesian reliability tracking for action-outcome procedures. Agents learn what works and what doesn’t over time.
Entity Graph
Knowledge graph via petgraph with BFS traversal. Connects entities, users, teams, and tools with relationship-aware retrieval scoring.
Multiple Interfaces
Python SDK (PyO3), MCP server (stdio), REST API (FastAPI), TypeScript SDK, CLI, plus OpenClaw/OpenHands, LangChain, CrewAI, and AutoGen adapters.
Up and running in minutes
Choose your integration: Python, MCP, REST API, or TypeScript.
Python SDK
# Install
pip install pensyve
# Use
import pensyve
p = pensyve.Pensyve("my-agent")
entity = p.get_or_create_entity(
"user-123", "user"
)
# Start an episode
ep = p.start_episode(entity.id)
p.add_message(ep.id, "user", "I prefer Python")
p.end_episode(ep.id)
# Recall across all episodes
results = p.recall("programming language")MCP Server
# Build and run
cargo run -p pensyve-mcp
# Add to Claude Desktop config
{
"mcpServers": {
"pensyve": {
"command": "pensyve-mcp",
"args": []
}
}
}
# Tools: recall, remember, episodeREST API
# Start the server
uvicorn pensyve_server.main:app --reload
# Remember
curl -X POST http://localhost:8000/v1/remember \
-H "Content-Type: application/json" \
-d '{"content": "User likes dark mode"}'
# Recall
curl http://localhost:8000/v1/recall?q=preferencesTypeScript SDK
import { Pensyve } from "pensyve";
const p = new Pensyve({
baseUrl: "http://localhost:8000",
});
await p.remember("User prefers TypeScript");
const memories = await p.recall(
"language preference"
);Built for production
Rust core engine with zero-copy PyO3 bindings. No external database required — SQLite handles storage, FTS5 handles search, ONNX handles embeddings.
pensyve-core (Rust)
|- storage/sqlite.rs SQLite + WAL + FTS5
|- embedding.rs ONNX embeddings (fastembed)
|- vector.rs Cosine similarity search
|- graph.rs Entity graph (petgraph)
|- retrieval.rs 8-signal fusion + reranking
|- decay.rs FSRS forgetting curve
|- consolidation.rs Background "dreaming"
|- procedural.rs Bayesian reliability
Consumers
|- pensyve-python PyO3 native module
|- pensyve-mcp MCP stdio server
|- pensyve_server FastAPI REST API
|- pensyve-ts TypeScript HTTP SDK
|- pensyve-cli CLI (clap)How pensyve compares
Purpose-built for agent memory, not retrofitted from general-purpose vector databases.
| Feature | Pensyve | Mem0 | Zep | Honcho |
|---|---|---|---|---|
| Memory decay | FSRS curves | None | None | None |
| Retrieval signals | 8 fused | Vector only | Vector + temporal | Vector only |
| Procedural memory | Bayesian | No | No | No |
| Knowledge graph | Built-in | Add-on | No | No |
| Core language | Rust | Python | Go | Python |
| External DB required | No (SQLite) | Yes | Yes | Yes |
| MCP support | Native | No | No | No |
| Agent framework integrations | OpenClaw + LangChain + CrewAI + AutoGen | LangChain | LangChain | None |
| Open source | Yes | Partial | Partial | Yes |
Ready to give your agents memory?
Open source, batteries included. Start building agents that remember.