Metadata-Version: 2.4
Name: agentkb
Version: 0.1.3
Summary: A unified search and knowledge tool for AI agents and developers
License-Expression: MIT
Requires-Python: <3.14,>=3.11
Requires-Dist: click>=8.0
Requires-Dist: numpy>=1.24
Requires-Dist: pylate>=1.1
Requires-Dist: pyyaml>=6.0
Requires-Dist: tree-sitter-c
Requires-Dist: tree-sitter-go
Requires-Dist: tree-sitter-java
Requires-Dist: tree-sitter-javascript
Requires-Dist: tree-sitter-python
Requires-Dist: tree-sitter-ruby
Requires-Dist: tree-sitter-rust
Requires-Dist: tree-sitter-typescript
Requires-Dist: tree-sitter>=0.24
Provides-Extra: web
Requires-Dist: beautifulsoup4>=4.12; extra == 'web'
Requires-Dist: requests>=2.28; extra == 'web'
Description-Content-Type: text/markdown

# AgentKB

> **Pre-alpha.** This is under active development. APIs, CLI commands, and storage formats may change without notice and will likely break frequently. Use at your own risk.

A knowledge tool that makes AI agents smarter over time. Braids together your **code**, a **wiki** of markdown files, and your **Claude Code chat history** into one searchable system.

The power is in the cross-intersection: code tells you *what exists*, chat history tells you *what was tried, what failed, and what was learned*, and the wiki captures the distilled lessons so the agent doesn't repeat mistakes. Each source fills gaps the others can't — code alone doesn't capture why a decision was made, chats alone are noisy and unsearchable, and a wiki alone goes stale without activity to drive updates.

Your data stays local, in universal formats (source files, markdown, JSONL), on your machine. Back everything up with `agentkb sync push` and restore on a new machine with `agentkb sync pull`.

## Install

```bash
pip install agentkb
```

## Quick Start

```bash
# Index your code
agentkb code index

# Search semantically
agentkb search "database connection pooling"

# Initialize a wiki
agentkb wiki init

# Index your Claude Code chat history
agentkb chats index

# Search across everything
agentkb search -s all "authentication flow"
```

## Stores

AgentKB has three store types:

- **Code** — source files parsed with tree-sitter (Python, JS, TS, Rust, Go, Java, C, Ruby), searchable by meaning
- **Wiki** — plain markdown files you and your agents write. Hard-won lessons, techniques, taste, people, tools, domain knowledge — anything that helps the agent do better work next time.
- **Chat History** — Claude Code conversations exported as readable markdown, fully searchable. The raw material that feeds the wiki.

## Search

```bash
agentkb search "retry logic with backoff"              # semantic search (default: code)
agentkb search -s wiki "why did we choose JWT"         # search wiki
agentkb search -s chats "how did I fix the auth bug"   # search chat history
agentkb search -s all "authentication"                 # search everything
agentkb search -e "async def" "error handling"         # regex + semantic
agentkb search --include="*.py" "config parsing"       # filter by file type
agentkb search --json "query"                          # JSON output for scripts
```

## Consolidation

Turn your git activity and chat history into wiki knowledge:

```bash
agentkb consolidate                   # what's happened in the last 7 days vs. wiki state
agentkb consolidate --since 30d       # last 30 days
```

This cross-references what changed in code, what was discussed in chats, and what's already in the wiki. It produces a report with every session in the time range, paths to read them, and instructions for extracting reusable knowledge. The agent reads the sessions, extracts lessons (mistakes, techniques, taste decisions, people knowledge, domain expertise), and writes or updates wiki pages.

## Agent Integration

```bash
agentkb hooks install                 # install Claude Code hooks
```

Hooks tell the agent about your wiki at session start and remind it about semantic search when it reaches for Grep/Glob.

## Documentation

Full docs at [isaacflath.com/agentkb](https://isaacflath.com/agentkb).

## How It Works

Hybrid search: ColBERT multi-vector embeddings (semantic) + SQLite FTS5 (keyword), fused with reciprocal rank fusion. Indexes are incremental — only changed files are re-encoded.
