Memory infrastructure for AI

Memory that moves at thought speed.

A Rust-backed memory engine for Python AI assistants. Get 1–10 ms in-RAM recall, durable SQL persistence, and zero required services.

  • Rust + Python
  • SQLite by default
  • MIT Licensed
Working memory Ephemeral · sub-second
Short-term Recent · seconds → hours
Long-term Durable · days → years
Unified memory core Neural recall · 1–10 ms
Explore the system

One system. Three memory horizons.

Fast where it matters. Durable where it counts.

Every query stays on the Rust-backed in-memory index. SQL handles durability quietly in the background, while short-term and working memory keep immediate context close.

01 · Session context

Working memory

Rolling events with configurable TTL and per-user caps.
  • Ephemeral session state
  • Automatic pruning

02 · Recent context

Short-term memory

TTL-managed traces for what matters right now.
  • 15-minute default TTL
  • Optional by configuration

03 · Durable recall

Long-term memory

Persistent traces and embeddings that survive restarts.
  • SQLite or PostgreSQL
  • Hydrates directly to RAM

RustMemoryIndex

Recall in 1–10 ms

Cosine similarity over an in-RAM vector index. No database round-trip on the critical path.
Query path
RAM only
Persistence
One SQL database
Runtime
Async-safe

Built for the hot path

Database durability without database latency.

MemoryCore splits persistence from retrieval. Writes update SQL and the index together. Reads stay in RAM. Store I/O runs in a worker thread, so your async event loop stays responsive.

1–10 ms

Typical in-memory recall

0

Required external services

64-bit

Structured memory key

3

Integrated memory layers

Live request trace index healthy
  1. 0.0 ms
    receivequery + user_id
  2. 0.7 ms
    embedvector ready
  3. 4.2 ms
    recallRust vector index
    5 hits
  4. 6.8 ms
    returnranked memories

Pythonic by design

From zero to durable memory in a few lines.

SQLite ships with Python and the schema creates itself. Bring an embedder—or pass vectors directly—and start remembering.

quickstart.py Python 3.12+
from memory_core import build_memory_system

system = build_memory_system()

await system.remember(
    user_id="alice",
    summary="Prefers Python for scripting tasks",
    importance=0.8,
    tags=["preferences", "programming"],
    embedding=my_vector,
)

result = await system.recall(
    user_id="alice",
    query_text="programming languages",
    query_embedding=query_vector,
    limit=5,
)
persisted to SQLite Rust index updated ready to recall
01

Bring your embedder

Implement one async protocol and use raw text everywhere. MemoryCore handles vector generation at the boundary.

02

Filter before similarity

The optional SMK assistant index packs topic, kind, tools, difficulty, generality, and importance into a 64-bit key.

03

Swap persistence later

Start locally with SQLite. Point one URL at PostgreSQL when the application grows—without changing the memory API.

Give your assistant continuity

Memory should feel instant.
Now it can.

Open source, MIT licensed, and designed for the Python applications you already build.