fitz-ai 0.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fitz_ai-0.3.4/LICENSE +21 -0
- fitz_ai-0.3.4/PKG-INFO +269 -0
- fitz_ai-0.3.4/README.md +235 -0
- fitz_ai-0.3.4/fitz_ai/__init__.py +139 -0
- fitz_ai-0.3.4/fitz_ai/backends/__init__.py +16 -0
- fitz_ai-0.3.4/fitz_ai/backends/local_llm/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/backends/local_llm/chat.py +64 -0
- fitz_ai-0.3.4/fitz_ai/backends/local_llm/embedding.py +58 -0
- fitz_ai-0.3.4/fitz_ai/backends/local_llm/rerank.py +58 -0
- fitz_ai-0.3.4/fitz_ai/backends/local_llm/runtime.py +127 -0
- fitz_ai-0.3.4/fitz_ai/backends/local_vector_db/__init__.py +7 -0
- fitz_ai-0.3.4/fitz_ai/backends/local_vector_db/config.py +36 -0
- fitz_ai-0.3.4/fitz_ai/backends/local_vector_db/faiss.py +393 -0
- fitz_ai-0.3.4/fitz_ai/backends/local_vector_db/runtime.py +19 -0
- fitz_ai-0.3.4/fitz_ai/cli/__init__.py +9 -0
- fitz_ai-0.3.4/fitz_ai/cli/chunk.py +318 -0
- fitz_ai-0.3.4/fitz_ai/cli/cli.py +92 -0
- fitz_ai-0.3.4/fitz_ai/cli/config.py +72 -0
- fitz_ai-0.3.4/fitz_ai/cli/db.py +252 -0
- fitz_ai-0.3.4/fitz_ai/cli/doctor.py +333 -0
- fitz_ai-0.3.4/fitz_ai/cli/errors.py +630 -0
- fitz_ai-0.3.4/fitz_ai/cli/help.py +34 -0
- fitz_ai-0.3.4/fitz_ai/cli/init.py +719 -0
- fitz_ai-0.3.4/fitz_ai/cli/plugins.py +51 -0
- fitz_ai-0.3.4/fitz_ai/cli/query.py +189 -0
- fitz_ai-0.3.4/fitz_ai/cli/quickstart.py +648 -0
- fitz_ai-0.3.4/fitz_ai/core/__init__.py +101 -0
- fitz_ai-0.3.4/fitz_ai/core/answer.py +81 -0
- fitz_ai-0.3.4/fitz_ai/core/config.py +422 -0
- fitz_ai-0.3.4/fitz_ai/core/constraints.py +82 -0
- fitz_ai-0.3.4/fitz_ai/core/detect.py +452 -0
- fitz_ai-0.3.4/fitz_ai/core/engine.py +60 -0
- fitz_ai-0.3.4/fitz_ai/core/exceptions.py +149 -0
- fitz_ai-0.3.4/fitz_ai/core/http.py +518 -0
- fitz_ai-0.3.4/fitz_ai/core/knowledge.py +0 -0
- fitz_ai-0.3.4/fitz_ai/core/paths.py +218 -0
- fitz_ai-0.3.4/fitz_ai/core/provenance.py +82 -0
- fitz_ai-0.3.4/fitz_ai/core/query.py +60 -0
- fitz_ai-0.3.4/fitz_ai/core/registry.py +381 -0
- fitz_ai-0.3.4/fitz_ai/core/utils.py +102 -0
- fitz_ai-0.3.4/fitz_ai/engines/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/engines/clara/__init__.py +149 -0
- fitz_ai-0.3.4/fitz_ai/engines/clara/config/__init__.py +22 -0
- fitz_ai-0.3.4/fitz_ai/engines/clara/config/loader.py +51 -0
- fitz_ai-0.3.4/fitz_ai/engines/clara/config/schema.py +159 -0
- fitz_ai-0.3.4/fitz_ai/engines/clara/engine.py +456 -0
- fitz_ai-0.3.4/fitz_ai/engines/clara/runtime.py +152 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/__init__.py +40 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/config/__init__.py +52 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/config/architecture.py +56 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/config/loader.py +92 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/config/normalize.py +75 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/config/presets.py +11 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/config/schema.py +162 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/contracts/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/contracts/roles.py +53 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/contracts/rules.py +26 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/engine.py +216 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/exceptions.py +107 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/generation/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/generation/prompting/__init__.py +11 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/generation/prompting/assembler.py +112 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/generation/prompting/profiles.py +16 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/generation/prompting/slots.py +23 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/generation/retrieval_guided/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/generation/retrieval_guided/synthesis.py +160 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/models/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/models/chunk.py +18 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/models/document.py +16 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/__init__.py +9 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/cli/__init__.py +55 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/cli/config_show.py +87 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/cli/query_with_preset.py +191 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/cli/test.py +142 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/context/pipeline.py +64 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/context/steps/dedupe.py +33 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/context/steps/group.py +40 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/context/steps/merge.py +64 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/context/steps/normalize.py +86 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/context/steps/pack.py +44 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/context/steps/render_markdown.py +28 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/pipeline/__init__.py +5 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/pipeline/base.py +22 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/pipeline/engine.py +169 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/pipeline/plugins/__init__.py +14 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/pipeline/plugins/debug.py +61 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/pipeline/plugins/easy.py +27 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/pipeline/plugins/fast.py +44 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/pipeline/plugins/standard.py +27 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/pipeline/pipeline/registry.py +24 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/retrieval/__init__.py +1 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/retrieval/runtime/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/retrieval/runtime/base.py +27 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/retrieval/runtime/engine.py +32 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/retrieval/runtime/plugins/__init__.py +1 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/retrieval/runtime/plugins/dense.py +134 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/retrieval/runtime/registry.py +24 -0
- fitz_ai-0.3.4/fitz_ai/engines/classic_rag/runtime.py +156 -0
- fitz_ai-0.3.4/fitz_ai/ingest/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/ingest/chunking/__init__.py +14 -0
- fitz_ai-0.3.4/fitz_ai/ingest/chunking/base.py +42 -0
- fitz_ai-0.3.4/fitz_ai/ingest/chunking/engine.py +82 -0
- fitz_ai-0.3.4/fitz_ai/ingest/chunking/plugins/__init__.py +4 -0
- fitz_ai-0.3.4/fitz_ai/ingest/chunking/plugins/simple.py +48 -0
- fitz_ai-0.3.4/fitz_ai/ingest/chunking/registry.py +24 -0
- fitz_ai-0.3.4/fitz_ai/ingest/cli/__init__.py +103 -0
- fitz_ai-0.3.4/fitz_ai/ingest/cli/list_plugins.py +115 -0
- fitz_ai-0.3.4/fitz_ai/ingest/cli/run.py +338 -0
- fitz_ai-0.3.4/fitz_ai/ingest/cli/stats.py +82 -0
- fitz_ai-0.3.4/fitz_ai/ingest/cli/validate.py +152 -0
- fitz_ai-0.3.4/fitz_ai/ingest/config/__init__.py +13 -0
- fitz_ai-0.3.4/fitz_ai/ingest/config/loader.py +67 -0
- fitz_ai-0.3.4/fitz_ai/ingest/config/schema.py +57 -0
- fitz_ai-0.3.4/fitz_ai/ingest/exceptions/__init__.py +15 -0
- fitz_ai-0.3.4/fitz_ai/ingest/exceptions/base.py +13 -0
- fitz_ai-0.3.4/fitz_ai/ingest/exceptions/chunking.py +13 -0
- fitz_ai-0.3.4/fitz_ai/ingest/exceptions/config.py +13 -0
- fitz_ai-0.3.4/fitz_ai/ingest/exceptions/vector.py +14 -0
- fitz_ai-0.3.4/fitz_ai/ingest/ingestion/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/ingest/ingestion/base.py +27 -0
- fitz_ai-0.3.4/fitz_ai/ingest/ingestion/engine.py +54 -0
- fitz_ai-0.3.4/fitz_ai/ingest/ingestion/plugins/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/ingest/ingestion/plugins/local_fs.py +101 -0
- fitz_ai-0.3.4/fitz_ai/ingest/ingestion/registry.py +24 -0
- fitz_ai-0.3.4/fitz_ai/ingest/pipeline/__init__.py +3 -0
- fitz_ai-0.3.4/fitz_ai/ingest/pipeline/ingestion_pipeline.py +66 -0
- fitz_ai-0.3.4/fitz_ai/ingest/validation/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/ingest/validation/documents.py +44 -0
- fitz_ai-0.3.4/fitz_ai/llm/__init__.py +45 -0
- fitz_ai-0.3.4/fitz_ai/llm/chat/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/llm/credentials.py +103 -0
- fitz_ai-0.3.4/fitz_ai/llm/embedding/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/llm/loader.py +170 -0
- fitz_ai-0.3.4/fitz_ai/llm/registry.py +81 -0
- fitz_ai-0.3.4/fitz_ai/llm/rerank/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/llm/runtime.py +303 -0
- fitz_ai-0.3.4/fitz_ai/llm/schema.py +332 -0
- fitz_ai-0.3.4/fitz_ai/llm/transforms.py +265 -0
- fitz_ai-0.3.4/fitz_ai/logging/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/logging/logger.py +50 -0
- fitz_ai-0.3.4/fitz_ai/logging/tags.py +24 -0
- fitz_ai-0.3.4/fitz_ai/runtime/__init__.py +54 -0
- fitz_ai-0.3.4/fitz_ai/runtime/config/__init__.py +0 -0
- fitz_ai-0.3.4/fitz_ai/runtime/registry.py +278 -0
- fitz_ai-0.3.4/fitz_ai/runtime/runner.py +225 -0
- fitz_ai-0.3.4/fitz_ai/vector_db/__init__.py +13 -0
- fitz_ai-0.3.4/fitz_ai/vector_db/base.py +35 -0
- fitz_ai-0.3.4/fitz_ai/vector_db/loader.py +491 -0
- fitz_ai-0.3.4/fitz_ai/vector_db/registry.py +47 -0
- fitz_ai-0.3.4/fitz_ai/vector_db/writer.py +159 -0
- fitz_ai-0.3.4/fitz_ai.egg-info/PKG-INFO +269 -0
- fitz_ai-0.3.4/fitz_ai.egg-info/SOURCES.txt +199 -0
- fitz_ai-0.3.4/fitz_ai.egg-info/dependency_links.txt +1 -0
- fitz_ai-0.3.4/fitz_ai.egg-info/entry_points.txt +4 -0
- fitz_ai-0.3.4/fitz_ai.egg-info/requires.txt +22 -0
- fitz_ai-0.3.4/fitz_ai.egg-info/top_level.txt +1 -0
- fitz_ai-0.3.4/pyproject.toml +83 -0
- fitz_ai-0.3.4/setup.cfg +4 -0
- fitz_ai-0.3.4/tests/test_clara_engine.py +355 -0
- fitz_ai-0.3.4/tests/test_cli_config_show.py +96 -0
- fitz_ai-0.3.4/tests/test_context_pipeline.py +25 -0
- fitz_ai-0.3.4/tests/test_context_pipeline_cross_file_dedupe.py +17 -0
- fitz_ai-0.3.4/tests/test_context_pipeline_markdown_integrity.py +15 -0
- fitz_ai-0.3.4/tests/test_context_pipeline_ordering.py +18 -0
- fitz_ai-0.3.4/tests/test_context_pipeline_pack_boundary.py +18 -0
- fitz_ai-0.3.4/tests/test_context_pipeline_unknown_group.py +15 -0
- fitz_ai-0.3.4/tests/test_context_pipeline_weird_inputs.py +22 -0
- fitz_ai-0.3.4/tests/test_default_config_loads_and_validates_minimally.py +32 -0
- fitz_ai-0.3.4/tests/test_default_preset_resolves.py +23 -0
- fitz_ai-0.3.4/tests/test_dense_retriever_basic_embedding_and_search.py +47 -0
- fitz_ai-0.3.4/tests/test_ingester_local_plugin_runs.py +13 -0
- fitz_ai-0.3.4/tests/test_ingester_returns_raw_documents.py +15 -0
- fitz_ai-0.3.4/tests/test_ingestion_pipeline_end_to_end.py +33 -0
- fitz_ai-0.3.4/tests/test_integration_v030.py +324 -0
- fitz_ai-0.3.4/tests/test_llm_auto_discovery.py +66 -0
- fitz_ai-0.3.4/tests/test_llm_engine_from_name.py +17 -0
- fitz_ai-0.3.4/tests/test_local_faiss_vector_db.py +203 -0
- fitz_ai-0.3.4/tests/test_local_faiss_vector_db_default_config.py +111 -0
- fitz_ai-0.3.4/tests/test_meta_config_shape.py +42 -0
- fitz_ai-0.3.4/tests/test_rag_pipeline_end_to_end.py +73 -0
- fitz_ai-0.3.4/tests/test_rag_pipeline_llm_failure.py +24 -0
- fitz_ai-0.3.4/tests/test_registry.py +57 -0
- fitz_ai-0.3.4/tests/test_retriever_basic_flow.py +42 -0
- fitz_ai-0.3.4/tests/test_retriever_engine_factory.py +26 -0
- fitz_ai-0.3.4/tests/test_retriever_metadata_preservation.py +45 -0
- fitz_ai-0.3.4/tests/test_retriever_rerank_flow.py +50 -0
- fitz_ai-0.3.4/tests/test_retriever_success.py +51 -0
- fitz_ai-0.3.4/tests/test_rgs_chunk_id_fallback.py +16 -0
- fitz_ai-0.3.4/tests/test_rgs_chunk_limit.py +19 -0
- fitz_ai-0.3.4/tests/test_rgs_exclude_query.py +12 -0
- fitz_ai-0.3.4/tests/test_rgs_max_chunks_limit.py +16 -0
- fitz_ai-0.3.4/tests/test_rgs_metadata_format.py +20 -0
- fitz_ai-0.3.4/tests/test_rgs_metadata_truncation.py +20 -0
- fitz_ai-0.3.4/tests/test_rgs_no_citations.py +21 -0
- fitz_ai-0.3.4/tests/test_rgs_prompt_core_logic.py +22 -0
- fitz_ai-0.3.4/tests/test_rgs_prompt_slots.py +21 -0
- fitz_ai-0.3.4/tests/test_rgs_strict_grounding_instruction.py +11 -0
- fitz_ai-0.3.4/tests/test_smart_qdrant.py +184 -0
- fitz_ai-0.3.4/tests/test_validation_filters_empty_documents.py +12 -0
- fitz_ai-0.3.4/tests/test_writer_basic.py +63 -0
- fitz_ai-0.3.4/tests/test_yaml_plugin_discovery.py +47 -0
fitz_ai-0.3.4/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Yan Fitzner
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
fitz_ai-0.3.4/PKG-INFO
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fitz-ai
|
|
3
|
+
Version: 0.3.4
|
|
4
|
+
Summary: A modular, production-ready engine platform with clean architecture and comprehensive observability.
|
|
5
|
+
Author: Yan Fitzner
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/yafitzdev/fitz-ai
|
|
8
|
+
Project-URL: Repository, https://github.com/yafitzdev/fitz-ai
|
|
9
|
+
Project-URL: Issues, https://github.com/yafitzdev/fitz-ai/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/yafitzdev/fitz-ai/blob/main/CHANGELOG.md
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: pydantic>=2.0
|
|
15
|
+
Requires-Dist: pyyaml>=6.0
|
|
16
|
+
Requires-Dist: qdrant-client>=1.7
|
|
17
|
+
Requires-Dist: httpx>=0.24
|
|
18
|
+
Requires-Dist: typing-extensions>=4.7
|
|
19
|
+
Requires-Dist: typer>=0.9
|
|
20
|
+
Requires-Dist: jinja2>=3.1
|
|
21
|
+
Provides-Extra: ingest
|
|
22
|
+
Requires-Dist: pdfminer.six; extra == "ingest"
|
|
23
|
+
Requires-Dist: python-docx; extra == "ingest"
|
|
24
|
+
Provides-Extra: local
|
|
25
|
+
Requires-Dist: ollama>=0.1.0; extra == "local"
|
|
26
|
+
Requires-Dist: faiss-cpu>=1.7.0; extra == "local"
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
30
|
+
Requires-Dist: black>=23.0; extra == "dev"
|
|
31
|
+
Requires-Dist: isort>=5.0; extra == "dev"
|
|
32
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# fitz-ai
|
|
36
|
+
|
|
37
|
+
[](https://www.python.org/downloads/)
|
|
38
|
+
[](LICENSE)
|
|
39
|
+
[](CHANGELOG.md)
|
|
40
|
+
|
|
41
|
+
## 🎯 Stable Knowledge Access, Today and Tomorrow
|
|
42
|
+
|
|
43
|
+
fitz-ai is a **knowledge access platform** for teams that need reliable, configurable retrieval **today**, without locking themselves into a single reasoning paradigm **tomorrow**.
|
|
44
|
+
|
|
45
|
+
You ingest your knowledge once. How it gets queried can evolve.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 🤔 Why fitz-ai Exists
|
|
50
|
+
|
|
51
|
+
Organizations repeatedly rebuild the same systems: ingest documents, chunk them, embed them, retrieve them, generate answers. Every time the reasoning method changes, everything breaks.
|
|
52
|
+
|
|
53
|
+
**The insight:** Reasoning methods evolve faster than knowledge.
|
|
54
|
+
|
|
55
|
+
- RAG today
|
|
56
|
+
- Compression-native models tomorrow
|
|
57
|
+
- Something else after that
|
|
58
|
+
|
|
59
|
+
But the knowledge layer remains.
|
|
60
|
+
|
|
61
|
+
Most RAG tools optimize *one method*. fitz-ai stabilizes the **knowledge layer itself**.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 🧠 The Mental Model
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Your Knowledge
|
|
69
|
+
↓
|
|
70
|
+
fitz-ai (Knowledge Access Layer)
|
|
71
|
+
↓
|
|
72
|
+
Engines (replaceable)
|
|
73
|
+
↓
|
|
74
|
+
Answer
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**What stays stable:** Ingested documents, chunking decisions, metadata, provenance, API contracts.
|
|
78
|
+
|
|
79
|
+
**What can change:** Retrieval strategies, reasoning methods, model providers, compression techniques.
|
|
80
|
+
|
|
81
|
+
You optimize for **stability where it matters** and **flexibility where change is inevitable**.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## ⚖️ How fitz-ai Is Different
|
|
86
|
+
|
|
87
|
+
This isn't a critique of other tools. It's a design difference.
|
|
88
|
+
|
|
89
|
+
| | LangChain & Similar | fitz-ai |
|
|
90
|
+
|---|---------------------|------|
|
|
91
|
+
| **Optimizes for** | Flows & prompt chains | Knowledge stability |
|
|
92
|
+
| **Assumes** | Rapid experimentation | Systems live for years |
|
|
93
|
+
| **Switching paradigms** | Often means refactoring | Means changing engines |
|
|
94
|
+
| **Best for** | Exploring ideas | Building infrastructure |
|
|
95
|
+
|
|
96
|
+
If you're exploring ideas, LangChain is excellent. If you're building infrastructure that will outlive your current model choices, fitz-ai is designed for that.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 🚀 Quick Start
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pip install fitz-ai
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
from fitz_ai.engines.classic_rag import run_classic_rag
|
|
108
|
+
|
|
109
|
+
answer = run_classic_rag("What does our contract say about termination?")
|
|
110
|
+
print(answer.text)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
That's it. Classic RAG works out of the box.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## ⚙️ Engines
|
|
118
|
+
|
|
119
|
+
Engines encapsulate *how* knowledge is queried. They're not plugins. They're paradigms.
|
|
120
|
+
|
|
121
|
+
### Classic RAG (Default) ✅
|
|
122
|
+
|
|
123
|
+
Production-ready retrieval-augmented generation.
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
from fitz_ai.engines.classic_rag import run_classic_rag
|
|
127
|
+
|
|
128
|
+
answer = run_classic_rag("What is our refund policy?")
|
|
129
|
+
|
|
130
|
+
for source in answer.provenance:
|
|
131
|
+
print(f"{source.source_id}: {source.excerpt}")
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### CLaRa (Experimental) 🧪
|
|
135
|
+
|
|
136
|
+
Compression-native reasoning for large document collections. 16x to 128x compression with unified retrieval and generation.
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
from fitz_ai.engines.clara import create_clara_engine
|
|
140
|
+
|
|
141
|
+
engine = create_clara_engine()
|
|
142
|
+
engine.add_documents(my_documents)
|
|
143
|
+
answer = engine.answer(Query(text="What patterns emerge across these reports?"))
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
> Engines are interchangeable. Your knowledge is not.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## ✅ When fitz-ai Makes Sense
|
|
151
|
+
|
|
152
|
+
- Internal company knowledge bases
|
|
153
|
+
- Compliance-sensitive environments
|
|
154
|
+
- Teams running local and cloud LLMs
|
|
155
|
+
- Long-lived systems where methods will change
|
|
156
|
+
|
|
157
|
+
## ❌ When fitz-ai Is Not a Fit
|
|
158
|
+
|
|
159
|
+
- Prompt-only experiments
|
|
160
|
+
- One-off demos
|
|
161
|
+
- No ingestion, no retrieval needed
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 📁 Project Structure
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
fitz_ai/
|
|
169
|
+
├── core/ # Stable contracts (Query, Answer, Provenance)
|
|
170
|
+
├── engines/ # Reasoning paradigms (classic_rag, clara)
|
|
171
|
+
├── ingest/ # Knowledge ingestion
|
|
172
|
+
├── runtime/ # Engine orchestration
|
|
173
|
+
├── llm/ # LLM plugins
|
|
174
|
+
└── vector_db/ # Vector DB plugins
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Architecture enforces separation: engines can be added or removed without destabilizing the core.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 💻 CLI
|
|
182
|
+
|
|
183
|
+
### Core Commands
|
|
184
|
+
|
|
185
|
+
| Command | Description |
|
|
186
|
+
|---------|-------------|
|
|
187
|
+
| `fitz init` | Interactive setup wizard |
|
|
188
|
+
| `fitz query "question"` | Query your knowledge base |
|
|
189
|
+
| `fitz config` | Show current configuration |
|
|
190
|
+
| `fitz db` | List/inspect vector collections |
|
|
191
|
+
| `fitz chunk ./file.txt` | Preview chunking strategies |
|
|
192
|
+
| `fitz doctor` | System diagnostics |
|
|
193
|
+
| `fitz plugins` | List all available plugins |
|
|
194
|
+
|
|
195
|
+
### Ingestion Commands
|
|
196
|
+
|
|
197
|
+
| Command | Description |
|
|
198
|
+
|---------|-------------|
|
|
199
|
+
| `fitz ingest ./docs collection` | Ingest documents into collection |
|
|
200
|
+
| `fitz ingest ./docs coll --chunk-size 500` | Custom chunk size |
|
|
201
|
+
| `fitz ingest validate ./docs` | Validate before ingesting |
|
|
202
|
+
| `fitz ingest plugins` | List ingest plugins |
|
|
203
|
+
|
|
204
|
+
### Database Commands
|
|
205
|
+
|
|
206
|
+
| Command | Description |
|
|
207
|
+
|---------|-------------|
|
|
208
|
+
| `fitz db` | List all collections |
|
|
209
|
+
| `fitz db default` | Inspect 'default' collection |
|
|
210
|
+
| `fitz db my_docs -n 10` | Show 10 sample chunks |
|
|
211
|
+
|
|
212
|
+
### Chunking Preview
|
|
213
|
+
|
|
214
|
+
| Command | Description |
|
|
215
|
+
|---------|-------------|
|
|
216
|
+
| `fitz chunk ./doc.txt` | Preview with defaults (1000 chars) |
|
|
217
|
+
| `fitz chunk ./doc.txt --size 500` | Smaller chunks |
|
|
218
|
+
| `fitz chunk ./docs/ --stats` | Stats only, no content |
|
|
219
|
+
| `fitz chunk --list` | List available chunkers |
|
|
220
|
+
|
|
221
|
+
### Examples
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# Setup and first query
|
|
225
|
+
fitz init
|
|
226
|
+
fitz ingest ./documents knowledge_base
|
|
227
|
+
fitz query "What are the main topics?"
|
|
228
|
+
|
|
229
|
+
# Inspect what's stored
|
|
230
|
+
fitz db knowledge_base
|
|
231
|
+
|
|
232
|
+
# Preview chunking before committing
|
|
233
|
+
fitz chunk ./large_doc.pdf --size 500 --stats
|
|
234
|
+
|
|
235
|
+
# Check system health
|
|
236
|
+
fitz doctor
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## 📐 Design Principles
|
|
242
|
+
|
|
243
|
+
- **Explicit over clever** | No hidden magic
|
|
244
|
+
- **Stable contracts** | The API doesn't break when internals change
|
|
245
|
+
- **Knowledge outlives methods** | Ingest once, query many ways
|
|
246
|
+
- **Engines are paradigms** | Not just config switches
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## 💡 Philosophy
|
|
251
|
+
|
|
252
|
+
RAG is a method.
|
|
253
|
+
Knowledge access is a strategy.
|
|
254
|
+
|
|
255
|
+
fitz-ai is built for the strategy.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 📚 Documentation
|
|
260
|
+
|
|
261
|
+
- [Engine Guide](docs/ENGINES.md) | Choosing and using engines
|
|
262
|
+
- [Architecture](docs/architecture.md) | Deep dive for contributors
|
|
263
|
+
- [Changelog](CHANGELOG.md) | Release history
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 📄 License
|
|
268
|
+
|
|
269
|
+
MIT
|
fitz_ai-0.3.4/README.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# fitz-ai
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org/downloads/)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](CHANGELOG.md)
|
|
6
|
+
|
|
7
|
+
## 🎯 Stable Knowledge Access, Today and Tomorrow
|
|
8
|
+
|
|
9
|
+
fitz-ai is a **knowledge access platform** for teams that need reliable, configurable retrieval **today**, without locking themselves into a single reasoning paradigm **tomorrow**.
|
|
10
|
+
|
|
11
|
+
You ingest your knowledge once. How it gets queried can evolve.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🤔 Why fitz-ai Exists
|
|
16
|
+
|
|
17
|
+
Organizations repeatedly rebuild the same systems: ingest documents, chunk them, embed them, retrieve them, generate answers. Every time the reasoning method changes, everything breaks.
|
|
18
|
+
|
|
19
|
+
**The insight:** Reasoning methods evolve faster than knowledge.
|
|
20
|
+
|
|
21
|
+
- RAG today
|
|
22
|
+
- Compression-native models tomorrow
|
|
23
|
+
- Something else after that
|
|
24
|
+
|
|
25
|
+
But the knowledge layer remains.
|
|
26
|
+
|
|
27
|
+
Most RAG tools optimize *one method*. fitz-ai stabilizes the **knowledge layer itself**.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 🧠 The Mental Model
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
Your Knowledge
|
|
35
|
+
↓
|
|
36
|
+
fitz-ai (Knowledge Access Layer)
|
|
37
|
+
↓
|
|
38
|
+
Engines (replaceable)
|
|
39
|
+
↓
|
|
40
|
+
Answer
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**What stays stable:** Ingested documents, chunking decisions, metadata, provenance, API contracts.
|
|
44
|
+
|
|
45
|
+
**What can change:** Retrieval strategies, reasoning methods, model providers, compression techniques.
|
|
46
|
+
|
|
47
|
+
You optimize for **stability where it matters** and **flexibility where change is inevitable**.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## ⚖️ How fitz-ai Is Different
|
|
52
|
+
|
|
53
|
+
This isn't a critique of other tools. It's a design difference.
|
|
54
|
+
|
|
55
|
+
| | LangChain & Similar | fitz-ai |
|
|
56
|
+
|---|---------------------|------|
|
|
57
|
+
| **Optimizes for** | Flows & prompt chains | Knowledge stability |
|
|
58
|
+
| **Assumes** | Rapid experimentation | Systems live for years |
|
|
59
|
+
| **Switching paradigms** | Often means refactoring | Means changing engines |
|
|
60
|
+
| **Best for** | Exploring ideas | Building infrastructure |
|
|
61
|
+
|
|
62
|
+
If you're exploring ideas, LangChain is excellent. If you're building infrastructure that will outlive your current model choices, fitz-ai is designed for that.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 🚀 Quick Start
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install fitz-ai
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from fitz_ai.engines.classic_rag import run_classic_rag
|
|
74
|
+
|
|
75
|
+
answer = run_classic_rag("What does our contract say about termination?")
|
|
76
|
+
print(answer.text)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
That's it. Classic RAG works out of the box.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## ⚙️ Engines
|
|
84
|
+
|
|
85
|
+
Engines encapsulate *how* knowledge is queried. They're not plugins. They're paradigms.
|
|
86
|
+
|
|
87
|
+
### Classic RAG (Default) ✅
|
|
88
|
+
|
|
89
|
+
Production-ready retrieval-augmented generation.
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
from fitz_ai.engines.classic_rag import run_classic_rag
|
|
93
|
+
|
|
94
|
+
answer = run_classic_rag("What is our refund policy?")
|
|
95
|
+
|
|
96
|
+
for source in answer.provenance:
|
|
97
|
+
print(f"{source.source_id}: {source.excerpt}")
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### CLaRa (Experimental) 🧪
|
|
101
|
+
|
|
102
|
+
Compression-native reasoning for large document collections. 16x to 128x compression with unified retrieval and generation.
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from fitz_ai.engines.clara import create_clara_engine
|
|
106
|
+
|
|
107
|
+
engine = create_clara_engine()
|
|
108
|
+
engine.add_documents(my_documents)
|
|
109
|
+
answer = engine.answer(Query(text="What patterns emerge across these reports?"))
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
> Engines are interchangeable. Your knowledge is not.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## ✅ When fitz-ai Makes Sense
|
|
117
|
+
|
|
118
|
+
- Internal company knowledge bases
|
|
119
|
+
- Compliance-sensitive environments
|
|
120
|
+
- Teams running local and cloud LLMs
|
|
121
|
+
- Long-lived systems where methods will change
|
|
122
|
+
|
|
123
|
+
## ❌ When fitz-ai Is Not a Fit
|
|
124
|
+
|
|
125
|
+
- Prompt-only experiments
|
|
126
|
+
- One-off demos
|
|
127
|
+
- No ingestion, no retrieval needed
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 📁 Project Structure
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
fitz_ai/
|
|
135
|
+
├── core/ # Stable contracts (Query, Answer, Provenance)
|
|
136
|
+
├── engines/ # Reasoning paradigms (classic_rag, clara)
|
|
137
|
+
├── ingest/ # Knowledge ingestion
|
|
138
|
+
├── runtime/ # Engine orchestration
|
|
139
|
+
├── llm/ # LLM plugins
|
|
140
|
+
└── vector_db/ # Vector DB plugins
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Architecture enforces separation: engines can be added or removed without destabilizing the core.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 💻 CLI
|
|
148
|
+
|
|
149
|
+
### Core Commands
|
|
150
|
+
|
|
151
|
+
| Command | Description |
|
|
152
|
+
|---------|-------------|
|
|
153
|
+
| `fitz init` | Interactive setup wizard |
|
|
154
|
+
| `fitz query "question"` | Query your knowledge base |
|
|
155
|
+
| `fitz config` | Show current configuration |
|
|
156
|
+
| `fitz db` | List/inspect vector collections |
|
|
157
|
+
| `fitz chunk ./file.txt` | Preview chunking strategies |
|
|
158
|
+
| `fitz doctor` | System diagnostics |
|
|
159
|
+
| `fitz plugins` | List all available plugins |
|
|
160
|
+
|
|
161
|
+
### Ingestion Commands
|
|
162
|
+
|
|
163
|
+
| Command | Description |
|
|
164
|
+
|---------|-------------|
|
|
165
|
+
| `fitz ingest ./docs collection` | Ingest documents into collection |
|
|
166
|
+
| `fitz ingest ./docs coll --chunk-size 500` | Custom chunk size |
|
|
167
|
+
| `fitz ingest validate ./docs` | Validate before ingesting |
|
|
168
|
+
| `fitz ingest plugins` | List ingest plugins |
|
|
169
|
+
|
|
170
|
+
### Database Commands
|
|
171
|
+
|
|
172
|
+
| Command | Description |
|
|
173
|
+
|---------|-------------|
|
|
174
|
+
| `fitz db` | List all collections |
|
|
175
|
+
| `fitz db default` | Inspect 'default' collection |
|
|
176
|
+
| `fitz db my_docs -n 10` | Show 10 sample chunks |
|
|
177
|
+
|
|
178
|
+
### Chunking Preview
|
|
179
|
+
|
|
180
|
+
| Command | Description |
|
|
181
|
+
|---------|-------------|
|
|
182
|
+
| `fitz chunk ./doc.txt` | Preview with defaults (1000 chars) |
|
|
183
|
+
| `fitz chunk ./doc.txt --size 500` | Smaller chunks |
|
|
184
|
+
| `fitz chunk ./docs/ --stats` | Stats only, no content |
|
|
185
|
+
| `fitz chunk --list` | List available chunkers |
|
|
186
|
+
|
|
187
|
+
### Examples
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# Setup and first query
|
|
191
|
+
fitz init
|
|
192
|
+
fitz ingest ./documents knowledge_base
|
|
193
|
+
fitz query "What are the main topics?"
|
|
194
|
+
|
|
195
|
+
# Inspect what's stored
|
|
196
|
+
fitz db knowledge_base
|
|
197
|
+
|
|
198
|
+
# Preview chunking before committing
|
|
199
|
+
fitz chunk ./large_doc.pdf --size 500 --stats
|
|
200
|
+
|
|
201
|
+
# Check system health
|
|
202
|
+
fitz doctor
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 📐 Design Principles
|
|
208
|
+
|
|
209
|
+
- **Explicit over clever** | No hidden magic
|
|
210
|
+
- **Stable contracts** | The API doesn't break when internals change
|
|
211
|
+
- **Knowledge outlives methods** | Ingest once, query many ways
|
|
212
|
+
- **Engines are paradigms** | Not just config switches
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 💡 Philosophy
|
|
217
|
+
|
|
218
|
+
RAG is a method.
|
|
219
|
+
Knowledge access is a strategy.
|
|
220
|
+
|
|
221
|
+
fitz-ai is built for the strategy.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 📚 Documentation
|
|
226
|
+
|
|
227
|
+
- [Engine Guide](docs/ENGINES.md) | Choosing and using engines
|
|
228
|
+
- [Architecture](docs/architecture.md) | Deep dive for contributors
|
|
229
|
+
- [Changelog](CHANGELOG.md) | Release history
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## 📄 License
|
|
234
|
+
|
|
235
|
+
MIT
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Fitz - Local-First RAG Framework & Engine Platform
|
|
3
|
+
|
|
4
|
+
Fitz is a paradigm-agnostic knowledge engine platform that supports multiple
|
|
5
|
+
approaches to knowledge retrieval and synthesis (Classic RAG, CLaRa, custom engines).
|
|
6
|
+
|
|
7
|
+
Quick Start:
|
|
8
|
+
>>> from fitz import run
|
|
9
|
+
>>> answer = run("What is quantum computing?")
|
|
10
|
+
>>> print(answer.text)
|
|
11
|
+
|
|
12
|
+
Public API:
|
|
13
|
+
Core Types:
|
|
14
|
+
- Query: Input to engines
|
|
15
|
+
- Answer: Output from engines
|
|
16
|
+
- Provenance: Source attribution
|
|
17
|
+
- Constraints: Query-time constraints
|
|
18
|
+
|
|
19
|
+
Runtime:
|
|
20
|
+
- run: Universal entry point (any engine)
|
|
21
|
+
- create_engine: Factory for creating engines
|
|
22
|
+
- list_engines: List available engines
|
|
23
|
+
|
|
24
|
+
Classic RAG:
|
|
25
|
+
- run_classic_rag: RAG-specific entry point
|
|
26
|
+
- create_classic_rag_engine: RAG engine factory
|
|
27
|
+
|
|
28
|
+
Architecture:
|
|
29
|
+
fitz_ai/
|
|
30
|
+
├── core/ # Paradigm-agnostic contracts
|
|
31
|
+
├── engines/ # Engine implementations
|
|
32
|
+
│ └── classic_rag/ # Retrieval-augmented generation
|
|
33
|
+
├── runtime/ # Multi-engine orchestration
|
|
34
|
+
├── llm/ # LLM service (chat, embedding, rerank)
|
|
35
|
+
├── vector_db/ # Vector database service
|
|
36
|
+
└── ingest/ # Document ingestion
|
|
37
|
+
|
|
38
|
+
Philosophy:
|
|
39
|
+
Knowledge → Engine → Answer
|
|
40
|
+
|
|
41
|
+
Engines are black boxes that transform queries into answers.
|
|
42
|
+
The platform only cares about the interface, not the implementation.
|
|
43
|
+
|
|
44
|
+
Examples:
|
|
45
|
+
Simple query:
|
|
46
|
+
>>> from fitz import run
|
|
47
|
+
>>> answer = run("What is quantum computing?")
|
|
48
|
+
|
|
49
|
+
With constraints:
|
|
50
|
+
>>> from fitz import run, Constraints
|
|
51
|
+
>>> constraints = Constraints(max_sources=5)
|
|
52
|
+
>>> answer = run("Explain entanglement", constraints=constraints)
|
|
53
|
+
|
|
54
|
+
Specific engine:
|
|
55
|
+
>>> answer = run("What is X?", engine="classic_rag")
|
|
56
|
+
|
|
57
|
+
Reusable engine:
|
|
58
|
+
>>> from fitz import create_engine, Query
|
|
59
|
+
>>> engine = create_engine("classic_rag")
|
|
60
|
+
>>> query = Query(text="What is Y?")
|
|
61
|
+
>>> answer = engine.answer(query)
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
__version__ = "0.3.0"
|
|
65
|
+
|
|
66
|
+
# =============================================================================
|
|
67
|
+
# CORE TYPES
|
|
68
|
+
# =============================================================================
|
|
69
|
+
|
|
70
|
+
from fitz_ai.core import ( # Protocol; Types; Exceptions
|
|
71
|
+
Answer,
|
|
72
|
+
ConfigurationError,
|
|
73
|
+
Constraints,
|
|
74
|
+
EngineError,
|
|
75
|
+
GenerationError,
|
|
76
|
+
KnowledgeEngine,
|
|
77
|
+
KnowledgeError,
|
|
78
|
+
Provenance,
|
|
79
|
+
Query,
|
|
80
|
+
QueryError,
|
|
81
|
+
TimeoutError,
|
|
82
|
+
UnsupportedOperationError,
|
|
83
|
+
)
|
|
84
|
+
from fitz_ai.engines.classic_rag import (
|
|
85
|
+
ClassicRagEngine,
|
|
86
|
+
create_classic_rag_engine,
|
|
87
|
+
run_classic_rag,
|
|
88
|
+
)
|
|
89
|
+
from fitz_ai.runtime import (
|
|
90
|
+
create_engine,
|
|
91
|
+
get_engine_registry,
|
|
92
|
+
list_engines,
|
|
93
|
+
list_engines_with_info,
|
|
94
|
+
run,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
# =============================================================================
|
|
98
|
+
# RUNTIME (UNIVERSAL)
|
|
99
|
+
# =============================================================================
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# =============================================================================
|
|
103
|
+
# CLASSIC RAG (CONVENIENCE)
|
|
104
|
+
# =============================================================================
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# =============================================================================
|
|
108
|
+
# PUBLIC API
|
|
109
|
+
# =============================================================================
|
|
110
|
+
|
|
111
|
+
__all__ = [
|
|
112
|
+
# Version
|
|
113
|
+
"__version__",
|
|
114
|
+
# Core Protocol
|
|
115
|
+
"KnowledgeEngine",
|
|
116
|
+
# Core Types
|
|
117
|
+
"Query",
|
|
118
|
+
"Answer",
|
|
119
|
+
"Provenance",
|
|
120
|
+
"Constraints",
|
|
121
|
+
# Core Exceptions
|
|
122
|
+
"EngineError",
|
|
123
|
+
"QueryError",
|
|
124
|
+
"KnowledgeError",
|
|
125
|
+
"GenerationError",
|
|
126
|
+
"ConfigurationError",
|
|
127
|
+
"TimeoutError",
|
|
128
|
+
"UnsupportedOperationError",
|
|
129
|
+
# Universal Runtime
|
|
130
|
+
"run",
|
|
131
|
+
"create_engine",
|
|
132
|
+
"list_engines",
|
|
133
|
+
"list_engines_with_info",
|
|
134
|
+
"get_engine_registry",
|
|
135
|
+
# Classic RAG
|
|
136
|
+
"run_classic_rag",
|
|
137
|
+
"create_classic_rag_engine",
|
|
138
|
+
"ClassicRagEngine",
|
|
139
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# fitz_ai/backends/local_llm/__init__.py
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
from fitz_ai.backends.local_llm.chat import LocalChatConfig, LocalChatLLM
|
|
5
|
+
from fitz_ai.backends.local_llm.runtime import LocalLLMRuntime, LocalLLMRuntimeConfig
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"LocalLLMRuntime",
|
|
9
|
+
"LocalLLMRuntimeConfig",
|
|
10
|
+
"LocalChatLLM",
|
|
11
|
+
"LocalChatConfig",
|
|
12
|
+
"LocalEmbedder",
|
|
13
|
+
"LocalEmbedderConfig",
|
|
14
|
+
"LocalReranker",
|
|
15
|
+
"LocalRerankerConfig",
|
|
16
|
+
]
|
|
File without changes
|