|
1 | | -# Knowhere API |
| 1 | +<img width="1000" height="233" alt="20260506-102713" src="https://github.com/user-attachments/assets/896e64d2-e50e-4158-b71c-bc69e11c7c65" /> |
| 2 | + |
| 3 | +<h1 align="center">Prepare unstructured data for AI Agents</h1> |
| 4 | + |
| 5 | +<p align="center"> |
| 6 | + <a href="https://www.python.org/downloads/"> |
| 7 | + <img alt="Python Version" src="https://img.shields.io/badge/Python-%3E%3D%203.11-3776AB.svg?style=for-the-badge&logo=python&logoColor=white&labelColor=000000"> |
| 8 | + </a> |
| 9 | + <a href="https://github.com/Ontos-AI/knowhere/stargazers"> |
| 10 | + <img alt="GitHub stars" src="https://img.shields.io/github/stars/ontos-ai/knowhere?style=for-the-badge&logo=github&labelColor=000000"> |
| 11 | + </a> |
| 12 | + <a href="https://github.com/Ontos-AI/knowhere/actions"> |
| 13 | + <img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/Ontos-AI/knowhere/pr-ci.yml?style=for-the-badge&labelColor=000000"> |
| 14 | + </a> |
| 15 | + <br> |
| 16 | + <a href="https://github.com/Ontos-AI/knowhere/discussions"> |
| 17 | + <img alt="Join the community on GitHub" src="https://img.shields.io/badge/Join%20the%20community-blueviolet.svg?style=for-the-badge&logo=GitHub&labelColor=000000&logoWidth=20"> |
| 18 | + </a> |
| 19 | + <a href="https://ghcr.io/ontos-ai/knowhere"> |
| 20 | + <img alt="Container Images" src="https://img.shields.io/badge/CONTAINER%20IMAGES-2496ED.svg?style=for-the-badge&logo=docker&logoColor=white&labelColor=000000"> |
| 21 | + </a> |
| 22 | + <a href="https://github.com/Ontos-AI/knowhere/blob/main/LICENSE"> |
| 23 | + <img alt="License: Apache 2.0" src="https://img.shields.io/badge/APACHE%202.0-D97706.svg?style=for-the-badge&label=LICENSE&labelColor=000000"> |
| 24 | + </a> |
| 25 | +</p> |
| 26 | + |
| 27 | +<p align="center"> |
| 28 | + 🔗 <a href="https://knowhereto.ai">Website</a> | |
| 29 | + 📄 <a href="https://docs.knowhereto.ai/">Docs</a> | |
| 30 | + 🏠 <a href="https://github.com/Ontos-AI/knowhere-self-hosted">Self-Host</a> | |
| 31 | + 🖥️ <a href="https://github.com/Ontos-AI/knowhere-dashboard">Dashboard</a> |
| 32 | +</p> |
| 33 | + |
| 34 | +Knowhere is the open-source infrastructure for unstructured data processing. It automates the complex pipeline of extracting, parsing, and transforming messy documents into structured, high-quality data optimized for *AI Agents*, *Agentic RAG*, and *traditional vector-based RAG workflows*. |
| 35 | + |
| 36 | +> [!NOTE] |
| 37 | +> **Get started in seconds with Knowhere Cloud.** |
| 38 | +> Avoid the complexity of self-deployment. Use our managed API at [knowhereto.ai](https://knowhereto.ai) and enjoy **$5 in free credits** upon registration. |
| 39 | +
|
| 40 | +## 📢 News |
| 41 | + |
| 42 | +- **May 7, 2026**: 🚀 **Knowhere is now Open Source!** We have open-sourced our entire stack for document ingestion, parsing, and agentic RAG. You can now self-host the full platform using [knowhere-self-hosted](https://github.com/Ontos-AI/knowhere-self-hosted). Check out our [Contribution Guide](CONTRIBUTING.md) to get involved! |
| 43 | +- **Apr 30, 2026**: 📦 **Version [2026.04.30.1](https://github.com/Ontos-AI/knowhere/releases/tag/2026.04.30.1) has been released.** This update includes several stability improvements and initial support for the agentic RAG layer. See the [full changelog](https://github.com/Ontos-AI/knowhere/commits/2026.04.30.1) for details. |
| 44 | + |
| 45 | +## How it Works |
| 46 | + |
| 47 | +> [!TIP] |
| 48 | +> **TL;DR**: Knowhere parses documents into structured units, maps them in a graph, and lets agents navigate that context to find and cite reliable evidence. |
| 49 | +
|
| 50 | +Knowhere turns raw documents into a structured memory store that AI agents can navigate and cite. The process follows a three-stage pipeline: |
| 51 | + |
| 52 | +```mermaid |
| 53 | +flowchart LR |
| 54 | + A[📄 Document Parsing] --> B[🕸️ Graph Construction] |
| 55 | + B --> C[🤖 Agentic Retrieval] |
| 56 | + B --> D[🔍 Vector-based RAG] |
| 57 | + C --> E[✅ Cited Results] |
| 58 | + D --> E |
| 59 | +``` |
2 | 60 |
|
3 | | -Knowhere API is the backend repository for document ingestion, parsing, |
4 | | -retrieval, and MCP-oriented knowledge access. |
| 61 | +### 1. Document Parsing |
| 62 | +Knowhere routes files to specialized parsers for PDFs, Office docs, images, and more. We don't just extract text; we preserve the document's hierarchy: |
| 63 | +- **Hierarchical Paths**: Every chunk knows its exact location (e.g., `Section 2.1 > Table 4`). |
| 64 | +- **Multi-modal Units**: Tables and images are treated as distinct assets with their own metadata. |
| 65 | +- **Structural Awareness**: Heading levels and section boundaries are maintained to keep context intact. |
| 66 | + |
| 67 | +### 2. Memory Graph |
| 68 | +Parsed content is organized into a lightweight graph. It’s designed as a practical map for agents, not a complex ontology. |
| 69 | +- **Nodes**: Represent documents, sections, and chunks. |
| 70 | +- **Edges**: Map semantic relationships (keyword overlap, summaries) and structural links. |
| 71 | +This graph helps agents quickly understand what a document is about and which neighboring files might be relevant. |
| 72 | + |
| 73 | +### 3a. Agentic Retrieval |
| 74 | +An agent navigates the memory graph to find evidence rather than relying on a single vector lookup: |
| 75 | +- **Hybrid Discovery**: Fuses keyword and semantic search (RRF) for broad first-pass coverage. |
| 76 | +- **Agent Navigation**: The agent "walks" the graph, reviewing section previews to drill down into the most relevant paths. |
| 77 | +- **Cited Evidence**: Results are returned as traceable evidence — source document, section, chunk, and any linked image or table assets. |
| 78 | + |
| 79 | +### 3b. Vector-based RAG |
| 80 | +For teams that prefer a pure retrieval pipeline without agent overhead, Knowhere's parsed chunks plug directly into standard vector stacks: |
| 81 | +- **Dense Search**: Chunk embeddings stored in Qdrant, pgvector, or Milvus for fast ANN lookup. |
| 82 | +- **Sparse Search**: BM25 term index for keyword-sensitive queries. |
| 83 | +- **Multi-channel Fusion**: Dense and sparse results are fused with RRF before being returned, giving you the best of both signals. |
| 84 | + |
| 85 | +## Ecosystem |
| 86 | + |
| 87 | +| Repository | Description | |
| 88 | +|---|---| |
| 89 | +| [knowhere](https://github.com/Ontos-AI/knowhere) | **This repo.** Backend API and worker — document ingestion, parsing, graph construction, and retrieval. | |
| 90 | +| 🖥️ [knowhere-dashboard](https://github.com/Ontos-AI/knowhere-dashboard) | The web UI. Connects to the API for the full product experience. | |
| 91 | +| 🐳 [knowhere-self-hosted](https://github.com/Ontos-AI/knowhere-self-hosted) | Docker Compose stack for self-hosted deployments. Packages the API, worker, and dashboard together. | |
| 92 | +| 🐍 [knowhere-python-sdk](https://github.com/Ontos-AI/knowhere-python-sdk) | Official Python SDK for the Knowhere Cloud API. | |
| 93 | +| 🦕 [knowhere-node-sdk](https://github.com/Ontos-AI/knowhere-node-sdk) | Official Node.js SDK for the Knowhere Cloud API. | |
5 | 94 |
|
6 | 95 | ## Features |
7 | 96 |
|
8 | | -## Project Governance |
9 | | - |
10 | | -- Licensed under Apache 2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE). |
11 | | -- Contribution workflow and branch expectations live in |
12 | | - [CONTRIBUTING.md](CONTRIBUTING.md). |
13 | | -- Security reporting guidance lives in [SECURITY.md](SECURITY.md). |
14 | | -- Community behavior expectations live in |
15 | | - [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). |
16 | | - |
17 | | -## Repository Layout |
18 | | - |
19 | | -```text |
20 | | -knowhere-api/ |
21 | | -├── apps/ |
22 | | -│ ├── api/ |
23 | | -│ └── worker/ |
24 | | -├── packages/ |
25 | | -│ └── shared-python/ |
26 | | -├── deploy/ |
27 | | -│ ├── docker/ |
28 | | -│ └── local-dev/ |
29 | | -└── .github/workflows/ |
30 | | - └── build-images.yml |
31 | | -``` |
| 97 | +- **Multi-modal Parsing**: High-fidelity extraction from PDF, Office, and images, preserving headings, tables, and hierarchical paths. |
| 98 | +- **Lightweight Memory Graph**: Context-aware organization that links documents and chunks for better relationship understanding. |
| 99 | +- **Agentic RAG**: A hybrid retrieval engine combining traditional search (RRF) with autonomous agent navigation. |
| 100 | +- **Evidence-based Citations**: Every result is backed by traceable source paths, ensuring reliability for AI Agent decision-making. |
| 101 | + |
| 102 | +## Supported Formats |
| 103 | + |
| 104 | +**✅ Supported** |
| 105 | + |
| 106 | +- [x] `.pdf` `.docx` `.pptx` `.xlsx` `.csv` |
| 107 | +- [x] `.jpg` `.png` |
| 108 | +- [x] `.md` `.txt` `.json` |
| 109 | + |
| 110 | +**⏳ Coming Soon** |
| 111 | + |
| 112 | +- [ ] `.epub` `.html` `.xml` |
| 113 | +- [ ] `.mp4` `.mp3` |
| 114 | +- [ ] `.skills.md` |
32 | 115 |
|
33 | | -## Architecture Overview |
| 116 | +Want to see a new format supported? Adding a parser is a great first contribution. Check out [CONTRIBUTING.md](CONTRIBUTING.md) to get started. |
34 | 117 |
|
35 | 118 | ## Prerequisites |
36 | 119 |
|
37 | 120 | - Python 3.11+ |
38 | 121 | - `uv` |
39 | 122 | - Docker with `docker compose` |
40 | 123 |
|
41 | | -## Configuration |
42 | | - |
43 | 124 | ## Quick Start |
44 | 125 |
|
45 | 126 | 1. Sync the workspace dependencies: |
@@ -88,6 +169,8 @@ uv run scripts/init_user.py --email you@example.com |
88 | 169 | If you plan to use the dashboard, register through the dashboard instead of |
89 | 170 | using `scripts/init_user.py`. |
90 | 171 |
|
| 172 | +The API is now running at `http://localhost:5005`. If you want the full product experience with a UI, run the [knowhere-dashboard](https://github.com/Ontos-AI/knowhere-dashboard) alongside it — it connects to this API out of the box. |
| 173 | + |
91 | 174 | ## Quality Checks |
92 | 175 |
|
93 | 176 | Run lint checks from the repository root: |
@@ -122,9 +205,50 @@ make check |
122 | 205 | - PostgreSQL: `localhost:5432` |
123 | 206 | - Redis: `localhost:6379` |
124 | 207 |
|
125 | | -## Quick Example Request |
126 | | - |
127 | 208 | ## Additional Guides |
128 | 209 |
|
129 | 210 | - External dependency guide: |
130 | 211 | [docs/external-services.md](docs/external-services.md) |
| 212 | + |
| 213 | +## Citation |
| 214 | + |
| 215 | +If you use Knowhere in your research, please cite it as: |
| 216 | + |
| 217 | +```bibtex |
| 218 | +@software{knowhere2026, |
| 219 | + author = {Ontos AI}, |
| 220 | + title = {Knowhere: Prepare Unstructured Data for AI Agents}, |
| 221 | + year = {2026}, |
| 222 | + publisher = {GitHub}, |
| 223 | + url = {https://github.com/Ontos-AI/knowhere}, |
| 224 | + version = {2026.04.30.1}, |
| 225 | + license = {Apache-2.0} |
| 226 | +} |
| 227 | +``` |
| 228 | + |
| 229 | +## Communication |
| 230 | + |
| 231 | +- [GitHub Discussions](https://github.com/Ontos-AI/knowhere/discussions) for questions, ideas, and general conversation. |
| 232 | +- [GitHub Issues](https://github.com/Ontos-AI/knowhere/issues) for bug reports and feature requests. |
| 233 | + |
| 234 | +## Contribution |
| 235 | + |
| 236 | +Any contributions to Knowhere are more than welcome! |
| 237 | + |
| 238 | +If you are new to the project, check out the [good first issues](https://github.com/Ontos-AI/knowhere/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). They are well-defined, relatively simple, and a great way to get familiar with the codebase and the contribution workflow. |
| 239 | + |
| 240 | +For general guidelines on branching, commit conventions, and the review process, take a look at [CONTRIBUTING.md](CONTRIBUTING.md). |
| 241 | + |
| 242 | +Other useful references: |
| 243 | + |
| 244 | +- [SECURITY.md](SECURITY.md) — how to report vulnerabilities responsibly. |
| 245 | +- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) — community behavior expectations. |
| 246 | +- [LICENSE](LICENSE) and [NOTICE](NOTICE) — Apache 2.0. |
| 247 | + |
| 248 | +## 👋 We're Hiring! |
| 249 | + |
| 250 | +We're building the knowledge layer for the Agent era. If that sounds like work you want to do, reach out — decode the address below and drop us a line: |
| 251 | + |
| 252 | +```bash |
| 253 | +echo 'dGVhbUBrbm93aGVyZXRvLmFp' | base64 --decode |
| 254 | +``` |
0 commit comments