Memory Adapters
Choose and configure memory adapters for agent persistence (InMemory, Redis, Postgres, SQLite, MongoDB and Qdrant), the contract they share and how to list threads.
Adapter Factory
The simplest way to create a conversation adapter is the factory function. It accepts a config object and returns the matching adapter, loading its driver lazily:
import { createMemoryAdapter, unwrap } from '@cogitator-ai/memory';
const memory = await createMemoryAdapter({ provider: 'sqlite', path: './memory.db' });
unwrap(await memory.connect());createMemoryAdapter handles memory, redis, postgres, sqlite and mongodb and returns the common MemoryAdapter interface. For Qdrant use createEmbeddingAdapter({ provider: 'qdrant', dimensions }), which returns a ConnectableEmbeddingAdapter (an EmbeddingAdapter with connect() and disconnect()) to connect before use. Construct the class directly (e.g. new PostgresAdapter(...)) when you need its extra capabilities: facts, vector or keyword search.
Database drivers are optional peer dependencies, installed by you and not with @cogitator-ai/memory or @cogitator-ai/core: each section below names the one its adapter needs, and an adapter whose driver is missing fails connect() with the install command.
All conversation adapters share the same MemoryAdapter interface: createThread, getThread, updateThread, deleteThread, listThreads, addEntry, getEntries, getEntry, deleteEntry, clearThread, connect and disconnect, the branch methods getPath, rewind, checkout and forkThread (optional on the interface, every built-in adapter has them, see Threads as Trees), and redactEntry (optional too, in every built-in adapter, see Forgetting, Redacting and Rewinding). Every built-in conversation adapter also stores memory items and their entities (MemoryItemAdapter), and some add FactAdapter, EmbeddingAdapter or KeywordSearchAdapter.
Every method, connect() included, returns a MemoryResult instead of throwing, so a failed connection goes unnoticed unless you check it. Wrap calls in unwrap() (throws on failure) or check result.success; see Results and unwrap().
Calling createThread with an existing thread id is an upsert in every adapter: stored entries and the stored createdAt are kept, only the agent id and metadata change. updateThread merges the given metadata into the existing one.
The Contract
Every built-in adapter behaves the same way, checked by one conformance suite against live databases:
createThreadwith an id of your own needs a non-empty one: an empty id fails.getThreadandgetEntrygivenullfor what does not exist,updateThreadof a missing thread fails, andaddEntryinto a thread that does not exist fails.updateThreadis atomic: concurrent updates of different keys all land.getEntriesreturns entries oldest first, entries with the samecreatedAtin the order they were added.limitkeeps the newest entries,0or no limit returns them all, and a negative or fractional limit fails.toolCallsandtoolResultscome back only withincludeToolCalls, and a field that was never set is absent, nevernull.deleteThreadremoves the thread's entries too,clearThreadkeeps the thread.- An entry added without
parentIdgoes after the thread's active leaf and becomes it, one withparentIdgoes after that entry, which must be in the same thread, andactivate: falseleaves the leaf where it is. Concurrent appends chain one after another, they never take the same parent unnoticed. getPathreturns one branch oldest first,limitkeeps the newest entries of it andbeforepages back.getEntriesandgetPathreturnmessageandtool_resultentries unlesstypesasks for others.rewindonly moves the leaf to an entry of the active branch,checkoutto any entry of the thread, and neither deletes anything.forkThreadcopies a branch into a new thread withmetadata.forkOfon each copy andmetadata.forkedFromon the thread, lists the fork in the origin'smetadata.memoryForks(FORKS_KEY), and does not copy the origin's paused run.deleteEntrysplices: the entry's children go after its parent, and an active leaf that is deleted moves to its parent.redactEntry(entryId, { at, reason? })replaces the text of amessageortool_resultentry, the arguments of its tool calls and the results of its tools with[redacted], drops the replay state and argument error of its tool calls and the sendernameof a user message, keeps its place on the branch and its parent, its role and the ids that tie tool calls to their results, and recordsmetadata.redacted(atas an ISO string,reason). A missing entry givesnull, and an event entry such as a compaction is refused: delete it instead.redactedEntry(entry, redaction)andREDACTED_TEXTfrom@cogitator-ai/memorybuild the redacted entry for an adapter of your own.- Returned threads and entries are copies: changing them does not change what is stored.
onChange(listener)reports every change once it is stored:entry-added,entry-deleted(also for entries InMemory drops atmaxEntries),entry-redacted({ entryId, threadId }, after which the message index drops the entry's vectors),thread-clearedandthread-deleted(also for threads Redis expired, once a later write sweeps them). It returns a function that stops the listener. A listener that throws is logged and does not fail the write. The message index uses it, see Context Builder. An adapter of your own reports changes by extendingChangeReportingMemoryAdapterand passing each write's result throughreported(), one that extendsBaseMemoryAdapterhas noonChange.
The suite ships in @cogitator-ai/test-utils as memoryAdapterConformanceCases, so an adapter of your own can be checked the same way (see Test Utils).
Memory Items
A store of memory items only stores, MemoryItems keeps every rule on top of it. Every built-in adapter keeps items the same way, checked by a second suite, memoryItemAdapterConformanceCases:
putItemandputEntityreplace the item or entity with the same id, and an item reads back field for field, its dates asDates, a field it does not have absent, nevernull.getItemgivesnullfor an item that does not exist.findItemskeeps the items of the filter's agent that meet every condition given (ids,slots,entityIds,kinds,statuses), oldest recorded first, then by id.visibleTokeeps the items a scope sees (each of the item's user, project and thread absent or the same, an item with a user left out for a scope without one), andscopethe items of exactly that scope, so a run of one user never reads every user's items. It leaves out an item memory let go (expiredAtnot after now) unlessincludeExpired, and finds one whoseexpiredAtis still to come.findEntitiesfinds entities by id or by any of their names and aliases, normalized.deleteItemsanddeleteEntitiesdelete for good, and returned items and entities are copies.
Memory Files
Every built-in adapter also keeps the versions of memory files (MemoryFileAdapter, isMemoryFileAdapter(adapter) tells), and MemoryFiles keeps the rules on top. A store only adds, finds, redacts and deletes versions, checked by a third suite, memoryFileAdapterConformanceCases:
putFileVersions(versions)adds all of them or none. A version whose scope and path already hold itssequencefails the whole call withMEMORY_FILE_CONFLICTas its error, also when writers race for the place, which is how two writers are kept from adding the same version, and a version reads back field for field, its dates asDates, a field it does not have absent.findFileVersions(filter)keeps the versions of the filter's agent that meet every condition given (ids,paths,prefix), oldest first bycreatedAt, thensequence, then id.visibleTokeeps the versions a scope sees andscopethe versions of exactly that scope, as for memory items.findFileHeads(filter), optional, gives the newest version (highestsequence) of each scope and path the filter sees, deletions included, oldest first asfindFileVersionsgives them, withplace({ threadId, pathIds }) leaving out a version placed in that thread off the branch.MemoryFilesreads the files that stand with it, so a list, a view or the index of a turn reads no history. Postgres and SQLite find the heads in SQL, InMemory, MongoDB and Redis in process.withdrawFileVersions(ids, at), optional, marks versions withdrawn (withdrawn: { at }) and changes nothing else: a withdrawn version is never in front and never a head, while it keeps its sequence, its place in the history and what names it aspreviousId. Every built-in adapter has it.redactFileVersions(ids, redaction)replaces the content andsha256of the versions and marks them redacted, and changes nothing else.deleteFileVersions(ids)deletes for good.- Returned versions are copies.
InMemory keeps the versions in process. SQLite (the memory_file_versions table of the same file) and Postgres (<schema>.memory_file_versions) keep each version whole as JSON beside the columns its filters read, its scope among them, with a key of its scope and path unique together with its sequence, and add a batch in one transaction. MongoDB takes the place of each version in <prefix>file_places (a document whose id is its scope, path and sequence) and then keeps the versions of one change in one document of <prefix>file_batches, so a reader sees all of them or none. A place a writer took and never published, such as one that died midway, is taken again after a minute. MongoDB looks only at batches holding a version of a scope the reader sees. Redis keeps a hash per version with a key of its place and an index by agent, all written in one script and never under the thread ttl.
Listing Threads
listThreads returns threads in pages, the most recently updated first. A thread's updatedAt changes when it is created or its metadata is updated, not when an entry is added.
const page = unwrap(
await memory.listThreads({
agentId: 'support',
metadata: { userId: 'u_42', archived: false },
updatedAfter: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
limit: 20,
})
);
for (const thread of page.threads) console.log(thread.id, thread.updatedAt);
if (page.nextCursor) {
const next = unwrap(await memory.listThreads({ agentId: 'support', cursor: page.nextCursor }));
}metadatamatches top-level keys by equal value and type:{ n: 1 }does not match'1'.limitis 50 by default and at most 500.order: 'asc'starts with the oldest update.- Pass
nextCursorwith the same filters and order to read the next page. It is absent on the last page.
SessionManager.list() finds sessions this way, so it no longer keeps an index thread.
Redis keeps an index of threads by update time for this. Threads written before the index existed are added to it the first time threads are listed. SQLite, Postgres and MongoDB filter and page in the database with an index on agent and update time.
InMemory
Zero-dependency in-process storage. Data is lost when the process exits, and when you call disconnect().
import { InMemoryAdapter, unwrap } from '@cogitator-ai/memory';
const memory = new InMemoryAdapter({ provider: 'memory', maxEntries: 5000 });
await memory.connect();
const thread = unwrap(await memory.createThread('agent-1'));
await memory.addEntry({
threadId: thread.id,
message: { role: 'user', content: 'Hello' },
tokenCount: 2,
});
console.log(memory.stats); // { threads: 1, entries: 1 }| Option | Type | Default | Description |
|---|---|---|---|
maxEntries | number | 10000 | Max entries per thread, see below |
maxEntries counts each thread on its own: a thread at the limit drops one entry for each new one, the oldest entry of a branch that is not active first, then the oldest of the active branch, whose next entry becomes the first. A long conversation keeps its newest turns, and replays and forks go before the conversation they split from. Before, the limit counted every thread together, so a busy thread could evict the entries of a quiet one.
It keeps memory items in process too, lost with the rest. It stores copies of what you give it. A value it cannot clone, such as metadata holding a function, is stored as JSON the way the database adapters store it: the function is left out, and a Date, Map or Set in that same value comes back as a string or {}.
When to use: Unit tests, prototyping, ephemeral agents that don't need persistence.
Redis
Threads and entries in Redis, kept until you delete them or, with a ttl, until they go unused that long. Uses sorted sets for ordered retrieval. Supports both standalone Redis and Redis Cluster.
import { RedisAdapter, unwrap } from '@cogitator-ai/memory';
const memory = new RedisAdapter({
provider: 'redis',
url: 'redis://localhost:6379',
keyPrefix: 'myapp:',
ttl: 3600,
});
unwrap(await memory.connect());For Redis Cluster:
const memory = new RedisAdapter({
provider: 'redis',
cluster: {
nodes: [
{ host: 'redis-1', port: 6379 },
{ host: 'redis-2', port: 6379 },
],
scaleReads: 'slave',
},
password: process.env.REDIS_PASSWORD,
});| Option | Type | Default | Description |
|---|---|---|---|
url | string | — | Redis URL for standalone mode |
host | string | — | Host (alternative to url) |
port | number | — | Port (alternative to url) |
cluster | object | — | nodes and scaleReads (master/slave/all) |
keyPrefix | string | cogitator: or {cogitator}: for cluster | Key prefix for all Redis keys |
ttl | number | 0 | Seconds keys live after their last write, 0 keeps them |
password | string | — | Redis authentication password |
Without a ttl, or with ttl: 0, nothing expires. Earlier versions expired keys after 24 hours by default: pass ttl: 86400 to keep that. With a ttl, each write refreshes the TTL of the thread and its entry index, so active conversations do not expire mid-way, and expired entries are pruned from the index on read. In cluster mode a custom keyPrefix without a hash tag is wrapped automatically ('myapp:' → '{myapp}:') so all keys of the adapter map to one slot.
Memory items, their entities and the versions of memory files are long-term memory and never take the ttl: they stay until they are purged. Each is a hash with its indexes (by agent and record time, slot, entity and name), kept in step when it is replaced or deleted.
getEntries({ limit }) reads only the newest limit entries of the thread instead of the whole thread. When connect() fails, the client is closed again, so an unreachable Redis does not leave a client reconnecting in the background and keeping the process alive, and the error names the connection problem (connect ECONNREFUSED ...).
Requires: pnpm add ioredis
When to use: When you already run Redis, high-throughput scenarios, or conversations that should expire after a while of silence (ttl).
Postgres
Full-featured adapter with threads, entries, memory items, facts, vector embeddings (pgvector), and full-text keyword search.
import { PostgresAdapter, unwrap } from '@cogitator-ai/memory';
const memory = new PostgresAdapter({
provider: 'postgres',
connectionString: 'postgresql://user:pass@localhost:5432/cogitator',
schema: 'cogitator',
poolSize: 10,
});
memory.setVectorDimensions(1536); // before connect(); default 768
unwrap(await memory.connect());On connect() the adapter creates the schema, the threads, entries, memory_items (its scope in user_id, project_id and thread_id columns), memory_entities, memory_file_versions and embeddings tables, the pgvector extension, an HNSW cosine index on the vectors and a generated English tsvector column for keyword search. If an index cannot be created, it logs a warning and carries on.
pgvector is only needed for embeddings. On a database without it (a managed Postgres without the extension, or a role not allowed to run CREATE EXTENSION), connect() still succeeds and threads, entries and facts work: the embeddings table is not created, a warning names the reason, and addEmbedding, search, keywordSearch, deleteEmbedding and deleteBySource return a failed result with it. memory.vectorStatus() returns { available: true, dimensions } or { available: false, reason }, and the Cogitator runtime does not use such a store for semantic context.
HNSW needs no training data, so the index built on the empty table finds every row as the table fills up. Earlier versions built an ivfflat index there instead, which missed rows for small limits. The first connect() after upgrading replaces that index with HNSW, which on a large table takes a while. To avoid the wait, build the index ahead of the deploy with CREATE INDEX CONCURRENTLY idx_embeddings_vector_new ON <schema>.embeddings USING hnsw (vector vector_cosine_ops), then drop the old index and rename the new one to idx_embeddings_vector. An existing HNSW index is kept as it is.
Vectors of more than 2000 dimensions (such as the 3072 of gemini-embedding-001 or text-embedding-3-large) are too large for a pgvector index on the column. Up to 4000 dimensions the adapter indexes the column cast to halfvec instead (pgvector 0.7 or later), and searches compare the same cast, so the index serves them while the stored vectors keep full precision. Larger vectors have no index and a warning says that searches scan every row.
connect() records the layout of threads, entries, memory items and memory files in <schema>.cogitator_schema_migrations and changes the schema only when it is older than the adapter's or its tables are gone. Setup runs in one transaction under a lock on the schema, so processes connecting at once take turns instead of racing on the same CREATE, also behind a pooler in transaction mode such as PgBouncer. A schema from before versions were recorded is brought up to date in place.
Version 3 of the layout moves facts into memory items. The first connect() after upgrading turns every row of facts into an active memory item of kind fact with the fact's id, alone in its slot fact:<id>: trusted as its source (inferred becomes model), in the scope of its agent and of the user its metadata.userId names, verified when it has evidence, valid and recorded from when the fact was created, and let go when it expires. The facts table is then renamed facts_legacy and kept, so nothing is lost. Upgrade every process that shares the database at once: an older process makes a new, empty facts table and writes its facts there, where only the next connect() of an upgraded process finds them and moves them into items.
Version 4 of the layout adds the memory_file_versions table of memory files. The first connect() after upgrading creates it, empty, and changes nothing else, so nothing is migrated. A process of an earlier version keeps working on the same schema, without memory files.
search() sizes each query for the index: it raises hnsw.ef_search to the requested limit (up to 1000) and, on pgvector 0.8 or later, turns on iterative scans, so a large limit or a filter on agent, thread or user still gets every matching row. Equally similar rows are ordered by id, so the result does not depend on the query plan.
The embeddings.vector column is created with the vector size set at that moment, so pass dimensions in the config or call setVectorDimensions(n) before connect() (it throws once connected). connect() reads the size of an existing table: without a configured size the adapter adopts it, and with another configured size (say after switching the embedding model) the table is left as it is, a warning explains the mismatch, and storing or searching embeddings fails with that message until the table is migrated. Deleting embeddings and keyword search keep working. Before, each search failed with a Postgres error.
| Option | Type | Default | Description |
|---|---|---|---|
connectionString | string | — | Postgres connection URL |
schema | string | cogitator | Schema name (letters, digits and underscores only) |
poolSize | number | 10 | Connection pool size |
dimensions | number | 768 | Vector size of the embedding model |
Facts (FactAdapter)
const fact = unwrap(
await memory.addFact({
agentId: 'agent-1',
content: 'User timezone is UTC+3',
category: 'preference',
confidence: 1.0,
source: 'user',
metadata: { userId: 'alice' },
})
);
const preferences = unwrap(await memory.getFacts('agent-1', 'preference'));
const matches = unwrap(await memory.searchFacts('agent-1', 'timezone'));
await memory.updateFact(fact.id, { confidence: 0.8, expiresAt: new Date('2027-01-01') });
await memory.deleteFact(fact.id);getFacts and searchFacts (case-insensitive substring match) skip expired facts and sort by confidence, then the most recently updated.
Each fact is kept as a memory item of its own slot fact:<id>, active whatever its source, so the facts reach a context built from memory items too. updateFact with new content writes a new item that supersedes the current one, so the fact's history keeps what it said before, while a change that keeps the statement (its confidence, category, metadata, evidence or expiry) corrects the current item. deleteFact deletes the fact with its history. A fact without evidence comes back without the evidence field.
Vector Search (EmbeddingAdapter)
await memory.addEmbedding({
sourceId: 'doc-1',
sourceType: 'document',
vector: embedding,
content: 'Cogitator supports multiple LLM backends.',
metadata: { agentId: 'agent-1' },
});
const results = unwrap(
await memory.search({
vector: queryVector,
limit: 5,
threshold: 0.7,
filter: { sourceType: 'document', agentId: 'agent-1' },
})
);search() needs a vector, so embed the query with an embedding service first. limit defaults to 10 and threshold (cosine similarity) to 0.7. filter.agentId and filter.threadId match metadata.agentId / metadata.threadId, filter.userId matches metadata.userId and also lets through embeddings without a user, and filter.metadata matches metadata values exactly ({ metadata: { namespace: 'docs' } }, a JSONB containment on Postgres). Remove embeddings with deleteEmbedding(id), deleteBySource(sourceId) or deleteByFilter(filter), which deletes every embedding matching sourceType, agentId, threadId and metadata (it has no userId, delete a user's embeddings with metadata: { userId }) and refuses a filter without any condition. deleteByFilter is optional in the EmbeddingAdapter interface, every built-in store implements it.
Keyword Search (KeywordSearchAdapter)
Uses PostgreSQL full-text search over the generated tsvector column, ranked by ts_rank:
const hits = unwrap(
await memory.keywordSearch({
query: 'LLM backends',
limit: 10,
filter: { sourceType: 'document' },
})
);Requires: pnpm add pg and the pgvector extension for embeddings.
When to use: Production deployments. This is the most capable adapter.
SQLite
Local file-based persistence using better-sqlite3. Supports WAL mode for better concurrent read performance.
import { SQLiteAdapter, unwrap } from '@cogitator-ai/memory';
const memory = new SQLiteAdapter({
provider: 'sqlite',
path: './data/memory.db',
walMode: true,
});
unwrap(await memory.connect());Use :memory: for an in-memory SQLite database (useful for testing with SQL semantics):
const memory = new SQLiteAdapter({ provider: 'sqlite', path: ':memory:' });| Option | Type | Default | Description |
|---|---|---|---|
path | string | — | Path to .db file, or :memory: |
walMode | boolean | true | Enable WAL journal mode (disabled for :memory:) |
Memory items live in the same file, in the memory_items (with user_id, project_id and thread_id columns of their scope, added and filled on connect() for a table made before them), memory_entities and memory_entity_names tables, and the versions of memory files in memory_file_versions, created on connect() when missing. connect() returns a failure (rather than throwing) when better-sqlite3 is not installed. For a knowledge graph in the same kind of file, see SQLiteGraphAdapter.
Requires: pnpm add better-sqlite3
When to use: Desktop apps, CLI tools, single-process servers.
MongoDB
Document-oriented memory storage. Threads and entries are stored in the <prefix>threads and <prefix>entries collections, indexed on agentId and (threadId, createdAt), memory items and their entities in <prefix>items (the fields of their scope at the top of the document) and <prefix>entities, and memory files in <prefix>file_batches (the versions one change added, in one document) and <prefix>file_places (the place each version took), indexed on the fields they are found by.
import { MongoDBAdapter, unwrap } from '@cogitator-ai/memory';
const memory = new MongoDBAdapter({
provider: 'mongodb',
uri: 'mongodb://localhost:27017',
database: 'cogitator',
collectionPrefix: 'memory_',
});
unwrap(await memory.connect());| Option | Type | Default | Description |
|---|---|---|---|
uri | string | — | MongoDB connection URI |
database | string | cogitator | Database name |
collectionPrefix | string | memory_ | Prefix for collections |
Fields an entry or a thread leaves undefined are left out of the stored document rather than stored as null, so entries read back the same as from the other stores. A failed connect() closes its client and leaves the adapter disconnected, so calling connect() again retries. The adapter is checked against MongoDB 7.0 with the mongodb 7 driver.
Requires: pnpm add mongodb
When to use: When your stack already uses MongoDB, or when you need flexible document schemas.
Qdrant
Dedicated vector database adapter implementing EmbeddingAdapter only (no threads or entries). Use it alongside a conversation adapter when you need vector search at scale.
import { QdrantAdapter, unwrap } from '@cogitator-ai/memory';
const qdrant = new QdrantAdapter({
provider: 'qdrant',
url: 'http://localhost:6333',
collection: 'cogitator',
dimensions: 1536,
});
unwrap(await qdrant.connect());
await qdrant.addEmbedding({
sourceId: 'doc-42',
sourceType: 'document',
vector: embedding,
content: 'Agent memory architecture overview.',
});
const results = unwrap(
await qdrant.search({
vector: queryVector,
limit: 10,
threshold: 0.75,
filter: { sourceType: 'document' },
})
);| Option | Type | Default | Description |
|---|---|---|---|
url | string | http://localhost:6333 | Qdrant server URL |
apiKey | string | — | API key for Qdrant Cloud |
collection | string | cogitator | Collection name |
dimensions | number | — | Vector dimensions (must match model) |
connect() creates the collection with cosine distance if it does not exist. Search results carry the payload but not the stored vector (vector is []), and no threshold is applied unless you pass one. Embedding metadata is stored in the point payload, so filter.threadId / filter.agentId match the metadata.threadId / metadata.agentId payload keys, and filter.userId matches metadata.userId or points without a user.
Qdrant only accepts unsigned integers and UUIDs as point ids, so each point is stored under a deterministic UUID derived from the embedding id. The emb_… id itself is kept in payload.embeddingId; it is what addEmbedding and search return and what deleteEmbedding takes.
Requires: pnpm add @qdrant/js-client-rest
When to use: Large-scale semantic search, production RAG pipelines, or when you want a dedicated vector DB separate from your relational store.
InMemoryEmbedding
An in-memory adapter that implements both EmbeddingAdapter and KeywordSearchAdapter using cosine similarity and a built-in BM25 index. Useful for testing hybrid search without external services.
import { InMemoryEmbeddingAdapter, unwrap } from '@cogitator-ai/memory';
const embeddings = new InMemoryEmbeddingAdapter();
await embeddings.addEmbedding({
sourceId: 'doc-1',
sourceType: 'document',
vector: [0.1, 0.2, 0.3],
content: 'Sample document content',
});
const vectorResults = unwrap(
await embeddings.search({
vector: [0.1, 0.2, 0.3],
limit: 5,
})
);
const keywordResults = unwrap(
await embeddings.keywordSearch({
query: 'sample document',
limit: 5,
})
);
console.log(embeddings.size); // 1
embeddings.clear();It needs no connect(). Vector search uses a default threshold of 0.7, and both searches support the same filter as Postgres (sourceType, agentId, threadId, userId).
Comparison
| Feature | InMemory | Redis | Postgres | SQLite | MongoDB | Qdrant |
|---|---|---|---|---|---|---|
| Threads/Entries | Yes | Yes | Yes | Yes | Yes | No |
| Memory Items | Yes | Yes | Yes | Yes | Yes | No |
| Memory Files | Yes | Yes | Yes | Yes | Yes | No |
| Entry Redaction | Yes | Yes | Yes | Yes | Yes | No |
| Facts | No | No | Yes | No | No | No |
| Vector Search | No¹ | No | pgvector | No | No | Yes |
| Keyword Search | No¹ | No | tsvector | No | No | No |
| Knowledge Graph | No | No | Yes² | Yes² | No | No |
| TTL Expiration | No | Optional | No | No | No | No |
memory.adapter³ | Yes | Yes | Yes | Yes | Yes | memory.qdrant |
| Extra Dependencies | None | ioredis | pg | better-sqlite3 | mongodb | @qdrant/js-client-rest |
¹ Use InMemoryEmbeddingAdapter. ² Via PostgresGraphAdapter / SQLiteGraphAdapter — see Knowledge Graphs. ³ Can be selected as the thread store in the Cogitator memory config. Qdrant is configured next to a thread store as memory.qdrant, the embedding store semantic context searches. Any adapter can also be assigned with cog.memory = adapter — see Using Memory with Cogitator.
Memory Benchmarks
How the memory strategies of the runtime were measured on seven long-memory datasets, the results with their confidence intervals, and the defaults they decided.
Embedding Providers
Configure embedding providers for semantic search — OpenAI, Ollama, and Google — and understand how embeddings power agent memory.