This release is a pre-release and may not be stable for production use.
ripgrep for documents, made for AI agents.
Search, read and cite PDF, Word, PowerPoint, Excel, HTML and Markdown files.
One local index, a Rust engine, a CLI and a Python API. No server, no API key.
Documentation · Quickstart · For agents · Python · Benchmarks
Coding agents are great at code because code is text: grep finds the line, then they read the
file around it. Documents break that loop. PDFs and Office files aren't text, and a whole report
doesn't fit in a prompt. foliq gives agents the same loop for documents: find a passage,
read exactly the section around it, and cite where it came from, all within a token budget.
$ pip install foliq
$ foliq index papers/
synced: 4 added, 0 updated, 0 unchanged, 0 removed
papers 4 documents, 281 chunks, 91475 tokens
$ foliq search "parallel attention layers heads" --limit 1
papers/attention.pdf#1.1 (p5, L131-143) Attention Is All You Need > Abstract [14.73]
Multi-head attention allows the model to jointly attend to information from different
representation subspaces at different positions. With a single attention head, averaging...
$ foliq read papers/attention.pdf#p5 --budget 800 # one page, or one section: #1.1
$ foliq context "why use multiple attention heads" --budget 1500
Real output, on four arXiv papers (Attention, BERT, RAG and chain-of-thought).
Why foliq
- Built for agents, not for chat UIs. Every hit is a citation like
papers/attention.pdf#1.1 (p5, L131-143), and every citation is also a reference thatreadaccepts. An agent goes from a search hit to the full section in one step, and quotes its source. - Answers that fit.
outlineshows each section's size in tokens,read --budgetstops on time, andcontext --budgetpacks the best passages (whole sections when they fit) into the budget you give it. - Never stale. Every command syncs first, and only changed files are parsed again: modified time and size, then a content hash, then the parser and splitter versions decide.
- Local and private. One
.foliq/folder with a SQLite index. No daemon, no embeddings API, no network. Access lists on documents are applied before ranking, so a search never leaks what its user may not see. - Fast where it counts. Parsing, splitting, token counting and search run in Rust, on all cores. The Python package is a compiled extension with no Python dependencies.
- Small core, everything pluggable. Sources, parsers, splitters, stores and sinks are small Rust traits. Fill any of them from Rust, or from a plain Python class.
Quickstart
$ uvx foliq index ./docs # try it without installing (or: pip install foliq)
$ foliq search "refund enterprise customers"
$ foliq outline docs/billing.pdf # sections, with their sizes in tokens
$ foliq read docs/billing.pdf#2.3 # exactly one section
$ foliq context "how long do refunds take" --budget 1500
Copies of PDFs and Office files as Markdown live in .foliq/text/, so plain grep works on
them too. Add --json to any command for machine-readable output.
Give it to your agent
$ foliq skill > .claude/skills/foliq/SKILL.md
The skill file teaches
Claude Code, Codex and any agent that reads SKILL.md the search, outline, read and cite loop.
No MCP server to run: the agent calls the foliq command it already has.
Python
$ uv add foliq # or: pip install foliq
import foliq
index = foliq.Index(".foliq")
index.add("docs")
index.add("hr", access=["group:hr"]) # only principals in group:hr see these
index.sync()
for hit in index.search("refund policy", limit=5):
print(hit["citation"], hit["title"])
index.read("docs/billing.pdf#2.3", budget=800)
index.context("how long do refunds take?", budget=1500)["text"]
Tools for any agent framework
tools = index.tools(principal="user:ana") # sees only what user:ana may see
openai_tools = [tool.to_openai() for tool in tools] # or .to_anthropic()
by_name = {tool.name: tool for tool in tools}
result_text = by_name[call.name].call_json(call.arguments)
Five tools (search_documents, get_context, list_documents, outline_document,
read_document), each a plain function with a JSON schema. The principal is bound when the tools
are made, so the model can never ask for someone else's documents.
Plugins
A Python plugin is any object with the right method:
class CsvParser:
extensions = ("csv",)
def parse(self, data: bytes, path: str) -> str:
return csv_to_markdown(data) # return Markdown; foliq finds the structure
class QdrantSink:
def apply(self, changes: list[dict]) -> None:
... # every upsert and delete, after each sync
index = foliq.Index(parsers=[CsvParser()], sinks=[QdrantSink()])
Rust plugins implement the same traits as the built-ins (Source, Parser, Splitter, Store,
Sink in foliq-core). The
engine never special-cases a built-in. See Plugins.
Benchmarks
Measured against the libraries people use today, on public corpora full of real and broken files, with every number reproducible from one command (method and all results):
| foliq | Others | |
|---|---|---|
| Word (.docx), files/s, one thread | 129 | Kreuzberg 129 · python-docx 35 · pandoc 3.1 · MarkItDown 2.1 |
| PowerPoint (.pptx), files/s, one thread | 148 | Kreuzberg 269 · python-pptx 50 · MarkItDown 9.4 |
| Excel (.xlsx), text quality | 76% | openpyxl 72% · Kreuzberg 71% · MarkItDown 55% |
| Broken PDFs, failures out of 1,077 | 11 | PyMuPDF 14 · pypdfium2 24 · pypdf 34 |
| Search (BEIR SciFact), nDCG@10 | 0.688 | bm25s 0.686 · SQLite FTS5 0.682 · tantivy 0.668 |
foliq's times include the whole pipeline (parsing, splitting, token counting and indexing), not just text extraction. Where it is behind, the benchmarks say so: Kreuzberg is faster on PowerPoint, and PDF reading order (86% vs 95% for PyMuPDF) and single-thread PDF speed are the next things to improve.
How it works
Source ──► Parser ──────► Splitter ──► Store ──────► search · outline · read · context
(folders) (→ Markdown) (→ chunks) (SQLite FTS)
└─────────► Sinks (Markdown mirror, your exports)
Every format becomes one Markdown text. Headings, tables and pages are found in that text, and
everything else (sections, chunks, citations) is a byte range of it. Sections are numbered like an
outline (2.3), so a search hit always knows its heading path, its lines and its pages. Read more
in How it works.
| Format | Extensions | What foliq keeps |
|---|---|---|
| text per page, with page numbers (pdf_oxide, pure Rust) | ||
| Word | docx | headings from styles, lists, tables |
| PowerPoint | pptx | one section per slide, with speaker notes |
| Excel, OpenDocument | xlsx, xlsm, xlsb, xls, ods | tables, dates, formulas, comments, per sheet |
| HTML | html, htm, xhtml | main content, headings, lists, tables |
| Markdown, text | md, markdown, mdx, txt, rst | as is |
Scanned PDFs need OCR, which is not built in yet.
Status and roadmap
foliq is young (0.1, alpha) and its API may change. Version 0.1 has folders, SQLite full-text search, the formats above, access rules, the CLI and the Python API, with prebuilt wheels for Linux, macOS and Windows. Next: embeddings and hybrid search, an MCP server, cloud sources (S3, Azure), Postgres, and Rust plugins shipped as Python wheels.
Development
uv sync # tools, and builds the extension
uv run pytest # Python tests
scripts/cargo-test.sh --workspace # Rust tests
uv run prek install # git hooks: ruff, ty, cargo fmt, clippy, tests
uv run --only-group docs zensical serve # docs on http://localhost:8000
The Rust code is written to be read by Python developers: small files, plain names, and a comment on every Rust idea a Python developer wouldn't know. AGENTS.md has the design and the code style.
License
Metadata
Release files for foliq 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| foliq-0.1.0a1.tar.gz | 505.3 kB | With provenance | Details for foliq-0.1.0a1.tar.gz |
Built distributions (wheels)
Total release size: 105.7 MB
Release files / foliq-0.1.0a1.tar.gz
| Download URL | foliq-0.1.0a1.tar.gz |
|---|---|
| Size | 505.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ab0a91659a2835ba229515b07a1c4fde67c5f1eb90af7e2d71962447e7848db
|
|
BLAKE2b-256 checksum How to use checksums |
d2855249b3e667adf39d479e0c61017cac1b120a118d20b555218c1bf4022ba3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / foliq-0.1.0a1-cp311-abi3-win_amd64.whl
| Download URL | foliq-0.1.0a1-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 15.4 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b7db8315bb3026a8c235f996c4d832ed42f20df9fe0c13cb8958a81b38df2115
|
|
BLAKE2b-256 checksum How to use checksums |
d349e91367a167c26244bdfa27111c3c1447c1dec04b6aa4f8fb8dc9cddca900
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / foliq-0.1.0a1-cp311-abi3-musllinux_1_2_x86_64.whl
| Download URL | foliq-0.1.0a1-cp311-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 15.6 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
80fae464cfa3bacc4cd81bd436f8cb4a2a346a56c8d2d9dbc75749175e8d5259
|
|
BLAKE2b-256 checksum How to use checksums |
8ce9555616e14f86020c7e434725dd48ad53e4e1375c15e776e4dae41f23be81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / foliq-0.1.0a1-cp311-abi3-musllinux_1_2_aarch64.whl
| Download URL | foliq-0.1.0a1-cp311-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 14.9 MB |
| Tags | CPython 3.11 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
a1d5bf70c851dc0662d1c83c38746e2c7f3c8ccbf2d38338d871a3598be1d6f5
|
|
BLAKE2b-256 checksum How to use checksums |
0c0c3959e32d7508dd3f1abcd055ab9ed3ce83c0fed290ad916365869d6fafee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / foliq-0.1.0a1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | foliq-0.1.0a1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 15.3 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
86ed81430682a4d5c45e6c26ef69031738e42d9819c0d45ce51abf1e30182f57
|
|
BLAKE2b-256 checksum How to use checksums |
57fe04f8747ed7c98e7e6e1cd14c4667921df12614fa2e5861fa7308b2625265
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / foliq-0.1.0a1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | foliq-0.1.0a1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 14.7 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
5b92bb419a5f15aa556cf5499eec7d0c33180660ae26c1f7f62ac4ffad1d1af6
|
|
BLAKE2b-256 checksum How to use checksums |
6a125cbd873d3d07f757df80d864b33618fd529d1450e9b3aa477cf55cea2cf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / foliq-0.1.0a1-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | foliq-0.1.0a1-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 14.4 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8e5e6f4d22b5933e9630bcf31185be6b41271ac5547e1a4d22942b490f556c22
|
|
BLAKE2b-256 checksum How to use checksums |
6ad5ce99f8a3be3a279dfae851d3501d57a55034ebe72548de575002cdcc70d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / foliq-0.1.0a1-cp311-abi3-macosx_10_12_x86_64.whl
| Download URL | foliq-0.1.0a1-cp311-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 14.9 MB |
| Tags | CPython 3.11 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
e4a67788ffe8a8a7eed9f3c9387ae4dd9b0c3679c727dddbf9d00a7f42cbd480
|
|
BLAKE2b-256 checksum How to use checksums |
9093a2dbb8023399492e9005e72a40141bfe9f1945b7f25c0ccf5c57d0e321ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logSecurity for foliq 0.1.0a1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 8 files in this release have been uploaded with provenance metadata.
Attestation for foliq-0.1.0a1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.