Skip to main content

A modular, production-ready knowledge engine platform with clean architecture and multi-paradigm support (RAG, CLaRa).

Project description

fitz-ai โœจ

Python 3.10+ PyPI version License: MIT Version

Setup RAG in 5 minutes. No infrastructure. No boilerplate.

pip install fitz-ai

fitz quickstart ./docs "What is our refund policy?"

That's it. Your documents are now searchable with AI.


Why Fitz? โ˜€๏ธ

  • Point at a folder. Ask a question. Get an answer with sources.
  • Says "I don't know" when the answer isn't there. No hallucinations, no confident nonsense.
  • Smart chunking out of the box. AST-aware for Python, section-based for PDFs, heading-aware for Markdown.
  • Local execution possible. FAISS and Ollama support, no API keys required to start.
  • Plugin-based architecture. Swap LLMs, vector databases, rerankers, and retrieval pipelines via YAML config.
  • Full provenance. Every answer traces back to the exact chunk and document.
  • Data privacy: No telemetry, no cloud, no external calls except to the LLM provider you configure.

Any questions left? Try fitz on itself:

fitz quickstart ./fitz_ai "How does the chunking pipeline work?"

The codebase speaks for itself.


Features ๐ŸŽ

Actually admits when it doesn't know

When documents don't contain the answer, fitz says so:

Q: "What was our Q4 revenue?"
A: "I cannot find Q4 revenue figures in the provided documents.
    The available financial data covers Q1-Q3 only."

    Mode: ABSTAIN

Three constraint plugins run automatically:

  • ConflictAwareConstraint: Detects contradictions across sources
  • InsufficientEvidenceConstraint: Blocks answers without evidence
  • CausalAttributionConstraint: Prevents hallucinated cause-effect claims

Full Provenance

Every answer traces back to its source:

Answer: The refund policy allows returns within 30 days...

Sources:
  [1] policies/refund.md [chunk 3] (score: 0.92)
  [2] faq/payments.md [chunk 1] (score: 0.87)

Enrichment

Opt-in enrichment plugins enhance your knowledge base:

  • Code-derived artifacts: Navigation indexes, interface catalogs, dependency graphsโ€”extracted directly from your codebase via AST analysis. No LLM required.
  • LLM-generated summaries: Natural language descriptions for chunks, making code more discoverable via semantic search.

Your question matches enriched context, not just raw text. Fully extensibleโ€”add your own enrichment plugins.


Quick Start ๐Ÿš€

pip install fitz-ai

fitz quickstart ./docs "Your question here"

That's it. Fitz will prompt you for anything it needs.

Want to go fully local with Ollama? No problem:

pip install fitz-ai

ollama pull llama3.2
ollama pull nomic-embed-text

fitz quickstart ./docs "Your question here"

No data leaves your machine. No API costs. Same interface.


Real-World Usage

Fitz is a foundation. It handles document ingestion and grounded retrievalโ€”you build whatever sits on top: chatbots, dashboards, alerts, or automation.

Chatbot Backend ๐Ÿค–โ€‹

Connect fitz to Slack, Discord, Teams, or your own UI. One function call returns an answer with sourcesโ€”no hallucinations, full provenance. You handle the conversation flow; fitz handles the knowledge.

Example: A SaaS company plugs fitz into their support bot. Tier-1 questions like "How do I reset my password?" get instant answers. Their support team focuses on edge cases while fitz deflects 60% of incoming tickets.

Internal Knowledge Base ๐Ÿ“š

Point fitz at your companies wiki, policies, and runbooks. Employees ask natural language questions instead of hunting through folders or pinging colleagues on Slack.

Example: A 200-person startup ingests their Notion workspace and compliance docs. New hires find answers to "How do I request PTO?" on day oneโ€”no more waiting for someone in HR to respond.

Continuous Intelligence & Alerting ๐Ÿถ

Pair fitz with cron, Airflow, or Lambda. Ingest data on a schedule, run queries automatically, trigger alerts when conditions match. Fitz provides the retrieval primitive; you wire the automation.

Example: A security team ingests SIEM logs nightly. Every morning, a scheduled job asks "Were there failed logins from unusual locations?" If fitz finds evidence, an alert fires to the on-call channel before anyone checks email.

Web Knowledge Base ๐ŸŒŽ

Scrape the web with Scrapy, BeautifulSoup, or Playwright. Save to disk, ingest with fitz. The web becomes a queryable knowledge base.

