LLM Second Brain
Allows the server to use Ollama as a local provider for embedding generation, summarization, deduplication judging, classification, and title generation in the background note-processing pipeline.
Allows the server to use OpenAI-compatible APIs (including the OpenAI service) as a provider for embedding generation, summarization, deduplication judging, classification, and title generation; note contents may be sent to the external API depending on the configured slots.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LLM Second Brainsearch my notes for what I wrote about MCP servers"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LLM Second Brain
A self-hosted long-term memory server for LLMs running in harnesses (primarily Open WebUI). Models get MCP access to a shared knowledge store — notes, plus three knowledge areas (skills, terms, facts about the user): they can search it (hybrid vector + full-text), read, write, update and delete records.
What it is
One Docker container, self-hosted, non-root.
MCP Streamable HTTP (
/mcp, natively supported by Open WebUI) with a Bearer token.21 MCP tools: 8
memory_*for notes and namespaces, plus three knowledge areas — 5skills_*, 5user_*and 3terms_*.Storage: one SQLite database +
sqlite-vec(vector search) + FTS5 (full-text), merged via Reciprocal Rank Fusion; every knowledge area has its own tables and indexes, isolated from notes and from each other.Three knowledge areas next to notes (since v3.0): skills — stored procedures, read in full only when needed, with a version archive; terms — terminology keyed by (term + context), every sense returned and never overwritten; user — atomic facts about the user with dedup hints. Each area has MCP tools and operator REST mirrors.
Vectorization & summarization are external LLM calls. Each of the three slots (embedding / summary / judge) is configured independently with its own provider (
ollamaor an OpenAI-compatible API), base URL, model and optional API key.Hierarchical namespaces: the store is split into large sections; the map is exposed to models via MCP instructions and
memory_namespaces.Background worker: pending vectors, summaries, dedup, classification, title generation and the new knowledge areas are processed asynchronously; failures never break CRUD (pending states + back-off retry).
Backups: periodic online SQLite snapshots with rotation.
Related MCP server: life-context
Why
Distributed knowledge with fast access. Knowledge lives in a separate store, not in the system prompt or chat history; the model fetches only what is relevant, on demand.
Token economy. Instead of a monolithic context — a fixed small overhead for the tool spec (~1200 tokens), a compact skills announce (budget 2000 characters, refreshed on every connect) and targeted retrieval of short summaries, not full texts.
Quick start
git clone <repo> llm-second-brain && cd llm-second-brain
mkdir -p data prompts
# Edit docker-compose.yml: set MCP_AUTH_TOKEN (openssl rand -hex 32) and the
# three LLM slot addresses/models. Full reference: docs/CONFIG.md.
docker compose up -d --build
curl -s http://localhost:8080/health | python -m json.tool/health answers without a token. See Installation for the
first-run walkthrough (compose, token, Open WebUI, /health).
Documentation
Installation — setup, first run, Open WebUI,
/health.Configuration — environment variables, the prompt files, and the
OLLAMA_KEEP_ALIVEnote.Changelog — release history (Keep a Changelog).
Operational notes
keep_aliveis not sent by the client (since v2.1). Model residency is managed by the server: setOLLAMA_KEEP_ALIVEon the Ollama side if you want models to stay loaded. With the server default (5 min) models are unloaded more often, and a cold start (~22.6 GB for the summarizer) returns to latency.Changing
EMBEDDING_PROVIDER/EMBEDDING_MODEL/EMBEDDING_DIMtriggers an automatic full reindex on startup: all notes go topendingand the worker re-encodes them, and the knowledge-area indexes are rebuilt the same way. Search/dedup thresholds are calibrated forqwen3-embedding:8b— recalibrate after changing the model.Knowledge areas (since v3.0): skills, terms and user facts live in the same database but in their own tables and indexes; they are isolated from notes in both directions. Their form limits and similarity thresholds are environment-tunable and validated at startup.
Privacy: an
openaiprovider sends note texts to an external API (the dedup judge and classifier see full texts). Choose providers per slot deliberately.
License
Distributed under the MIT license.
This server cannot be deployed
Maintenance
Related MCP Connectors
- TaprootOAuthcom.taproothq
Persistent memory layer for AI tools. Save and recall notes across Claude and other MCP clients.
- KogniteOAuthdev.kognite
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Agent-native notes, tasks, dev-docs, vaults, sync & handoffs. MCP + OpenAPI dual surface.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceMCP server that provides semantic memory with search, related-content traversal, and write-back capabilities, all powered by local embeddings of your notes, documents, and chat histories.3MIT
- AlicenseNot gradedqualityCmaintenanceLocal-first memory server that stores notes, contacts, and future data as a unified entity graph, providing hybrid retrieval (vector + keyword) for AI assistants via MCP.1MIT
- AlicenseNot gradedqualityBmaintenanceA personal note store exposed as an MCP server. Enables any MCP-speaking assistant to create, search, list, and categorize notes, with per-client bearer tokens for author attribution.344 npmMIT
- AlicenseAqualityBmaintenanceProvides cross-session persistent memory for coding agents via MCP tools to store, retrieve, and manage notes with hybrid keyword/semantic search and automatic deduplication.8167 npmMIT