Metadata-Version: 2.5
Name: librarian-toolkit
Version: 0.5.0
Summary: Source-available local knowledge library with hybrid search and an MCP server for AI coding agents. Free for noncommercial use and small businesses; other companies need a paid license.
Project-URL: Homepage, https://github.com/kevin-j-smith/librarian
Project-URL: Documentation, https://github.com/kevin-j-smith/librarian/tree/main/docs
Project-URL: Search backend (SearXNG), https://github.com/kevin-j-smith/librarian-searxng
Project-URL: Search backend (scholarly), https://github.com/kevin-j-smith/librarian-scholarly
Project-URL: Search backend (Brave), https://github.com/kevin-j-smith/librarian-brave
Project-URL: Search backend (USPTO), https://github.com/kevin-j-smith/librarian-uspto
Author: Kevin J. Smith
License-Expression: PolyForm-Noncommercial-1.0.0 OR PolyForm-Small-Business-1.0.0 OR LicenseRef-librarian-Commercial
License-File: COMMERCIAL-LICENSE.md
License-File: LICENSE.md
License-File: LICENSES/PolyForm-Noncommercial-1.0.0.md
License-File: LICENSES/PolyForm-Small-Business-1.0.0.md
License-File: NOTICE
License-File: THIRD_PARTY_NOTICES.md
Keywords: ai-agents,knowledge-base,local-first,mcp,rag,source-available,sqlite
Requires-Python: >=3.11
Requires-Dist: fastapi>=0.115
Requires-Dist: fastmcp<4,>=3.2
Requires-Dist: httpx>=0.27
Requires-Dist: huggingface-hub>=0.24
Requires-Dist: lxml>=5.0
Requires-Dist: mistune>=3.0
Requires-Dist: numpy>=1.26
Requires-Dist: onnxruntime-gpu<2,>=1.20; (sys_platform == 'win32' or sys_platform == 'linux') and (platform_machine == 'x86_64' or platform_machine == 'AMD64')
Requires-Dist: onnxruntime<2,>=1.20; (sys_platform != 'win32' and sys_platform != 'linux') or (platform_machine != 'x86_64' and platform_machine != 'AMD64')
Requires-Dist: openpyxl>=3.1
Requires-Dist: pdfplumber>=0.11
Requires-Dist: pydantic-ai-slim[openai]>=1.0
Requires-Dist: pydantic>=2.7
Requires-Dist: pypdfium2>=4.30
Requires-Dist: python-docx>=1.1
Requires-Dist: python-dotenv>=1.0
Requires-Dist: python-pptx>=1.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: readability-lxml>=0.8
Requires-Dist: sqlite-vec>=0.1.6
Requires-Dist: tokenizers>=0.19
Requires-Dist: trafilatura>=1.12
Requires-Dist: tree-sitter-cpp>=0.23.0
Requires-Dist: tree-sitter-go>=0.23.0
Requires-Dist: tree-sitter-java>=0.23.0
Requires-Dist: tree-sitter-javascript>=0.23.0
Requires-Dist: tree-sitter-python>=0.23.0
Requires-Dist: tree-sitter-rust>=0.23.0
Requires-Dist: tree-sitter-typescript>=0.23.0
Requires-Dist: tree-sitter>=0.23.0
Requires-Dist: typer>=0.12
Requires-Dist: uvicorn[standard]>=0.30
Provides-Extra: brave
Requires-Dist: librarian-brave>=0.1.0; extra == 'brave'
Provides-Extra: browser
Requires-Dist: crawl4ai<0.9,>=0.4.0; extra == 'browser'
Provides-Extra: cloud
Requires-Dist: anthropic>=1.0; extra == 'cloud'
Provides-Extra: cpu
Provides-Extra: dev
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Provides-Extra: encryption
Requires-Dist: sqlcipher3>=0.6.2; extra == 'encryption'
Provides-Extra: gpu
Requires-Dist: nvidia-cudnn-cu12>=9.10; ((sys_platform == 'win32' or sys_platform == 'linux') and (platform_machine == 'x86_64' or platform_machine == 'AMD64')) and extra == 'gpu'
Requires-Dist: onnxruntime-gpu[cuda,cudnn]<2,>=1.20; ((sys_platform == 'win32' or sys_platform == 'linux') and (platform_machine == 'x86_64' or platform_machine == 'AMD64')) and extra == 'gpu'
Provides-Extra: media
Requires-Dist: faster-whisper>=1.1.0; extra == 'media'
Requires-Dist: rapidocr-onnxruntime>=1.4.0; extra == 'media'
Requires-Dist: yt-dlp>=2025.1.15; extra == 'media'
Provides-Extra: research
Requires-Dist: librarian-searxng>=0.2.0; extra == 'research'
Provides-Extra: scholarly
Requires-Dist: librarian-scholarly>=0.1.0; extra == 'scholarly'
Provides-Extra: uspto
Requires-Dist: librarian-uspto>=0.1.0; extra == 'uspto'
Description-Content-Type: text/markdown

