lekto GitHub★ 5
Beta v0.17.0 · Nov 20, 2026 · Self-hosted · GPL-3.0

Lekto reads every document.
And shows why.

A self-hosted, headless document management system. Text recognition, a language model and a final judgement file each document for you, and every value it sets must stand in the text. You see the evidence, not a guess.

docker compose up -d
Explainable intake

From scan to filed, with every step on record.

Several signals propose, the judgement decides. Each step is logged with its duration and result and can be repeated, so you can always trace why a document landed where it did.

1

Read

Upload, mail or API. Lekto splits stacks at separator sheets and recognises the text as a searchable PDF/A.

receiveseparationtext recognitionpages
2

Recognise

Signals propose a contact, a type and more: a language model, a classifier and similar documents.

language modelclassifiersimilar documents
3

Decide

The judgement weighs the proposals. A value counts only if it stands in the text.

judgementfieldsrelations
4

File

Rules add tags or set the title, then Lekto files the document in its space.

rulesfiling
5

Lane

Every run ends in one of three lanes, so you only look at what needs you.

donereviewaction needed
Done

Everything stands in the text and fits. Lekto files the document, and it shows up as new in the inbox.

Review

A value has no source in the text, or Lekto proposes a new contact. You confirm or correct it.

Action needed

A step failed or nothing was recognised. Lekto says what is missing and waits for you.

What it does

Built for a household archive that runs itself.

For home and small offices. Your documents, your server, your choice of model: local with Ollama or any OpenAI-compatible endpoint.

Facts and identifiers

A customer number or a domain tells Lekto who sent a document. IBANs, meter and contract numbers stay as facts of the document. Documents relate to each other, and recurring ones form series, so Lekto knows when the next one is due.

Customer no. 4711-0815power.exampleMeter 1ESY1160512345IBAN DE02…2051Series · yearly · next Nov 12, 2027

Mail

IMAP mailboxes with rules each. Attachments become documents, the mail's text becomes a PDF beside them.

Search words and meaning

Hybrid full-text and vector search in one query, always within your rights. Save views as lenses.

Invoice for accident repair · Berg MotorsNov 3, 2026
Car insurance 2026 · Northwind InsuranceJan 2, 2026
Settlement of car insurance claim · Northwind InsuranceNov 16, 2026

Rules you can test

Global or per space, built from conditions and actions. Titles come from Liquid templates, and a dry run shows what a rule would change on existing documents before you apply it.

Electricity {{ document_date | date: '%Y' }} – €{{ field.amount.amount }} → Electricity 2026 – €412.37

People and spaces

Native logins with TOTP or OpenID Connect. Rights belong to spaces, never to single documents.

Headless, with an MCP server

The REST API is the only way in. The web UI is one client, Claude and other AI clients are another, with the rights of the signed-in user. Signed webhooks and server-sent events for everything else.

// claude_desktop_config.json { "mcpServers": { "lekto": { "url": "https://dms.example.org/api/v1/mcp" } } }
Screenshots

A quiet interface for paperwork.

SvelteKit web UI in German and English, with its own design system. Works on the phone as well as on the desktop. All names and numbers in the pictures are made up.

The Lekto inbox with seven documents: one still being processed, a handwritten letter from Unicorn Pharmacy to review, a scan that needs action, and four new documents that Lekto filed on its own.

Every document lands in the inbox with its lane, so you only look at what Lekto was unsure about.

How it is built

Hexagonal core, everything else is an adapter.

  • HeadlessREST API with OpenAPI. Web UI, MCP server and the Paperless migration are its clients.
  • HexagonalA plain Python core with ports. FastAPI, SQLAlchemy and each service sit behind adapters with contract tests.
  • AsynchronousThe API answers at once, a worker processes. A transactional outbox feeds UI, webhooks and the index.
  • StorageSQLite or Postgres, file system or S3, Meilisearch. Originals never change and are addressed by SHA-256.
  • ModelsAny OpenAI-compatible endpoint: a language model, embeddings and optionally a vision model.
  • Made with ClaudeThe architecture, the ideas and every feature come from the author, as do parts of the code. Claude writes code too and, above all, reviews it.
FastAPISQLAlchemyMeilisearchS3 / filesLLM · VLMOCRmyPDFLekto coreports · python 3.13designed by the author · reviewed by Claude
Lekto and Paperless-ngx

A different approach to the same paper.

Lekto grew out of eight years with Paperless-ngx, and it doesn't compete with it. Paperless-ngx is a mature DMS that does its job well. Lekto takes another route: every document goes through a language model, and every decision can be traced back to the text.

Lekto suits you if

  • you want correct filing without sorting by hand.
  • you want to see why each value was set.
  • you run a language model anyway, local or cloud.
  • you want to ask your archive from Claude.

Paperless-ngx suits you better if

  • you mainly want to archive, not classify.
  • you don't want to pay for a language model.
  • you prefer a mature project with a big community.
  • you need a stable release today.

Both are for households and small offices. Lekto has no audit log, no revision-safe storage and no multi-tenancy, and it won't get them.

Why Lekto was built (German) →
Glossary

Lekto's words for things.

A few words in the app are Lekto’s own. Here is what they mean, and what other tools often call the same thing.

Lens elsewhere: saved view
A personal, saved look at the documents, with its filters, sort and layout.
Space elsewhere: workspace
Where documents live and rights are given. Every user has a personal space, shared spaces have members.
Beam elsewhere: quick look
A sheet from the side that shows a document's pages without leaving the page. Every document title opens it.
Stream elsewhere: timeline
A layout that shows documents along time, month by month, such as everything from one contact.
Signal elsewhere: suggestion source
One source that proposes values for a document. The language model, the classifier, similar documents and the facts of the text.
Judgement elsewhere: decision
The step that weighs what the signals propose and sets contact, type, tags and date. A value counts only if it stands in the text.
Lane elsewhere: status
Where a run ends. Done (green), Review (yellow) or Action needed (red).
Fact elsewhere: extracted data
Anything Lekto reads in one document, such as a name, a number or a date. Each fact points to its place in the text.
Quick start

Running in three commands.

Docker Compose with the published image. Open port 8000 and sign in as admin.

  • Point LEKTO_LLM_BASE_URL at Ollama or any OpenAI-compatible endpoint.
  • Coming from Paperless-ngx? The migration suite moves 9,000 documents in about three hours.
  • More setups: Postgres, S3, more workers, Caddy, Traefik, nginx.

Beta. Breaking changes can come with any release. Read the release notes before updating and keep a backup.

~/lekto
$ cd docker
$ cp .env.example .env
# now fill in the secrets in .env
$ docker compose up -d
 ✔ Container lekto-meilisearch  Started
 ✔ Container lekto-api          Started
 ✔ Container lekto-worker       Started
$ open http://localhost:8000