Memnest
Run it

Models and providers

Ollama, OpenAI, or any OpenAI-compatible endpoint, for completions and embeddings.

Memnest uses models for two jobs, and they can come from different providers. Neither is required to start.

ModelUsed forWithout it
CompletionExtracting facts from conversations, resolving them against what is known, writing profiles, optional rerankingDirect writes and keyword search still work; raw text is stored but no facts are extracted
EmbeddingSemantic recall: finding a fact worded differently from the questionSearch runs on keywords only and the trace says lexical-only

Configure

export MEMNEST_PROVIDER=ollama
export MEMNEST_COMPLETION_MODEL=llama3.1:8b     # embeddings default to nomic-embed-text

Everything stays on your machine. Memnest uses Ollama's native API, which constrains output to the JSON schema, so extraction is more reliable than through its /v1 route.

memnest providers check   # calls both endpoints: structured output and embedding dimensions
memnest providers env     # every variable Memnest reads

In code

import { ollamaCompletion, openAICompatibleEmbeddings } from '@memnest/providers';

const memnest = createMemnest({
  store, queue: store.jobQueue(),
  completion: ollamaCompletion({ model: 'llama3.1:8b' }),
  embedder: openAICompatibleEmbeddings({ baseURL: 'http://localhost:1234/v1', model: 'my-embed', dimensions: 1024 }),
});

Providers are a port, not a dependency: anything implementing CompletionProvider or EmbeddingProvider works, including your own wrapper around a model Memnest has never heard of.

Choosing a completion model

Extraction and resolution ask for small, strictly-shaped JSON, not prose. A local 8B model handles it. What matters is reliable structured output: schema-constrained decoding (Ollama's native API, OpenAI's strict mode) beats a larger model that returns malformed JSON. Malformed output is retried once and then treated as new, so the graph is never corrupted, but relations get missed.

The dimension lock

The first embedding write records the provider id and dimensions on the container. Writes or queries from a different provider fail with an error naming both, rather than silently comparing incompatible vectors. To change embedding model, use a new container, or re-embed everything:

memnest backfill --container user:123   # embeds memories and chunks that have no vectors yet

Cost and privacy

  • One call per session, not per message. Batched extraction waits for a conversation to go quiet, then runs once.
  • Resolution calls are skipped when nothing similar is stored, or the text matches exactly.
  • Recall costs nothing unless you switch reranking on: retrieval, fusion and packing are all local.
  • Fully local is a supported setup, not an afterthought: Ollama plus SQLite or Postgres means no data leaves your infrastructure.