memorie
Universal memory infrastructure

Memory that evolves, versions, and stays traceable.

Memorie is a reusable memory infrastructure layer for AI systems and software — not a chatbot, not a vector-database wrapper. A canonical store stays authoritative while search, vector, graph, and cache stay optional, rebuildable projections of it.

memory · user_123 · preferencegetAt()
v1add()Mar 2, 09:14

Prefers TypeScript.

v2evolve()Apr 18, 16:40

Prefers TypeScript for application development.

v3evolve()Jun 30, 11:02

Prefers TypeScript; strict mode required on new services.

Every prior state stays queryable — nothing is overwritten.

Five lines to a memory that remembers its own history

One engine. Every backend.

Start in memory for tests, move to SQLite for local-first apps, or run PostgreSQL + Redis in production — the same MemoryEngine API works unchanged.

Read the quickstart
index.ts
import { createMemoryEngine } from "@memorie/core";
import { InMemoryStore, InMemoryVersionStore } from "@memorie/storage-memory";

const memory = createMemoryEngine({
  memoryStore: new InMemoryStore(),
  versionStore: new InMemoryVersionStore(),
});

const m1 = await memory.add({
  namespace: "users",
  subjectId: "user_123",
  type: "preference",
  content: "Prefers TypeScript.",
});

await memory.evolve(m1.id, {
  content: "Prefers TypeScript for application development.",
});

const history = await memory.history(m1.id);
const asOf = await memory.getAt(m1.id, new Date("2026-04-01"));

Why Memorie exists

The vector store isn't the source of truth. It never was.

Most “AI memory” libraries collapse everything into one pipeline — text, then an embedding, then a vector database, then similarity search — and quietly make that vector database the source of truth. It works for recall. It can't answer “what did we believe last week?”, “where did this claim come from?”, or let you switch vector providers without losing history.

Memorie inverts it. A canonical MemoryStore is always authoritative. Everything else — vector, search, graph, cache — is a projection: derived, optional, and rebuildable from canonical data at any time.

Read the architecture
MemoryStore
canonical · authoritative
Search index
optional
Vector index
optional
Graph
optional
Cache
optional

Solid = source of truth. Dashed = rebuildable from it at any time.

The model

Four ideas the rest is built on

Identity vs. state vs. version

A stable id persists across an evolving content and state, while every change is preserved as an immutable MemoryVersion — nothing is ever overwritten.

Explicit lifecycle

Memories move through active → updated → archived / expired / superseded / merged → deleted. Invalid transitions throw InvalidStateTransitionError rather than silently succeeding.

Namespaces & subjects, not users & chats

Nothing in the core model assumes a chatbot. subjectId can be a user, a project, a device, a document — whatever your application needs it to mean.

Graceful degradation

With zero optional adapters configured, search() still works — structured filters plus a keyword score. Add a SearchStore or VectorStore later and relevance improves without changing the call site.

What's built

Infrastructure, not a framework

Every piece below composes independently. Configure only what your application needs — the engine degrades gracefully without any of it.

No fake implementations

Every adapter runs against a real backend

Each adapter is verified against the shared contract-test suite and a live instance of what it wraps — a real local PostgreSQL, a real local Redis — not an in-memory mock standing in for one.

See all adapters
InMemorytests & prototyping
SQLitelocal-first, single-node
PostgreSQLreal transactions
Rediscache-aside
SQLite FTS5bm25 keyword search
In-memory vectorcosine similarity

Memorie is memory infrastructure.

not a chatbotnot an AI assistantnot a vector-database wrappernot tied to one AI vendornot a hosted-only service