Free to use · runs on your own machine
A knowledge library on your own files, for you and your AI agents
Drop in a folder of documents and search it three ways at once: by meaning, by word forms in 15 languages, and by exact API names. There is a web UI for you and an MCP server for Claude Code, pi, Cursor and other agents.
- One Rust binary via npx
- No Python, no database
- NVIDIA GPU, DirectML or CPU
# put a folder on the shelf
$ npx lib2027 add ./docs
# open the web UI → http://127.0.0.1:2027
$ npx lib2027Install
Install in one line
One binary: no Node.js, no Python. The installer checks the download against the npm registry and adds lib2027 to your PATH.
Windows (PowerShell)
irm https://lib2027.dev/install.ps1 | iexmacOS and Linux
curl -fsSL https://lib2027.dev/install.sh | shOr with Node.js
npx lib2027Nothing to install: npx lib2027 runs the same binary.
Then run the setup
lib2027 setuplib2027 setup picks your GPU or CPU and downloads the models, offers ready-made libraries and connects Claude Code, pi, Cursor or Claude Desktop.
Ready-made libraries
lib2027 installBuilt, verified and licensed for reuse — UK, Italian and Russian law to start with. lib2027 install opens a picker; search and agents see a library right away.
Update with lib2027 update, remove with lib2027 uninstall.
Benchmarks
Does it actually help a model answer?
Models don’t know recent or niche knowledge from memory, and adding more text alone doesn’t fix that. We measured what the right fragments do.
How we measured
Same model, same questions
Each comparison runs one model on one set of questions. The only thing that changes is what the model gets to read.
A placebo arm
Irrelevant text of the same length: a control for the idea that “more context helps”.
Preregistered
Questions, rules and success thresholds were fixed before any data were collected.
Repeated and tested
Each arm ran 3 times. Significance comes from a paired sign test on questions.
Share of correct answers
- No library
- Placebo
- With lib2027
- No library — the model answers from memory
- Placebo — irrelevant text of the same length
- With lib2027 — the fragments lib2027’s search returned
Fresh web docs (devdocs, Sept 2026)
150 questions · qwen3.8-27bThe same questions, small model
150 questions · 4BRussian law (15 codes, pravo.gov.ru)
150 questions · qwen3.8-27bUK legislation (15 Acts, legislation.gov.uk)
150 questions · qwen3.8-27bUK legislation, small model
150 questions · 4BItalian law (11 codes and laws, Normattiva)
150 questions · qwen3.8-27bItalian law, small model
150 questions · 4BGerman federal law (20 statutes, gesetze-im-internet.de)
150 questions · qwen3.8-27bGerman law, small model
150 questions · 4BFrench law (Constitution and 9 codes, Légifrance)
150 questions · qwen3.8-27bFrench law, small model
150 questions · 4BSpanish law (Constitution and 11 laws, BOE)
150 questions · qwen3.8-27bSpanish law, small model
150 questions · 4BEU legislation (EUR-Lex)
150 questions · 4BUS federal law (U.S. Code, CFR)
150 questions · 4BCanadian federal law
150 questions · 4BAustralian federal law
150 questions · 4BUkrainian law
150 questions · 4BBelarusian law
150 questions · 4BPolish law
150 questions · 4BDutch law
150 questions · 4Bthree.js r186 API quiz
90 answers · Claude Haiku 4.5¹ The whole law article is returned instead of the first 800 characters (the earlier result was 69.1%). On articles amended since 2024, the model goes from 25% to 81%.
Show the numbers as a table
| Task | Model | No library | Placebo | With lib2027 |
|---|---|---|---|---|
| Fresh web docs (devdocs, Sept 2026) 150 questions · qwen3.8-27b | qwen3.8-27b | 17.8% | 12.7% | 85.1% |
| The same questions, small model 150 questions · 4B | 4B | 9.1% | 0.4% | 83.1% |
| Russian law (15 codes, pravo.gov.ru) 150 questions · qwen3.8-27b | qwen3.8-27b | 34.7% | 33.8% | 84.4%¹ |
| UK legislation (15 Acts, legislation.gov.uk) 150 questions · qwen3.8-27b | qwen3.8-27b | 36.7% | 29.3% | 90.9% |
| UK legislation, small model 150 questions · 4B | 4B | 28.4% | 5.1% | 88.2% |
| Italian law (11 codes and laws, Normattiva) 150 questions · qwen3.8-27b | qwen3.8-27b | 11.8% | 4.2% | 82.4% |
| Italian law, small model 150 questions · 4B | 4B | 5.6% | 3.3% | 70.2% |
| German federal law (20 statutes, gesetze-im-internet.de) 150 questions · qwen3.8-27b | qwen3.8-27b | 21.3% | 16.4% | 88% |
| German law, small model 150 questions · 4B | 4B | 16.7% | 2.2% | 86.4% |
| French law (Constitution and 9 codes, Légifrance) 150 questions · qwen3.8-27b | qwen3.8-27b | 18.7% | 9.8% | 90.4% |
| French law, small model 150 questions · 4B | 4B | 12.9% | 3.8% | 85.8% |
| Spanish law (Constitution and 11 laws, BOE) 150 questions · qwen3.8-27b | qwen3.8-27b | 22% | 20.7% | 88.4% |
| Spanish law, small model 150 questions · 4B | 4B | 9.3% | 3.3% | 83.3% |
| EU legislation (EUR-Lex) 150 questions · 4B | 4B | 18.7% | 1.1% | 81.3% |
| US federal law (U.S. Code, CFR) 150 questions · 4B | 4B | 16.2% | 4.4% | 82.7% |
| Canadian federal law 150 questions · 4B | 4B | 17.8% | 4.4% | 84.4% |
| Australian federal law 150 questions · 4B | 4B | 10.7% | 4.7% | 84.7% |
| Ukrainian law 150 questions · 4B | 4B | 7.6% | 0.9% | 84.7% |
| Belarusian law 150 questions · 4B | 4B | 13.3% | 3.1% | 91.1% |
| Polish law 150 questions · 4B | 4B | 14.6% | 9.2% | 88.5% |
| Dutch law 150 questions · 4B | 4B | 9.8% | 0.2% | 91.3% |
| three.js r186 API quiz 90 answers · Claude Haiku 4.5 | Claude Haiku 4.5 | 27.8% | — | 88.9% |
Beyond the quiz: three.js with Claude Haiku 4.5
Answers that use an outdated API
24.4%5.6%
fewer is better
“Write a game” task, score out of 100
5275
higher is better
Turns to finish the game
5636
at a slightly lower cost
A library the model has never seen
2–5%84–96%
A 4B model goes from 2–5% to 84–96% of tasks passing when lib2027 delivers migration notes to the task.
The takeaway
Models don’t know recent or niche knowledge from memory, and more context alone doesn’t help: the placebo never beat answering from memory. What helps is the right fragments, and that is what lib2027 delivers.
Speed: Rust vs the earlier Python version
Measured on Windows with an RTX 5090, on the same shelf with the same queries. Both versions return the same results: on the law quiz, both delivered the article for 122 of 150 questions.
- Python + PyTorch
- lib2027 (Rust)
initializeadd ./docs (6 docs, 237 fragments)How it works
Three kinds of search, one ranked answer
Every query runs through three channels at once. The results are merged and re-ranked, and you or your agent get whole passages to read and cite, not scraps.
Meaning
Semantic search with the Qwen3-Embedding-0.6B embedder finds passages that say the same thing in other words.
Word forms
Morphology for Russian, English and 13 more languages: search for one form of a word and find the others.
Exact API names
Function, class and option names are matched exactly, so a name finds that very thing, not something that looks similar.
Reranker
The bge-reranker-v2-m3 cross-encoder reads each candidate together with the query and puts the best ones first.
Whole articles
Structure is kept. Laws are split by articles, and the whole article is delivered: that took the law benchmark from 69.1% to 84.4%.
Formats: md, txt, html, pdf, docx and source code (js, ts, json, …). npx lib2027 package <name> adds a whole npm package: API types, docs, tests and examples.
For agents
Connect it to Claude Code, pi, Cursor and other MCP clients
lib2027 works as an MCP server. One command connects it, and from then on the agent searches your libraries by itself.
Claude Code
npx lib2027 claudeRuns claude mcp add for you. Claude Code gets these tools:
search_knowledgeread_sourcelist_librariescheck_codeexplore_graph
pi
npx lib2027 piInstalls the MCP adapter in pi and connects lib2027. npx lib2027 pi --remove disconnects it.
Online, nothing to install
claude mcp add --transport http lib2027 https://mcp.lib2027.dev/mcpA free hosted MCP server with ready-made libraries: laws, dev and DevOps books, package docs. Pick the libraries on mcp.lib2027.dev — it gives you the URL and configs for Claude Code, Cursor, Claude Desktop and pi. Searches go to lib2027.dev; your own files stay local.
Only the libraries a project needs
npx lib2027 useRun it inside a project: a settings screen lists the shelf's libraries with live numbers — documents, fragments, knowledge graphs. Check what this project needs and save. The choice goes to .lib2027.json, which you can commit; the agent picks it up on its next call, no restart.
Cursor, Claude Desktop and other clients
Add this to the MCP config:
{ "mcpServers": { "lib2027": { "command": "npx", "args": ["-y", "lib2027", "mcp"] } } }On Windows, run npx through cmd:
{ "mcpServers": { "lib2027": { "command": "cmd", "args": ["/c", "npx", "-y", "lib2027", "mcp"] } } }Prefer a browser? npx lib2027 opens the web UI at http://127.0.0.1:2027, with an HTTP API next to it.
Commands
One binary, a handful of commands.
| Command | What it does |
|---|---|
add <folder|files…> [--name …] [--lang auto|ru|en|…] [--to slug] | A folder becomes a library; files are added to the given library. Re-running updates changed files. |
list | Libraries on the shelf |
install [slug|pattern…] [--list] [--force] | Ready-made libraries from the catalogue: a picker, or by name or pattern |
use [slug|pattern…] [--add …] [--drop …] [--all] | Which libraries the agent sees in this project: a settings screen, or flags for scripts |
search "query" [-l slug] [--top-k 5] | Search |
remove <slug> / restore <slug> | Hide from search / bring back (files stay on disk) |
package <npm-package>[@version] | A whole npm package: API types, docs, tests and examples |
ui [--port 2027] [--no-open] | Web UI and HTTP API (same as running with no command) |
mcp | MCP server over stdio (started by the agent) |
claude [--scope user|project] | Runs claude mcp add for you; without Claude Code, prints a config for other clients |
pi [--project] [--remove] | Installs the MCP adapter in pi and connects lib2027 (or disconnects it) |
ask "question" | An answer with verified citations (needs a model key: LIB2027_ANSWER_*) |
setup [--device cuda|directml|cpu] | Installs the runtime and models ahead of time |
update [--check] / uninstall | Updates lib2027 itself (when installed with the install script) |
doctor | Shows what is installed and what it computes on |
Runs where you work
Platforms
| Platforms | CUDA | DirectML | CPU |
|---|---|---|---|
| Windows x64 | ✓ | ✓ | ✓ |
| Windows arm64 | — | — | ✓ |
| Linux x64glibc 2.35+ | ✓ | — | ✓ |
| Linux arm64glibc 2.35+ | — | — | ✓ |
| macOS Apple Silicon | — | — | ✓ |
Acceleration
NVIDIA CUDA on x64 Windows and Linux, DirectML on x64 Windows. Everything else runs on the CPU.
What you need
Only Node.js 18+. The first run downloads the rest into ~/.lib2027, once, in about 2 minutes: an ONNX runtime for your hardware and two models, Qwen3-Embedding-0.6B and bge-reranker-v2-m3.
Your documents stay on your device
Local by design
Your documents and the shelf stay on your device. Search runs in the binary on your own GPU or CPU.
Nothing sent unless you ask
Text goes to a third party only if you configure an external model for the answer service (LIB2027_ANSWER_*).
Localhost by default
Without LIB2027_API_KEY, the web UI and HTTP API need no key and are reachable from localhost only.
A plain folder
Each library is library.sqlite, vectors.f16 and knowledge.json. Copy the shelf and carry it around.
License
Free to use, including commercially, on any number of devices. Closed source. You may redistribute unmodified packages. The models and ONNX Runtime are downloaded from their publishers under their own licenses.
Try it on your own documents
Two commands. Node.js 18+ is all you need.
# put a folder on the shelf
$ npx lib2027 add ./docs
# open the web UI → http://127.0.0.1:2027
$ npx lib2027