Interface MemoryConfig

Top-level configuration object for the Memory facade.

All fields are optional; sensible defaults are applied per field. A minimal {} config is valid and will use a temporary SQLite brain file with graph + self-improvement enabled.

interface MemoryConfig {
    store?: "memory" | "qdrant" | "sqlite" | "postgres" | "neo4j" | "hnsw";
    path?: string;
    connectionString?: string;
    qdrantUrl?: string;
    qdrantApiKey?: string;
    embeddings?: EmbeddingConfig;
    embed?: ((text) => Promise<number[]>);
    graph?: boolean;
    selfImprove?: boolean;
    decay?: boolean;
    consolidation?: ExtendedConsolidationConfig;
    ingestion?: IngestionConfig;
}

Properties

store?: "memory" | "qdrant" | "sqlite" | "postgres" | "neo4j" | "hnsw"

Persistence backend for memory traces.

The Phase 1 facade currently implements the SQLite path at runtime. Other values are reserved for future backends and will throw if selected.

  • 'sqlite' – file-based SQLite (implemented; recommended).
  • 'memory' – reserved for a future in-process backend.
  • 'qdrant' – reserved for a future vector-database backend.
  • 'neo4j' – reserved for a future graph-database backend.
  • 'hnsw' – reserved for a future ANN-only backend.

Default

'sqlite'
path?: string

File-system path for stores that require one (e.g. SQLite db file). Ignored by in-memory and remote stores.

Example

'./data/agent-memory.sqlite'
connectionString?: string

Postgres connection string. Required when store='postgres'.

Example

'postgresql://postgres:wunderland@localhost:5432/agent_memory'
qdrantUrl?: string

Qdrant base URL. Required when store='qdrant'.

Example

'http://localhost:6333'
qdrantApiKey?: string

Qdrant API key for cloud instances. Optional.

embeddings?: EmbeddingConfig

Embedding model configuration (provider name + optional model).

embed?: ((text) => Promise<number[]>)

Optional embedding function for generating vectors at remember/recall time. When provided, enables HNSW vector search in recall() and stores embeddings alongside text in remember(). Without this, recall() falls back to FTS5-only.

Type declaration

    • (text): Promise<number[]>
    • Parameters

      • text: string

      Returns Promise<number[]>

Example

const mem = await Memory.create({
embed: async (text) => {
const res = await openai.embeddings.create({ model: 'text-embedding-3-small', input: text });
return res.data[0].embedding;
},
});
graph?: boolean

Whether to build and maintain a knowledge graph alongside the vector store. When enabled, entity co-occurrence and semantic edges are tracked.

Default

false
selfImprove?: boolean

Whether the agent may autonomously refine and restructure its own memories (write new insight traces, prune contradictions, merge redundancies).

Default

false
decay?: boolean

Whether memory traces lose strength over time following an Ebbinghaus forgetting-curve model.

Default

true

Consolidation schedule and thresholds.

ingestion?: IngestionConfig

Document ingestion settings applied to all ingest() calls by default.