Skip to main content
Glama
srieg

PAI Memory MCP Server

by srieg

PAI Memory MCP Server

Semantic and keyword search across your AI work sessions, learnings, reflections, failures, research, and relationships. Built for PAI (Personal AI Infrastructure).

What It Does

Indexes your PAI MEMORY/ directory into a searchable SQLite database with:

  • Keyword search via FTS5 (full-text search) — works offline, no dependencies

  • Semantic search via LM Studio embeddings — meaning-based retrieval using nomic-embed-text-v1.5

  • MCP server exposing 7 tools for cross-tool access via Model Context Protocol

Related MCP server: LBrain MCP Server

Supported Memory Types

Type

Source

Description

work

MEMORY/WORK/

Work sessions with META.yaml, tasks, and markdown notes

learning

MEMORY/LEARNING/ALGORITHM/, SYSTEM/

Algorithm execution and system learnings

reflection

MEMORY/LEARNING/REFLECTIONS/

JSONL self-assessment after each task

rating

MEMORY/LEARNING/SIGNALS/

JSONL session ratings with sentiment

failure

MEMORY/LEARNING/FAILURES/

Context dumps from low-rated sessions

research

MEMORY/RESEARCH/

Research output files

relationship

MEMORY/RELATIONSHIP/

Relationship memory notes

Installation

cd ~/.claude/MCPs/pai-memory
bun install

CLI Usage

# Index all MEMORY/ content into SQLite
bun cli.ts index

# Search (semantic if LM Studio running, keyword fallback)
bun cli.ts search "hook performance"

# Generate embeddings via LM Studio
bun cli.ts embed

# Show database statistics
bun cli.ts stats

MCP Tools

When registered as an MCP server, exposes these tools:

Tool

Description

memory_search

Semantic/keyword search across all memory types

memory_recent_work

List recent work sessions with status filter

memory_recent_learnings

List recent learnings with category filter

memory_get_work

Get full details of a specific work entry

memory_stats

Database statistics — entry counts, size, embedding coverage

memory_failures

List recent failure analyses

memory_reflections

List algorithm performance reflections

MCP Registration

Add to your .mcp.json:

{
  "mcpServers": {
    "pai-memory": {
      "command": "bun",
      "args": ["run", "mcp-server.ts"],
      "cwd": "/path/to/pai-memory"
    }
  }
}

Architecture

cli.ts              CLI entry point (index, search, embed, stats)
mcp-server.ts       MCP server (7 tools via StdioServerTransport)
src/
  types.ts          Shared types (MemoryEntry, SearchResult, MemoryStats)
  db.ts             SQLite layer (FTS5 + cosine similarity + embeddings)
  memory-reader.ts  Filesystem parser (YAML, JSON, JSONL, Markdown)
  search.ts         Unified search (semantic first, keyword fallback)
  embedder.ts       LM Studio embedding client (nomic-embed-text-v1.5)
data/
  pai-memory.db     SQLite database (generated, not committed)

Requirements

  • Bun runtime

  • PAI with populated MEMORY/ directory

  • Optional: LM Studio with nomic-embed-text-v1.5 for semantic search

License

MIT

F
license - not found
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/srieg/pai-memory-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server