npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

opencode-personal-knowledge

v1.0.10

Published

Personal knowledge MCP server with vector database for the Opencode ecosystem

Readme


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

🚀 Quick Start

Opencode Integration (Recommended)

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