Skip to content

mnemosyne-sqlite — Architecture

The @mnemosyne/sqlite package is a stdio-launched MCP server providing project-local knowledge storage backed by SQLite. It implements the persistent KV + vector tiers consulted by @mnemosyne/core.

Responsibilities

  • Expose a Model Context Protocol (stdio) server with memory store/search/recall tools
  • Persist knowledge items to a local SQLite database file (default ./mnemosyne-knowledge.db)
  • Provide the vector store + persistence layer used by the persistent tier of @mnemosyne/core

Key Components

FileRole
src/index.tsProcess entrypoint — boots the MCP server over stdio
src/server.tsMCP server definition + tool handlers (list_tools, call_tool)
src/sqlite-persistence-layer.tsSQLite-backed KV persistence for knowledge items
src/sqlite-vector-store.tsSQLite-backed vector store for semantic recall

Dependencies

  • @modelcontextprotocol/sdk
  • better-sqlite3 (or equivalent SQLite driver)

Data Flow

agent loop (loop-host)
↓ MCP stdio → mnemosyne-sqlite server
↓ tools: store_memory / search_memory / recall_memory
↓ SQLite DB file (local to the host)

The DB path is configurable via MNEMOSYNE_DB_PATH.