# librarian

> **License: source-available, not open source.** Installing from PyPI
> doesn't change the terms. librarian is free under
> [PolyForm Noncommercial 1.0.0](https://github.com/kevin-j-smith/librarian/blob/main/LICENSES/PolyForm-Noncommercial-1.0.0.md)
> (personal, hobby, research, education, nonprofits, government) or
> [PolyForm Small Business 1.0.0](https://github.com/kevin-j-smith/librarian/blob/main/LICENSES/PolyForm-Small-Business-1.0.0.md)
> (fewer than 100 people and under about $1.3 million in revenue). **Every
> other business needs a [commercial license](https://github.com/kevin-j-smith/librarian/blob/main/COMMERCIAL-LICENSE.md).**
> `librarian init` asks which one covers you and keeps the answer on your
> machine. Full terms: [LICENSE.md](https://github.com/kevin-j-smith/librarian/blob/main/LICENSE.md).

**A local, private knowledge library for AI coding agents.** librarian
ingests PDFs, web pages, whole websites, code, markdown, images, and videos,
keeps git repositories, Obsidian vaults, Zotero, feeds, and bookmarks in
sync, indexes it all with hybrid semantic and keyword search in one SQLite
file, and serves it to your coding agent through an MCP server, a REST API,
and a CLI. Indexing, embedding, and search run on your machine: no cloud
vector database and no API keys.

The distribution is `librarian-toolkit` (the PyPI name `librarian` belongs
to an unrelated project). The command and the import name are `librarian`.

## Install

Python 3.11 or newer, on Windows, macOS, or Linux.

```bash
pip install librarian-toolkit                 # or: uv tool install librarian-toolkit
pip install "librarian-toolkit[gpu]"          # with an NVIDIA GPU (CUDA 12 runtime)
pip install "librarian-toolkit[media,browser]"  # video/audio, headless-browser fallback
```

Then, in the folder that will hold your library (`library.db`, `models/`,
and `.env` are all relative to it):

```bash
librarian models download      # the embedding model, about 133 MB
librarian init                 # creates library.db and asks which license applies
librarian ingest https://docs.python.org/3/tutorial/classes.html --wait
librarian search "how do python class variables differ from instance variables"
librarian doctor               # checks the install
```

Connect it to an MCP client, for example Claude Code. `-C` names the
library's folder, since the client starts the server in its own:

```bash
claude mcp add librarian -- librarian -C /path/to/your/library mcp
```

**With `media` on an x86-64 machine, use the GPU build of ONNX Runtime
alone.** The media packages also pull in the CPU build, which can shadow the
GPU one; `librarian doctor` warns when both are installed. The fix is
`pip uninstall onnxruntime`, then
`pip install --force-reinstall --no-deps onnxruntime-gpu`. A source checkout
installed with `uv sync` avoids this.

More extras: `research` (the SearXNG search backend for the research loop),
`scholarly`, `brave`, `uspto` (more search backends), `encryption`
(SQLCipher), `cloud` (the Anthropic provider for research roles you allow
off the machine). The versions that are tested together are pinned in the
repository's `uv.lock`; a source install with `uv sync` uses exactly those.

## Documentation

- [Installation](https://github.com/kevin-j-smith/librarian/blob/main/docs/installation.md)
- [User guide](https://github.com/kevin-j-smith/librarian/blob/main/docs/user-guide.md)
- [MCP server](https://github.com/kevin-j-smith/librarian/blob/main/docs/mcp-server.md)
- [Configuration](https://github.com/kevin-j-smith/librarian/blob/main/docs/configuration.md)
- [Changelog](https://github.com/kevin-j-smith/librarian/blob/main/CHANGELOG.md)
- [Security policy](https://github.com/kevin-j-smith/librarian/blob/main/SECURITY.md)
  and [support policy](https://github.com/kevin-j-smith/librarian/blob/main/docs/support.md)
