Skip to content

Memory

Reactive Agents provides a four-tier memory architecture inspired by cognitive science.

Short-term, capacity-limited (default 7 items). Automatically evicts based on FIFO or importance policy.

// Items are automatically managed during agent execution.
// Working memory holds the current conversation context,
// recent tool results, and active reasoning state.

Long-term factual knowledge stored in SQLite with FTS5 full-text search.

// Semantic entries have importance scores, access counts,
// and support Zettelkasten-style linking between concepts.

Event log of agent actions and experiences. Supports session snapshots for conversation continuity.

Stored workflows and learned procedures with success rate tracking. Agents improve their strategies over time.

TierStorageSearchUse Case
1bun:sqlite WALFTS5 full-textMost applications
2bun:sqlite WAL + sqlite-vecFTS5 + KNN vectorSemantic similarity
const agent = await ReactiveAgents.create()
.withMemory("1") // FTS5 search, no embeddings needed
.build();

Requires an embedding provider:

Terminal window
EMBEDDING_PROVIDER=openai
EMBEDDING_MODEL=text-embedding-3-small
const agent = await ReactiveAgents.create()
.withMemory("2") // FTS5 + KNN vector search
.build();

At the start of each task, the memory layer bootstraps context:

  1. Loads recent semantic entries for the agent
  2. Retrieves the last session snapshot
  3. Generates a markdown projection of relevant knowledge
  4. Injects this into the agent’s system prompt

This gives agents continuity across conversations without explicit context management.