[ STRUCTURED MEMORY SDK FOR AI AGENTS ]

Memory that agents can actually reason over.

V0.9.1 — NOW AVAILABLE
DOCUMENTATION

How It Works

Memory that follows your users.

No external services. Everything runs on your machine.

Agent Chat
I prefer aisle seats when flying. But for long flights, make that a window seat.
Noted. Aisle seats by default, window seats for long flights — all set.
2 weeks later
Can you book my flight to Berlin next Tuesday? It’s a long one.
Booking it now — window seat as per your preferences.
Memory Store

No memories yet

PREFERENCE1.00

Prefers aisle seats for flights

PREFERENCE1.00

Prefers window seat for long flights

PREFERENCErecalled

Prefers window seat for long flights

[ HOW MEMORY GETS STRUCTURED ]

From conversation to knowledge.

MemBlock extracts structured memory blocks from raw conversations — typed, scored, and ready for retrieval.

User said:

“I prefer Python, work at Acme Corp since 2024, and deploy on AWS.”

PREFERENCE

Prefers Python

FACT

Works at Acme Corp

EVENT

Joined Acme Corp

Core Capabilities

Everything an agent needs to remember

Every primitive your AI agent needs for structured, searchable, and secure long-term memory.

Knowledge Graph

Link, traverse, and query — no external graph DB.

Memory Decay Engine

Prune weak memories, surface the strongest.

Temporal Reasoning

Time-aware retrieval with natural language time parsing.

Multi-Hop Retrieval

Entity extraction + graph walk for complex reasoning.

Adaptive Context

Graph-expanded, deduplicated context with confidence gating.

Async + Event Hooks

Full async API with lifecycle event hooks.

Production Ready

Ship to production, not just a demo

Everything you need to deploy AI memory at scale — from multi-tenant isolation to LLM-powered extraction and tamper-proof audit trails.

PostgreSQL + pgvector

Production-grade storage with full-text search and native vector search built in.

Multi-Tenant Isolation

User-scoped data at every level — org, project, session, and agent.

Connection Pooling

Efficient pooling with per-user instances for high-concurrency workloads.

LLM Auto-Extraction

Extract structured memories from conversations using any major LLM provider.

Org-Level Analytics

Track questions across users with trending topics and noise filtering.

Per-Block Encryption

AES-256-GCM encryption at the block level — encrypt what matters, leave the rest fast.

Use Cases

Long-term memory for any scenario

AI Companion

Persistent user context across every session.

Coding Agents

Remember codebase patterns and developer preferences.

Customer Support Bot

Track tickets, history, and resolution patterns.

Education Agent

Adapt to learning pace and knowledge gaps.

Gaming & Interactive

NPCs that remember player choices and relationships.

Creation Assistants

Recall style guides, past edits, and creative context.

Head-to-Head Benchmarks

97.2% Recall@5 on LongMemEval

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 RESULTS
97.2%LongMemEval R@5
57.7%LoCoMo R@5
LocalZero API Calls
10xvs MemPalace Speed

Quickstart

Get started in three lines of Python.

Install from PyPI. Create a MemBlock instance. Store your first memory. No API keys, no configuration files, no setup wizard.

VIEW DOCUMENTATION
python3
$ 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)'

Get In Touch

Feedback, questions, or just say hi.

Have an idea, found a bug, or want to collaborate? Send a message and it goes straight to my inbox.