Knowledge Graph
Link, traverse, and query — no external graph DB.
[ STRUCTURED MEMORY SDK FOR AI AGENTS ]
How It Works
No external services. Everything runs on your machine.
No memories yet
Prefers aisle seats for flights
Prefers window seat for long flights
Prefers window seat for long flights
[ HOW MEMORY GETS STRUCTURED ]
MemBlock extracts structured memory blocks from raw conversations — typed, scored, and ready for retrieval.
“I prefer Python, work at Acme Corp since 2024, and deploy on AWS.”
Prefers Python
Works at Acme Corp
Joined Acme Corp
Core Capabilities
Every primitive your AI agent needs for structured, searchable, and secure long-term memory.
Link, traverse, and query — no external graph DB.
Prune weak memories, surface the strongest.
Time-aware retrieval with natural language time parsing.
Entity extraction + graph walk for complex reasoning.
Graph-expanded, deduplicated context with confidence gating.
Full async API with lifecycle event hooks.
Production Ready
Everything you need to deploy AI memory at scale — from multi-tenant isolation to LLM-powered extraction and tamper-proof audit trails.
Production-grade storage with full-text search and native vector search built in.
User-scoped data at every level — org, project, session, and agent.
Efficient pooling with per-user instances for high-concurrency workloads.
Extract structured memories from conversations using any major LLM provider.
Track questions across users with trending topics and noise filtering.
AES-256-GCM encryption at the block level — encrypt what matters, leave the rest fast.
Use Cases
Persistent user context across every session.
Remember codebase patterns and developer preferences.
Track tickets, history, and resolution patterns.
Adapt to learning pace and knowledge gaps.
NPCs that remember player choices and relationships.
Recall style guides, past edits, and creative context.
Head-to-Head Benchmarks
MemBlock beats MemPalace (96.6%) on LongMemEval with zero API calls. Tested head-to-head on the same datasets, same metrics, same machine. 10x faster retrieval with SQLite vs ChromaDB.
VIEW FULL RESULTSQuickstart
Install from PyPI. Create a MemBlock instance. Store your first memory. No API keys, no configuration files, no setup wizard.
VIEW DOCUMENTATION$ pip install memblock# Store structured memories>>> from memblock import MemBlock, BlockType>>> mem = MemBlock(storage="sqlite:///memory.db")>>> mem.store("User prefers dark mode", type=BlockType.PREFERENCE)Block(id='blk_7f2a', type=PREFERENCE, confidence=1.0)# Query by text>>> mem.query(text_search="dark mode")[Block(id='blk_7f2a', content='User prefers dark mode')]# Build LLM-ready context>>> mem.build_context(query="user preferences", token_budget=2000)'[PREFERENCE] User prefers dark mode (confidence: 1.00)'