Metadata-Version: 2.4
Name: kbx
Version: 0.1.8
Summary: Local knowledge base CLI — hybrid search over markdown files with AI embeddings
Project-URL: Repository, https://github.com/tenfourty/kbx
Author: Jeremy Brown
License: Apache-2.0
License-File: LICENSE
Keywords: cli,embeddings,knowledge-base,llm,markdown,search
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Text Processing :: Indexing
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: click>=8.1
Requires-Dist: cryptography>=43.0
Requires-Dist: httpx>=0.27
Requires-Dist: jq>=1.8
Requires-Dist: pydantic>=2.6
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0
Requires-Dist: tomli>=2.0; python_version < '3.11'
Provides-Extra: all
Requires-Dist: bandit>=1.7; extra == 'all'
Requires-Dist: einops>=0.7; extra == 'all'
Requires-Dist: hypothesis>=6.0; extra == 'all'
Requires-Dist: lancedb>=0.15; extra == 'all'
Requires-Dist: mcp>=1.2; extra == 'all'
Requires-Dist: mlx>=0.30; extra == 'all'
Requires-Dist: mypy>=1.13; extra == 'all'
Requires-Dist: numpy>=1.26; extra == 'all'
Requires-Dist: pre-commit>=4.0; extra == 'all'
Requires-Dist: pytest-cov>=5.0; extra == 'all'
Requires-Dist: pytest-xdist>=3.5; extra == 'all'
Requires-Dist: pytest>=8.0; extra == 'all'
Requires-Dist: ruff>=0.8; extra == 'all'
Requires-Dist: sentence-transformers>=3.0; extra == 'all'
Requires-Dist: tokenizers>=0.15; extra == 'all'
Requires-Dist: transformers>=4.40; extra == 'all'
Requires-Dist: types-pyyaml>=6.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: bandit>=1.7; extra == 'dev'
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pre-commit>=4.0; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
Provides-Extra: mcp
Requires-Dist: mcp>=1.2; extra == 'mcp'
Provides-Extra: mlx
Requires-Dist: mlx>=0.30; extra == 'mlx'
Requires-Dist: transformers>=4.40; extra == 'mlx'
Provides-Extra: search
Requires-Dist: einops>=0.7; extra == 'search'
Requires-Dist: lancedb>=0.15; extra == 'search'
Requires-Dist: numpy>=1.26; extra == 'search'
Requires-Dist: sentence-transformers>=3.0; extra == 'search'
Requires-Dist: tokenizers>=0.15; extra == 'search'
Provides-Extra: test
Requires-Dist: hypothesis>=6.0; extra == 'test'
Requires-Dist: pytest-cov>=5.0; extra == 'test'
Requires-Dist: pytest-xdist>=3.5; extra == 'test'
Requires-Dist: pytest>=8.0; extra == 'test'
Description-Content-Type: text/markdown

# kbx

Local knowledge base CLI with hybrid search over markdown files. Indexes
meeting transcripts, notes, and entity records into SQLite (FTS5) and LanceDB
(vector) for fast retrieval by humans and AI agents.

## Install

```bash
pip install kbx                      # core CLI + FTS5 search
pip install "kbx[search]"            # + vector search (Qwen3 embeddings)
pip install "kbx[search,mlx]"        # + Apple Silicon acceleration
```

Requires Python 3.10+.

## Quick Start

```bash
kbx init                   # create kbx.toml in the current directory
kbx index run              # index markdown files
kbx search "quarterly planning"      # hybrid search (FTS5 + vector)
kbx search "quarterly planning" --fast   # keyword-only (no model needed)
```

## Features

- **Full-text search** -- SQLite FTS5 with BM25 ranking and natural date filters
- **Vector search** -- Qwen3-Embedding-0.6B via sentence-transformers, fused with FTS5 using reciprocal rank fusion (RRF)
- **Entity linking** -- auto-links people, projects, and glossary terms to documents via regex matching
- **Entity CRUD** -- manage people, projects, and glossary terms from the CLI with markdown file sync
- **MCP server** -- stdio transport for integration with Claude, Cursor, and other AI tools
- **Granola sync** -- pull meeting transcripts from the Granola API or ingest local exports
- **Configurable** -- `kbx.toml` controls source directories, search behaviour, and extras
- **Incremental indexing** -- content-hash based; only re-indexes changed files

## Configuration

kbx looks for configuration in this order:

1. `$KBX_CONFIG` environment variable
2. `./kbx.toml` in the current directory
3. `~/.config/kbx/config.toml`

Run `kbx init` to generate a starter config file.

## Optional Extras

| Extra | What it adds |
|-------|-------------|
| `search` | LanceDB + sentence-transformers + NumPy for vector search |
| `mlx` | MLX backend for faster embeddings on Apple Silicon |
| `mcp` | MCP server for AI tool integration |
| `all` | Everything above plus test and dev dependencies |

Install with: `pip install "kbx[search,mlx,mcp]"`

## Development

```bash
git clone https://github.com/tenfourty/kbx.git
cd kbx
uv sync --all-extras
uv run pre-commit install
uv run pytest -x -q --cov
```

See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

## License

Apache-2.0
