# OpenKB

> Compiles a document pile into an interlinked wiki once, instead of re-deriving it on every query

- Category: Retrieval & Knowledge (RAG) / RAG Frameworks & Platforms
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/VectifyAI/OpenKB
- Website: https://openkb.ai
- Canonical page: https://ai-tldr.dev/tools/openkb/

## In short

OpenKB is an open-source CLI from VectifyAI that turns a folder of raw documents into a structured, interlinked wiki-style knowledge base. The argument it makes against conventional RAG is about where the work happens: traditional retrieval rediscovers the same knowledge from scratch on every query and nothing accumulates. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Python and licensed Apache-2.0.

## Overview

OpenKB is an open-source CLI from VectifyAI that turns a folder of raw documents into a structured, interlinked wiki-style knowledge base. The argument it makes against conventional RAG is about where the work happens: traditional retrieval rediscovers the same knowledge from scratch on every query and nothing accumulates. OpenKB compiles the corpus once into summaries, concept pages, entity pages and cross-references, then keeps that wiki in sync as documents change.

Retrieval is handled by PageIndex, the same team's vectorless, reasoning-based index, which walks a tree structure over long documents rather than matching embeddings — so there is no vector database to run. It ingests PDF, Word, Markdown, PowerPoint, HTML, Excel, CSV, plain text and URLs, and handles figures, tables and images rather than text alone.

On top of the wiki sit generators: one-off `query`, multi-turn `chat` with resumable sessions, an interactive knowledge graph, single-file HTML decks, and a Skill Factory that distils redistributable agent skills out of the knowledge base. The wiki itself is plain Markdown with cross-links, so it opens in Obsidian, and its pages follow Google's Open Knowledge Format. Models are configured through LiteLLM, so OpenAI, Anthropic, Gemini and others all work.

## What it does

- Compiles documents into a persistent wiki of summaries, concept pages and auto-extracted entity pages, kept in sync as sources change
- Vectorless, reasoning-based retrieval via PageIndex tree indexing — no vector database to deploy
- Broad ingestion: PDF, Word, Markdown, PowerPoint, HTML, Excel, CSV, plain text and URLs
- Native multi-modality — retrieves and reasons over figures, tables and images, not just text
- Skill Factory distils redistributable agent skills from the compiled wiki
- Output is plain `.md` files with cross-links, Obsidian-compatible and following the Google Open Knowledge Format
- Bundled Knowledge Workbench web UI for browsing, uploading and streaming queries in the browser
- Any LiteLLM-supported provider, set at `openkb init` or in `.openkb/config.yaml`

## Getting started

OpenKB installs as a Python package and runs as a CLI inside a directory that holds your knowledge base. You need an LLM API key for whichever provider you configure.

1. Install the CLI

   Install from PyPI. You can also install the latest from GitHub, or clone and `pip install -e .` for development.

```bash
pip install openkb
```

2. Initialize a knowledge base and add documents

   Create a directory, initialize it, then add files, whole directories, or URLs. `init` is also where you pick the model.

```bash
mkdir my-kb && cd my-kb
openkb init

openkb add paper.pdf
openkb add ~/papers/                            # a whole directory
openkb add https://arxiv.org/pdf/2509.11420     # or fetch from a URL
```

3. Point it at a model

   Models use the LiteLLM `provider/model` format (for example `anthropic/claude-sonnet-4-6`); OpenAI models can omit the prefix. Set the model during `openkb init` or in `.openkb/config.yaml`, then put the key in a `.env` file. Subscription providers that use an OAuth device flow need no API key.

```bash
LLM_API_KEY=your_llm_api_key
```

4. Query or chat over the wiki

   Ask one-off questions, or open an interactive session that persists so you can resume it later.

```bash
openkb query "What are the main findings?"
openkb chat
```

5. Turn the wiki into other outputs

   The generators reuse the compiled knowledge base rather than re-reading the sources.

```bash
openkb skill new my-expert "Reason like an expert on <your-topic>"   # a portable agent skill
openkb visualize                                                     # an interactive knowledge graph
openkb deck new my-deck "An intro deck on <your-topic>"              # a single-file HTML deck
```

## When to use it

- Building a durable, browsable wiki over a research corpus so synthesis reflects everything ingested rather than the top-k chunks of one query
- Working with long, structured documents — reports, filings, manuals — where chunk-and-embed retrieval loses the document's hierarchy
- Querying a document set whose meaning lives in figures and tables as much as in prose
- Distilling a body of internal documentation into a portable agent skill other tools can load
