Skip to main content
Glama
opencode-personal-knowledge

opencode-personal-knowledge

by NocturnLabs

Store and retrieve knowledge using semantic search, powered by local embeddings. No external API keys required.

✨ Features

  • πŸ” Semantic Search β€” Find knowledge using vector embeddings (BGE-small-en-v1.5)

  • πŸ“ Text Search β€” Keyword-based search fallback

  • 🏷️ Tag Organization β€” Categorize entries with tags

  • πŸ”Œ Plug-and-Play β€” No external services required (embeddings run 100% locally)

  • πŸ’Ύ Persistent Storage β€” Data stored in ~/.local/share/opencode-personal-knowledge/

  • πŸ”„ Automatic Indexing β€” Entries are vectorized on creation

Related MCP server: local-memory-mcp

πŸš€ Quick Start

Add to ~/.config/opencode/opencode.jsonc:

{
  "mcp": {
    "personal-knowledge": {
      "type": "local",
      "command": ["bunx", "opencode-personal-knowledge"],
      "enabled": true
    }
  }
}

Restart Opencode β€” the MCP tools will be available immediately.

Source Installation (Development)

git clone https://github.com/NocturnLabs/opencode-personal-knowledge.git
cd opencode-personal-knowledge
bun install
bun run mcp  # Start MCP server

πŸ› οΈ MCP Tools

Knowledge Tools

Tool

Description

store_knowledge

Store a new knowledge entry with optional tags

search_knowledge

Semantic similarity search

search_knowledge_text

Keyword-based text search

get_knowledge

Retrieve entry by ID

update_knowledge

Update an existing entry

delete_knowledge

Delete an entry

list_knowledge

List entries with filters

get_knowledge_stats

Database statistics

Session Memory Tools

Log and search across entire OpenCode sessions.

Tool

Description

start_logging_session

Begin logging a session

log_message

Log a user/agent message to the session

search_session

Semantic search within a session

search_all_sessions

Search across ALL logged sessions

list_sessions

List all sessions

get_session

Get session details and messages

end_session

End session with optional summary

πŸ“– Example Usage

Storing Knowledge

User: "store a knowledge entry about Opencode Features"

Agent: Researches and stores entry:

βœ… Stored knowledge entry #2: "Opencode Features"
πŸ“Š Indexed for semantic search

Searching Knowledge

User: "@search_knowledge for opencode"

Agent: Returns semantic matches:

Found 1 similar entry:

### 1. Opencode Features (85% similar)
Opencode is an open source AI coding agent...

Session Memory

User: "Start logging this session, call it 'auth debugging'"

Agent: Starts session and logs all exchanges:

βœ… Started session #1: "auth debugging"

User: "Search this session for JWT"

Agent: Returns semantic matches from the session:

Found 2 matches in session #1:

### 1. [user] (92% match)
The JWT token expires too fast...

### 2. [agent] (88% match)
The TTL is set to 60 instead of 3600...

βš™οΈ Configuration

Data Location

By default, data is stored in:

~/.local/share/opencode-personal-knowledge/
β”œβ”€β”€ knowledge.db      # SQLite database
└── vectors/          # LanceDB vector store

Override with environment variable:

export OPENCODE_PK_DATA_DIR=/custom/path

Embedding Model

Uses BGE-small-en-v1.5 via FastEmbed (auto-downloads on first use).

πŸ—οΈ Technology Stack

πŸ“„ License

MIT Β© NocturnLabs


Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A local-first MCP server for personal memory management, enabling AI agents to store, search, and retrieve developer insights with offline semantic search and auto-categorization.
      24 npm
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A RAG knowledge base MCP server that adds vector search and reranking capabilities to opencode, supporting multimodal embeddings, multiple knowledge bases, and local storage.
      1
      MIT