Metadata-Version: 2.5
Name: duckdb-vectors
Version: 261130
Summary: Frugal, embeddable semantic-search building block for agentic systems — hybrid vector + exact-token search over a local DuckDB file, no external vector database.
Project-URL: Homepage, https://github.com/bernard357/duckdb-vectors
Project-URL: Repository, https://github.com/bernard357/duckdb-vectors
Project-URL: Documentation, https://bernard357.github.io/duckdb-vectors/
Project-URL: Blog, https://boringsteps.org/duckdb-vectors
Project-URL: Issues, https://github.com/bernard357/duckdb-vectors/issues
Project-URL: Changelog, https://github.com/bernard357/duckdb-vectors/blob/main/CHANGES.md
Author-email: Bernard Paques <bernard.paques@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agents,bm25,duckdb,embeddings,llm,mcp,rag,semantic-search,vector-search,vectors
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Framework :: Pydantic :: 2
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Indexing
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: duckdb<3,>=2.0
Requires-Dist: fastembed>=0.3
Requires-Dist: mcp>=2.3
Requires-Dist: pydantic>=2.6
Requires-Dist: pypdf>=7.2
Requires-Dist: pypdfium2>=4
Requires-Dist: pyyaml>=6
Requires-Dist: rapidocr-onnxruntime<2,>=1.3
Requires-Dist: typer>=0.12
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.40; extra == 'anthropic'
Provides-Extra: bedrock
Requires-Dist: boto3>=1.34; extra == 'bedrock'
Provides-Extra: benchmarks
Requires-Dist: tiktoken>=0.7; extra == 'benchmarks'
Provides-Extra: dev
Requires-Dist: anthropic>=0.40; extra == 'dev'
Requires-Dist: boto3>=1.34; extra == 'dev'
Requires-Dist: jsonschema>=4; extra == 'dev'
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: openai>=1.40; extra == 'dev'
Requires-Dist: pytest-cov>=5; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Requires-Dist: vulture>=2.11; extra == 'dev'
Provides-Extra: openai
Requires-Dist: openai>=1.40; extra == 'openai'
Description-Content-Type: text/markdown

# duckdb-vectors

__A frugal, embeddable semantic-search building block for agentic systems — hybrid vector + exact-token search over a local DuckDB file, no external vector database.__

[![Python](https://img.shields.io/pypi/pyversions/duckdb-vectors)](https://pypi.org/project/duckdb-vectors/)
[![PyPI](https://img.shields.io/pypi/v/duckdb-vectors)](https://pypi.org/project/duckdb-vectors/)
[![Tests](https://github.com/bernard357/duckdb-vectors/actions/workflows/integrate.yml/badge.svg)](https://github.com/bernard357/duckdb-vectors/actions/workflows/integrate.yml)
[![MCP](https://img.shields.io/badge/MCP-stdio-blue)](https://bernard357.github.io/duckdb-vectors/docker-agent-guide)

🌐 __[Browse the documentation site](https://bernard357.github.io/duckdb-vectors/)__ — a searchable guide to every use case, harness, and deployment.

`duckdb-vectors` is a python package that facilitates the implementation of small-scale semantic search into any kind of agentic system, in 3 steps:

1. chunk items and store their embeddings in a DuckDB database
2. bake the database into the container that packages your agent
3. search semantically using vector distances and BM25 in tens of milliseconds

![Two ways to add semantic search to an agent: the usual external vector database with a network round trip, versus a DuckDB file baked into the agent's own container.](https://raw.githubusercontent.com/bernard357/duckdb-vectors/main/documentation/media/duckdb-vectors.excalidraw.png)

## Install

```shell
$ pip install duckdb-vectors
```

## Quick start

Index a folder of Markdown and PDF files into one DuckDB file, then search it:

```shell
$ duckdb-vectors index ./docs            # index a folder
$ duckdb-vectors status                  # report on database content
$ duckdb-vectors search "my question"    # hybrid search
$ duckdb-vectors mcp                     # serve retrieval as an MCP stdio server
```

```python
from duckdb_vectors import VectorStore

store = VectorStore()
for hit in store.query("my question", top_k=3):
    print(hit.score, hit.chunk.source, hit.chunk.text)
```

## Read the documentation

- [Try it in 5 minutes](https://bernard357.github.io/duckdb-vectors/quickstart-tutorial): a tutorial that builds its own tiny corpus.
- [Is it for me?](https://bernard357.github.io/duckdb-vectors/fit-workbook): when it fits, why, and the alternatives.
- [Core concepts](https://bernard357.github.io/duckdb-vectors/concepts-workbook): chunks, embeddings, hybrid search and a glossary.
- [User guide](https://bernard357.github.io/duckdb-vectors/duckdb-vectors-guide): index, search, configure, integrate and deploy.
- [Architecture](https://bernard357.github.io/duckdb-vectors/duckdb-vectors-primitive): building blocks, data model and design choices.
- [Connect it to your harness](https://bernard357.github.io/duckdb-vectors/docker-agent-guide): Docker Agent, LangChain, Kiro, OpenCode and more.
- [Performance](https://bernard357.github.io/duckdb-vectors/performance-workbook): measured latency, index size and model choice.

## Contributing

Contributions are welcome. Adding an embedding backend or a chunker is a great first pull request. See [CONTRIBUTING.md](https://github.com/bernard357/duckdb-vectors/blob/main/CONTRIBUTING.md) for the development setup, project principles, and pull-request guidelines.

## License

MIT.
