Working Memory: What Software Keeps Now and Forever

ForkTex Engineering · November 27, 2026 · 2 min

Software that reasons over knowledge, an AI assistant for example, needs two kinds of memory. Working memory is what it holds while it works: small, fast, built for one task. Long-term memory is what it keeps: durable, written by many at once, separate for each customer.

We keep them in two open-source libraries that never build on each other: forktex-data for working memory and forktex-grid for long-term memory.

One rule

What one process holds belongs to working memory. What is shared, written concurrently or kept per customer belongs to long-term memory.
Long-term: forktex-gridWorking: forktex-data
HoldsFacts and records: the system of recordThe context a task works from
ShapeDurable rows in PostgreSQL, per namespace, with transactionsTyped graphs in memory, built once and never changed
WritersMany at once; a version check refuses a stale writeOne process
Typical useFields each customer adds in an ERP; an AI platform's memory per organisationAn agent searching a project or a knowledge base

How knowledge moves

Recall flows from long-term to working memory: a query in grid picks the relevant records, and data builds a graph from them, then walks, ranks and packs it for the task. Consolidation flows the other way: facts worth keeping are written to grid in one batch, with a version check, so two agents saving the same fact conflict instead of overwriting each other.

What to remember, and when, is the application's decision. The libraries only carry it.

Why not one library

We tried the alternatives before deciding. Using the database as the graph's storage lost writes in every prototype, at the seam where both were written live. Using the database for one person's local memory meant running PostgreSQL on a laptop: 2.5 seconds to start and 15 milliseconds per write, against 0.5 seconds and 4.6 milliseconds from a file. Kept apart, nothing failed.

Where it stands

forktex-grid is stable and published. forktex-data is published, before 1.0; Living Knowledge shows what it does on its own. The adapter that moves knowledge between them is small and belongs to each application; it is not yet a library of its own.

pip install forktex-grid forktex-data