Kybase

A personal, self-hosted knowledge base that your AI agent uses as native, persistent memory. Markdown notes, wikilink graph, hybrid semantic search — and a first-party MCP server.

Why Kybase?

Giving an agent persistent memory usually means assembling a notes app, an MCP bridge, an embedding pipeline, and sync between them yourself. Kybase is that whole stack as one docker compose up — no SaaS, no accounts, 100% private.

MCP-native

13 tools (search, graph, backlinks, CRUD for notes and folders) over Streamable HTTP — works with Claude Code, Claude Desktop and claude.ai connectors.

Local semantic search

pgvector + Ollama embeddings, hybrid RRF fusion with bilingual full-text search. Pluggable providers: Ollama, Google, or OpenAI.

Wikilink knowledge graph

[[Title]] links, backlinks panel, interactive graph view with semantic edges computed from embedding similarity.

Zero external services

App, PostgreSQL 16 + pgvector, and Ollama in one compose file. Single-secret auth, plain-markdown export/import.

Quick start

git clone https://github.com/Kyrzin/kybase.git
cd kybase
cp .env.example .env
# set KYBASE_SECRET (openssl rand -hex 32)
docker compose up -d --build

Open http://localhost:3000 and log in with your KYBASE_SECRET. Migrations apply automatically; Ollama pulls the embedding model (~270 MB) once in the background.

Connect Claude (MCP)

{
  "mcpServers": {
    "kybase": {
      "type": "http",
      "url": "https://your-domain/api/mcp",
      "headers": { "Authorization": "Bearer <KYBASE_SECRET>" }
    }
  }
}

The server ships with MCP instructions that teach the agent to search before writing and to interlink notes — so the knowledge graph grows as the agent works, instead of accumulating orphan notes.

Stack

LayerTech
FrontendNext.js App Router, React 19
DatabasePostgreSQL 16 + pgvector
EmbeddingsOllama nomic-embed-text / Google / OpenAI (768-dim)
SearchRRF hybrid: pgvector HNSW cosine + bilingual FTS
MCP@modelcontextprotocol/sdk Streamable HTTP