memex

CLI-First Knowledge Base

Hybrid search, typed relations, static publishing. Built for humans and AI agents.

uv tool install memex-kb
kb/guide
ref/api
design
kb/search
patterns
troubleshoot

Designed for Clarity

Everything you need to manage knowledge, nothing you don't.

Hybrid Search

BM25 keyword search combined with semantic embeddings, merged with Reciprocal Rank Fusion.

keyword + vector + rrf

Typed Relations

Explicit directed links in frontmatter with CLI helpers and linting.

depends_on, implements, documents...

Graph View

Wikilinks, relations, and semantic links queryable via CLI and published sites.

visualize connections

Dual Scopes

Project KB (./kb/) and user KB (~/.memex/kb/) with shared search.

@project + @user

Static Publishing

Generate HTML with embedded search, tag pages, and graph visualization.

mx publish -o _site

Agent Integration

Portable CLI workflows plus a bundled SKILL.md for Claude Code, Codex, and other shell-capable harnesses.

mx + skills/memex-kb

Install

With uv (recommended)
uv tool install memex-kb
uv tool install 'memex-kb[search]'  # Optional semantic search
With pip
pip install memex-kb
pip install 'memex-kb[search]'      # Optional semantic search

Requires Python 3.11+. Keyword search is available by default. Install the [search] extra for semantic search, embeddings, and semantic link suggestions.

Quick Start

mx init                           # Create kb/ directory
mx add --title="API Notes" \     # Add an entry
       --tags="api,docs" \       
       --category=reference \    
       --content="Endpoint details..."

mx search "authentication"        # Search the KB
mx get reference/api-notes.md     # Read an entry

Commands

Search & Browse

Command Description
mx search <query> Keyword search by default
mx search --mode=semantic Semantic search (requires [search])
mx get <path> Read an entry
mx list --tags=<tag> List entries by tag
mx tree Directory structure
mx whats-new Recent changes

Create & Edit

Command Description
mx add Create new entry with metadata
mx append Append to existing or create
mx patch Find/replace in an entry
mx ingest Import file into KB

Relations & Graph

Command Description
mx relations <path> Query entry relations
mx relations-add Add typed relation
mx relations-lint Check relation consistency
mx hubs Find high-connectivity entries
mx suggest-links Semantic link suggestions

Maintenance

Command Description
mx health Audit KB integrity
mx reindex Rebuild search indices
mx eval Search quality metrics (--dataset required)
mx publish Generate static site

Agent Tools

Command Description
mx prime Session context for agents
mx schema --compact CLI schema (minimal tokens)
mx batch Multiple commands, one invocation

Entry Format

Entries are Markdown files with YAML frontmatter:

---
title: API Guide
tags: [api, docs]
description: Endpoints and auth
relations:
  - path: reference/auth.md
    type: documents
---

# API Guide

See [[reference/auth]] for auth details.

Relation types: depends_on, implements, extends, documents, references, blocks, related.

Philosophy

Design Principles
  • CLI-first: The command line is the primary interface. GUI is optional, CLI is mandatory.
  • Local-first: Your data stays on your machine. No cloud required, no network latency.
  • AI-friendly: Structured output, compact schemas, batch operations. Built for agents that read documentation.
  • Plain text: Markdown + YAML. No proprietary formats. Readable in any editor from now until forever.
  • Do one thing well: Knowledge management, not project management, not note-taking, not todo lists.
  • Substance over style: Fast, reliable, predictable. No surprises, no lock-in.