Skip to main content

Universal knowledge base with Qdrant for Claude Code integration

Project description

Claude KB

Universal knowledge base with Qdrant for Claude Code integration.

Provides semantic search across:

  • Claude Code conversation history
  • Personal knowledge entities
  • Documents and research notes

Installation

Run directly (no install)

uvx claude-kb status

Install as a tool

uv tool install claude-kb
kb status

Development

git clone https://github.com/tenequm/claude-kb.git
cd claude-kb
uv sync --extra dev

Features

  • Hybrid search: Dense (semantic) + sparse (keyword) vectors with RRF fusion
  • Claude Code import: Automatically import your conversation history
  • LLM-optimized CLI: kb ai command provides token-efficient schema for AI agents
  • FastEmbed/ONNX: Fast local embeddings with bge-base-en-v1.5 (768 dim, ~1s search time)
  • Self-hosted: Run locally with Docker Compose

Quick Start

# Start Qdrant
docker compose up -d

# Initialize collections
kb init

# Import your Claude Code conversations
kb import claude-code-chats

# Search!
kb search "qdrant vector databases"

Usage

Search conversations

kb search "your query"
kb search "query" --collection conversations --limit 20

Get specific message

kb get msg_abc123

Check status

kb status

LLM-optimized schema (for AI agents)

kb ai

This outputs a token-efficient format that Claude Code and other LLMs can parse to understand how to use the CLI. See docs/AI_COMMAND_SPEC.md for details.

Architecture

  • Simplified structure: cli.py, core.py, import_claude.py (No manual embedding code!)
  • Qdrant collections: conversations, entities, documents
  • Embedding: QdrantClient built-in FastEmbed with BAAI/bge-base-en-v1.5 (768 dim, ONNX-optimized)
  • Search time: ~1 second total (0.7s model load + 0.3s search)
  • Output format: Structured plaintext (NOT JSON) optimized for LLM parsing

Configuration

Create .env file (see .env.example):

QDRANT_URL=http://localhost:6333
EMBEDDING_MODEL=BAAI/bge-base-en-v1.5  # FastEmbed model (768 dims, ~1s search)

# Alternative models:
# EMBEDDING_MODEL=BAAI/bge-small-en-v1.5  # Faster (384 dims, ~0.5s)
# EMBEDDING_MODEL=BAAI/bge-large-en-v1.5  # Higher quality (1024 dims, ~2s)

Development

# Format + lint
ruff format . && ruff check . --fix

# Test (manual for now)
uv run kb --help

Roadmap

  • Streaming search (background mode)
  • Entity management (kb add entity)
  • Document import (kb add document)
  • Relationship traversal (kb related)
  • Full hybrid search (sparse vectors)
  • Token-aware context window truncation

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_kb-0.1.1.tar.gz (94.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_kb-0.1.1-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file claude_kb-0.1.1.tar.gz.

File metadata

  • Download URL: claude_kb-0.1.1.tar.gz
  • Upload date:
  • Size: 94.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for claude_kb-0.1.1.tar.gz
Algorithm Hash digest
SHA256 58f145e7ab725b17036939da67e6ac39379a1a285b2c314fbdf59fe4a488ba21
MD5 8f2dd268a419ea4e89ce48d32e34e0a9
BLAKE2b-256 eba22505080af50deb74d71e12d0365662bff0c9cd46cbc183387900f401e3db

See more details on using hashes here.

File details

Details for the file claude_kb-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: claude_kb-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for claude_kb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f21dda05a5519114bdfe6e74908a964dad6b6c56abd7cba882629af79cc7c2f
MD5 836175604f74cc6fcf1748a598018a70
BLAKE2b-256 0025022dc54f76e281d8776981a5ac7213730312514d91e600dccbc2b2ac4712

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page