Example: A football analytics hobbyist scrapes Premier League match reports. After ingesting, they ask "How did Arsenal perform against top 6 teams?" or "What tactics did Liverpool use in away games?"โ€”insights that would take hours to compile manually.

Codebase Search ๐Ÿ

Fitz includes built-in AST-aware chunking for Python. Functions, classes, and modules become individual searchable units with docstrings and imports preserved. Ask questions in natural language; get answers pointing to specific code.

Example: A team inherits a legacy Django monolithโ€”200k lines, sparse docs. They ingest the codebase and ask "Where is user authentication handled?" or "What API endpoints modify the billing table?" New developers onboard in days instead of weeks.


Architecture ๐Ÿ›

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         fitz-ai                               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  CLI Layer                                                    โ”‚
โ”‚  quickstart | init | ingest | query | chat | config | doctor  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Engines                                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                             โ”‚
โ”‚  โ”‚  Classic RAG  โ”‚  โ”‚   CLaRa   โ”‚  (pluggable)                โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Plugin System (all YAML-defined)                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”‚
โ”‚  โ”‚  LLM   โ”‚ โ”‚ Embedding โ”‚ โ”‚ Rerank โ”‚ โ”‚ VectorDB โ”‚             โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜             โ”‚
โ”‚  openai, cohere, anthropic, ollama, azure...                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Retrieval Pipelines (YAML-composed)                          โ”‚
โ”‚  dense.yaml | dense_rerank.yaml | custom...                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Enrichment (opt-in)                                          โ”‚
โ”‚  code artifacts | LLM summaries | custom plugins              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Constraints (epistemic safety)                               โ”‚
โ”‚  ConflictAware | InsufficientEvidence | CausalAttribution     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

CLI Reference

fitz quickstart [PATH] [QUESTION]    # Zero-config RAG (start here)
fitz init                            # Interactive setup wizard
fitz ingest                          # Interactive ingestion
fitz query                           # Single question with sources
fitz chat                            # Multi-turn conversation with your knowledge base
fitz collections                     # List and delete knowledge collections
fitz config                          # View/edit configuration
fitz doctor                          # System diagnostics

Beyond RAG ๐Ÿ”ฎ

RAG is a method. Knowledge access is a strategy.

Fitz is not a RAG framework. It's a knowledge platform that currently uses RAG as its primary engine.

from fitz_ai import run

# Today: Classic RAG
answer = run("What are the payment terms?", engine="classic_rag")

# Also available: CLaRa (compressed RAG, 16x smaller context)
answer = run("What are the payment terms?", engine="clara")

# Tomorrow: GraphRAG, HyDE, or whatever comes next
answer = run("What are the payment terms?", engine="graph_rag")

The engine is an implementation detail. Your ingested knowledge, your queries, your workflowโ€”all stay the same. When a better retrieval paradigm emerges, swap one line, not your entire codebase.


Philosophy ๐Ÿ“

Principles:

  • Explicit over clever: No magic. Read the config, know what happens.
  • Answers over architecture: Optimize for time-to-insight, not flexibility.
  • Honest over helpful: Better to say "I don't know" than hallucinate.
  • Files over frameworks: YAML plugins over class hierarchies.

License

MIT


About

Solo project by Yan Fitzner. ~40k lines of Python. 400+ tests. Built from scratchโ€”no LangChain or LlamaIndex under the hood.


Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fitz_ai-0.4.1.tar.gz (279.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fitz_ai-0.4.1-py3-none-any.whl (322.8 kB view details)

Uploaded Python 3

File details

Details for the file fitz_ai-0.4.1.tar.gz.

File metadata

  • Download URL: fitz_ai-0.4.1.tar.gz
  • Upload date:
  • Size: 279.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for fitz_ai-0.4.1.tar.gz
Algorithm Hash digest
SHA256 27c2b0f0d0913bb450794f547972fec18347246694a55fb4fcfabcef7953fc3c
MD5 f5a07a6eb3b8d5c9b0bce27de153acec
BLAKE2b-256 b52f1584afab9d771975a7f97c25053564bcb2b26dc121da9242658d7fd584c8

See more details on using hashes here.

File details

Details for the file fitz_ai-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: fitz_ai-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 322.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for fitz_ai-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1d0ef8053f0049f14a1f07dac84df02e634ad393b6eee2732f10c9e27b4340e
MD5 06d7bf3b029fb9b5dedee4a834362457
BLAKE2b-256 b32536144015b59a242843b072d754a1ea6aea0b79e36aefd96727c9b35fb17d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page