fitz-ai 0.3.5__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.
Files changed (193) hide show
  1. fitz_ai-0.3.5/LICENSE +21 -0
  2. fitz_ai-0.3.5/PKG-INFO +392 -0
  3. fitz_ai-0.3.5/README.md +334 -0
  4. fitz_ai-0.3.5/fitz_ai/__init__.py +139 -0
  5. fitz_ai-0.3.5/fitz_ai/backends/__init__.py +16 -0
  6. fitz_ai-0.3.5/fitz_ai/backends/local_llm/__init__.py +0 -0
  7. fitz_ai-0.3.5/fitz_ai/backends/local_llm/chat.py +66 -0
  8. fitz_ai-0.3.5/fitz_ai/backends/local_llm/embedding.py +60 -0
  9. fitz_ai-0.3.5/fitz_ai/backends/local_llm/rerank.py +60 -0
  10. fitz_ai-0.3.5/fitz_ai/backends/local_llm/runtime.py +127 -0
  11. fitz_ai-0.3.5/fitz_ai/backends/local_vector_db/__init__.py +7 -0
  12. fitz_ai-0.3.5/fitz_ai/backends/local_vector_db/config.py +36 -0
  13. fitz_ai-0.3.5/fitz_ai/backends/local_vector_db/faiss.py +449 -0
  14. fitz_ai-0.3.5/fitz_ai/backends/local_vector_db/runtime.py +19 -0
  15. fitz_ai-0.3.5/fitz_ai/cli/__init__.py +15 -0
  16. fitz_ai-0.3.5/fitz_ai/cli/cli.py +42 -0
  17. fitz_ai-0.3.5/fitz_ai/cli/commands/__init__.py +6 -0
  18. fitz_ai-0.3.5/fitz_ai/cli/commands/config.py +296 -0
  19. fitz_ai-0.3.5/fitz_ai/cli/commands/doctor.py +399 -0
  20. fitz_ai-0.3.5/fitz_ai/cli/commands/ingest.py +456 -0
  21. fitz_ai-0.3.5/fitz_ai/cli/commands/init.py +437 -0
  22. fitz_ai-0.3.5/fitz_ai/cli/commands/query.py +282 -0
  23. fitz_ai-0.3.5/fitz_ai/cli/ui.py +418 -0
  24. fitz_ai-0.3.5/fitz_ai/core/__init__.py +101 -0
  25. fitz_ai-0.3.5/fitz_ai/core/answer.py +83 -0
  26. fitz_ai-0.3.5/fitz_ai/core/config.py +422 -0
  27. fitz_ai-0.3.5/fitz_ai/core/constraints.py +82 -0
  28. fitz_ai-0.3.5/fitz_ai/core/detect.py +632 -0
  29. fitz_ai-0.3.5/fitz_ai/core/engine.py +60 -0
  30. fitz_ai-0.3.5/fitz_ai/core/exceptions.py +149 -0
  31. fitz_ai-0.3.5/fitz_ai/core/http.py +522 -0
  32. fitz_ai-0.3.5/fitz_ai/core/knowledge.py +0 -0
  33. fitz_ai-0.3.5/fitz_ai/core/paths.py +218 -0
  34. fitz_ai-0.3.5/fitz_ai/core/provenance.py +82 -0
  35. fitz_ai-0.3.5/fitz_ai/core/query.py +60 -0
  36. fitz_ai-0.3.5/fitz_ai/core/registry.py +384 -0
  37. fitz_ai-0.3.5/fitz_ai/core/utils.py +107 -0
  38. fitz_ai-0.3.5/fitz_ai/engines/__init__.py +0 -0
  39. fitz_ai-0.3.5/fitz_ai/engines/clara/__init__.py +149 -0
  40. fitz_ai-0.3.5/fitz_ai/engines/clara/config/__init__.py +22 -0
  41. fitz_ai-0.3.5/fitz_ai/engines/clara/config/loader.py +51 -0
  42. fitz_ai-0.3.5/fitz_ai/engines/clara/config/schema.py +159 -0
  43. fitz_ai-0.3.5/fitz_ai/engines/clara/engine.py +468 -0
  44. fitz_ai-0.3.5/fitz_ai/engines/clara/runtime.py +156 -0
  45. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/__init__.py +40 -0
  46. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/config/__init__.py +52 -0
  47. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/config/architecture.py +60 -0
  48. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/config/loader.py +92 -0
  49. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/config/normalize.py +75 -0
  50. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/config/presets.py +11 -0
  51. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/config/schema.py +168 -0
  52. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/contracts/__init__.py +0 -0
  53. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/contracts/roles.py +53 -0
  54. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/contracts/rules.py +26 -0
  55. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/engine.py +226 -0
  56. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/exceptions.py +108 -0
  57. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/generation/__init__.py +0 -0
  58. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/generation/prompting/__init__.py +11 -0
  59. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/generation/prompting/assembler.py +116 -0
  60. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/generation/prompting/profiles.py +16 -0
  61. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/generation/prompting/slots.py +21 -0
  62. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/generation/retrieval_guided/__init__.py +0 -0
  63. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/generation/retrieval_guided/synthesis.py +197 -0
  64. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/models/__init__.py +0 -0
  65. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/models/chunk.py +18 -0
  66. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/models/document.py +18 -0
  67. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/__init__.py +9 -0
  68. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/context/pipeline.py +64 -0
  69. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/context/steps/dedupe.py +33 -0
  70. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/context/steps/group.py +40 -0
  71. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/context/steps/merge.py +66 -0
  72. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/context/steps/normalize.py +91 -0
  73. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/context/steps/pack.py +46 -0
  74. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/context/steps/render_markdown.py +28 -0
  75. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/pipeline/__init__.py +5 -0
  76. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/pipeline/base.py +22 -0
  77. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/pipeline/engine.py +177 -0
  78. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/pipeline/plugins/__init__.py +14 -0
  79. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/pipeline/plugins/debug.py +61 -0
  80. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/pipeline/plugins/easy.py +27 -0
  81. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/pipeline/plugins/fast.py +44 -0
  82. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/pipeline/plugins/standard.py +27 -0
  83. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/pipeline/pipeline/registry.py +25 -0
  84. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/retrieval/__init__.py +1 -0
  85. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/retrieval/runtime/__init__.py +0 -0
  86. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/retrieval/runtime/base.py +27 -0
  87. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/retrieval/runtime/engine.py +32 -0
  88. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/retrieval/runtime/plugins/__init__.py +1 -0
  89. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/retrieval/runtime/plugins/dense.py +194 -0
  90. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/retrieval/runtime/registry.py +25 -0
  91. fitz_ai-0.3.5/fitz_ai/engines/classic_rag/runtime.py +156 -0
  92. fitz_ai-0.3.5/fitz_ai/ingest/__init__.py +0 -0
  93. fitz_ai-0.3.5/fitz_ai/ingest/chunking/__init__.py +14 -0
  94. fitz_ai-0.3.5/fitz_ai/ingest/chunking/base.py +42 -0
  95. fitz_ai-0.3.5/fitz_ai/ingest/chunking/engine.py +115 -0
  96. fitz_ai-0.3.5/fitz_ai/ingest/chunking/plugins/__init__.py +4 -0
  97. fitz_ai-0.3.5/fitz_ai/ingest/chunking/plugins/pdf_sections.py +274 -0
  98. fitz_ai-0.3.5/fitz_ai/ingest/chunking/plugins/simple.py +50 -0
  99. fitz_ai-0.3.5/fitz_ai/ingest/chunking/registry.py +25 -0
  100. fitz_ai-0.3.5/fitz_ai/ingest/config/__init__.py +13 -0
  101. fitz_ai-0.3.5/fitz_ai/ingest/config/loader.py +67 -0
  102. fitz_ai-0.3.5/fitz_ai/ingest/config/schema.py +61 -0
  103. fitz_ai-0.3.5/fitz_ai/ingest/exceptions/__init__.py +15 -0
  104. fitz_ai-0.3.5/fitz_ai/ingest/exceptions/base.py +13 -0
  105. fitz_ai-0.3.5/fitz_ai/ingest/exceptions/chunking.py +13 -0
  106. fitz_ai-0.3.5/fitz_ai/ingest/exceptions/config.py +13 -0
  107. fitz_ai-0.3.5/fitz_ai/ingest/exceptions/vector.py +14 -0
  108. fitz_ai-0.3.5/fitz_ai/ingest/ingestion/__init__.py +0 -0
  109. fitz_ai-0.3.5/fitz_ai/ingest/ingestion/base.py +27 -0
  110. fitz_ai-0.3.5/fitz_ai/ingest/ingestion/engine.py +54 -0
  111. fitz_ai-0.3.5/fitz_ai/ingest/ingestion/plugins/__init__.py +0 -0
  112. fitz_ai-0.3.5/fitz_ai/ingest/ingestion/plugins/local_fs.py +339 -0
  113. fitz_ai-0.3.5/fitz_ai/ingest/ingestion/registry.py +25 -0
  114. fitz_ai-0.3.5/fitz_ai/ingest/pipeline/__init__.py +3 -0
  115. fitz_ai-0.3.5/fitz_ai/ingest/pipeline/ingestion_pipeline.py +66 -0
  116. fitz_ai-0.3.5/fitz_ai/ingest/validation/__init__.py +0 -0
  117. fitz_ai-0.3.5/fitz_ai/ingest/validation/documents.py +46 -0
  118. fitz_ai-0.3.5/fitz_ai/llm/__init__.py +46 -0
  119. fitz_ai-0.3.5/fitz_ai/llm/chat/__init__.py +0 -0
  120. fitz_ai-0.3.5/fitz_ai/llm/credentials.py +107 -0
  121. fitz_ai-0.3.5/fitz_ai/llm/embedding/__init__.py +0 -0
  122. fitz_ai-0.3.5/fitz_ai/llm/loader.py +298 -0
  123. fitz_ai-0.3.5/fitz_ai/llm/registry.py +84 -0
  124. fitz_ai-0.3.5/fitz_ai/llm/rerank/__init__.py +0 -0
  125. fitz_ai-0.3.5/fitz_ai/llm/runtime.py +395 -0
  126. fitz_ai-0.3.5/fitz_ai/llm/schema.py +386 -0
  127. fitz_ai-0.3.5/fitz_ai/llm/schema_defaults.py +329 -0
  128. fitz_ai-0.3.5/fitz_ai/llm/transforms.py +301 -0
  129. fitz_ai-0.3.5/fitz_ai/logging/__init__.py +0 -0
  130. fitz_ai-0.3.5/fitz_ai/logging/logger.py +50 -0
  131. fitz_ai-0.3.5/fitz_ai/logging/tags.py +24 -0
  132. fitz_ai-0.3.5/fitz_ai/runtime/__init__.py +54 -0
  133. fitz_ai-0.3.5/fitz_ai/runtime/registry.py +285 -0
  134. fitz_ai-0.3.5/fitz_ai/runtime/runner.py +231 -0
  135. fitz_ai-0.3.5/fitz_ai/vector_db/__init__.py +52 -0
  136. fitz_ai-0.3.5/fitz_ai/vector_db/base.py +35 -0
  137. fitz_ai-0.3.5/fitz_ai/vector_db/custom.py +351 -0
  138. fitz_ai-0.3.5/fitz_ai/vector_db/loader.py +693 -0
  139. fitz_ai-0.3.5/fitz_ai/vector_db/registry.py +48 -0
  140. fitz_ai-0.3.5/fitz_ai/vector_db/writer.py +159 -0
  141. fitz_ai-0.3.5/fitz_ai.egg-info/PKG-INFO +392 -0
  142. fitz_ai-0.3.5/fitz_ai.egg-info/SOURCES.txt +191 -0
  143. fitz_ai-0.3.5/fitz_ai.egg-info/dependency_links.txt +1 -0
  144. fitz_ai-0.3.5/fitz_ai.egg-info/entry_points.txt +4 -0
  145. fitz_ai-0.3.5/fitz_ai.egg-info/requires.txt +29 -0
  146. fitz_ai-0.3.5/fitz_ai.egg-info/top_level.txt +1 -0
  147. fitz_ai-0.3.5/pyproject.toml +143 -0
  148. fitz_ai-0.3.5/setup.cfg +4 -0
  149. fitz_ai-0.3.5/tests/test_clara_engine.py +365 -0
  150. fitz_ai-0.3.5/tests/test_cli_config_show.py +98 -0
  151. fitz_ai-0.3.5/tests/test_context_pipeline.py +25 -0
  152. fitz_ai-0.3.5/tests/test_context_pipeline_cross_file_dedupe.py +21 -0
  153. fitz_ai-0.3.5/tests/test_context_pipeline_markdown_integrity.py +15 -0
  154. fitz_ai-0.3.5/tests/test_context_pipeline_ordering.py +18 -0
  155. fitz_ai-0.3.5/tests/test_context_pipeline_pack_boundary.py +18 -0
  156. fitz_ai-0.3.5/tests/test_context_pipeline_unknown_group.py +15 -0
  157. fitz_ai-0.3.5/tests/test_context_pipeline_weird_inputs.py +22 -0
  158. fitz_ai-0.3.5/tests/test_default_config_loads_and_validates_minimally.py +32 -0
  159. fitz_ai-0.3.5/tests/test_default_preset_resolves.py +23 -0
  160. fitz_ai-0.3.5/tests/test_dense_retriever_basic_embedding_and_search.py +51 -0
  161. fitz_ai-0.3.5/tests/test_generic_vector_db_plugin.py +659 -0
  162. fitz_ai-0.3.5/tests/test_ingester_local_plugin_runs.py +13 -0
  163. fitz_ai-0.3.5/tests/test_ingester_returns_raw_documents.py +15 -0
  164. fitz_ai-0.3.5/tests/test_ingestion_pipeline_end_to_end.py +33 -0
  165. fitz_ai-0.3.5/tests/test_integration_v030.py +337 -0
  166. fitz_ai-0.3.5/tests/test_llm_auto_discovery.py +67 -0
  167. fitz_ai-0.3.5/tests/test_llm_engine_from_name.py +17 -0
  168. fitz_ai-0.3.5/tests/test_local_faiss_vector_db.py +180 -0
  169. fitz_ai-0.3.5/tests/test_local_faiss_vector_db_default_config.py +119 -0
  170. fitz_ai-0.3.5/tests/test_meta_config_shape.py +42 -0
  171. fitz_ai-0.3.5/tests/test_plugin_system.py +543 -0
  172. fitz_ai-0.3.5/tests/test_rag_pipeline_end_to_end.py +77 -0
  173. fitz_ai-0.3.5/tests/test_rag_pipeline_llm_failure.py +29 -0
  174. fitz_ai-0.3.5/tests/test_registry.py +58 -0
  175. fitz_ai-0.3.5/tests/test_retriever_basic_flow.py +42 -0
  176. fitz_ai-0.3.5/tests/test_retriever_engine_factory.py +26 -0
  177. fitz_ai-0.3.5/tests/test_retriever_metadata_preservation.py +52 -0
  178. fitz_ai-0.3.5/tests/test_retriever_rerank_flow.py +52 -0
  179. fitz_ai-0.3.5/tests/test_retriever_success.py +57 -0
  180. fitz_ai-0.3.5/tests/test_rgs_chunk_id_fallback.py +19 -0
  181. fitz_ai-0.3.5/tests/test_rgs_chunk_limit.py +22 -0
  182. fitz_ai-0.3.5/tests/test_rgs_exclude_query.py +15 -0
  183. fitz_ai-0.3.5/tests/test_rgs_max_chunks_limit.py +19 -0
  184. fitz_ai-0.3.5/tests/test_rgs_metadata_format.py +27 -0
  185. fitz_ai-0.3.5/tests/test_rgs_metadata_truncation.py +23 -0
  186. fitz_ai-0.3.5/tests/test_rgs_no_citations.py +24 -0
  187. fitz_ai-0.3.5/tests/test_rgs_prompt_core_logic.py +25 -0
  188. fitz_ai-0.3.5/tests/test_rgs_prompt_slots.py +24 -0
  189. fitz_ai-0.3.5/tests/test_rgs_strict_grounding_instruction.py +14 -0
  190. fitz_ai-0.3.5/tests/test_smart_qdrant.py +184 -0
  191. fitz_ai-0.3.5/tests/test_validation_filters_empty_documents.py +12 -0
  192. fitz_ai-0.3.5/tests/test_writer_basic.py +75 -0
  193. fitz_ai-0.3.5/tests/test_yaml_plugin_discovery.py +50 -0
fitz_ai-0.3.5/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.5/PKG-INFO ADDED
@@ -0,0 +1,392 @@
1
+ Metadata-Version: 2.4
2
+ Name: fitz-ai
3
+ Version: 0.3.5
4
+ Summary: A modular, production-ready knowledge engine platform with clean architecture and multi-paradigm support (RAG, CLaRa).
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: Documentation, https://github.com/yafitzdev/fitz-ai#readme
10
+ Project-URL: Issues, https://github.com/yafitzdev/fitz-ai/issues
11
+ Project-URL: Changelog, https://github.com/yafitzdev/fitz-ai/blob/main/CHANGELOG.md
12
+ Project-URL: Source Code, https://github.com/yafitzdev/fitz-ai
13
+ Keywords: rag,retrieval,augmented,generation,llm,ai,knowledge-base,vector-database,semantic-search,document-processing,embeddings,nlp,clara,compression,machine-learning
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3 :: Only
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
+ Classifier: Topic :: Text Processing :: Indexing
27
+ Classifier: Topic :: Database
28
+ Classifier: Typing :: Typed
29
+ Requires-Python: >=3.10
30
+ Description-Content-Type: text/markdown
31
+ License-File: LICENSE
32
+ Requires-Dist: pydantic>=2.0
33
+ Requires-Dist: pyyaml>=6.0
34
+ Requires-Dist: qdrant-client>=1.7
35
+ Requires-Dist: httpx>=0.24
36
+ Requires-Dist: typing-extensions>=4.7
37
+ Requires-Dist: typer>=0.9
38
+ Requires-Dist: jinja2>=3.1
39
+ Provides-Extra: ingest
40
+ Requires-Dist: pdfminer.six; extra == "ingest"
41
+ Requires-Dist: python-docx; extra == "ingest"
42
+ Provides-Extra: local
43
+ Requires-Dist: ollama>=0.1.0; extra == "local"
44
+ Requires-Dist: faiss-cpu>=1.7.0; extra == "local"
45
+ Provides-Extra: dev
46
+ Requires-Dist: pytest>=7.0; extra == "dev"
47
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
48
+ Requires-Dist: black>=23.0; extra == "dev"
49
+ Requires-Dist: isort>=5.0; extra == "dev"
50
+ Requires-Dist: mypy>=1.0; extra == "dev"
51
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
52
+ Provides-Extra: all
53
+ Requires-Dist: pdfminer.six; extra == "all"
54
+ Requires-Dist: python-docx; extra == "all"
55
+ Requires-Dist: ollama>=0.1.0; extra == "all"
56
+ Requires-Dist: faiss-cpu>=1.7.0; extra == "all"
57
+ Dynamic: license-file
58
+
59
+ # fitz-ai
60
+
61
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
62
+ [![PyPI version](https://badge.fury.io/py/fitz-ai.svg)](https://pypi.org/project/fitz-ai/)
63
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
64
+ [![Version](https://img.shields.io/badge/version-0.3.5-green.svg)](CHANGELOG.md)
65
+
66
+ ## 🎯 Stable Knowledge Access, Today and Tomorrow
67
+
68
+ fitz-ai is a **knowledge access platform** for teams that need reliable, configurable retrieval **today**, without locking themselves into a single reasoning paradigm **tomorrow**.
69
+
70
+ You ingest your knowledge once. How it gets queried can evolve.
71
+
72
+ ---
73
+
74
+ ## 🤔 Why fitz-ai Exists
75
+
76
+ Organizations repeatedly rebuild the same systems: ingest documents, chunk them, embed them, retrieve them, generate answers. Every time the reasoning method changes, everything breaks.
77
+
78
+ **The insight:** Reasoning methods evolve faster than knowledge.
79
+
80
+ - RAG today
81
+ - Compression-native models tomorrow
82
+ - Something else after that
83
+
84
+ But the knowledge layer remains.
85
+
86
+ Most RAG tools optimize *one method*. fitz-ai stabilizes the **knowledge layer itself**.
87
+
88
+ ---
89
+
90
+ ## 🧠 The Mental Model
91
+
92
+ ```
93
+ Your Knowledge
94
+
95
+ fitz-ai (Knowledge Access Layer)
96
+
97
+ Engines (replaceable)
98
+
99
+ Answer
100
+ ```
101
+
102
+ **What stays stable:** Ingested documents, chunking decisions, metadata, provenance, API contracts.
103
+
104
+ **What can change:** Retrieval strategies, reasoning methods, model providers, compression techniques.
105
+
106
+ You optimize for **stability where it matters** and **flexibility where change is inevitable**.
107
+
108
+ ---
109
+
110
+ ## ⚖️ How fitz-ai Is Different
111
+
112
+ This isn't a critique of other tools. It's a design difference.
113
+
114
+ | | LangChain & Similar | fitz-ai |
115
+ |---|---------------------|------|
116
+ | **Optimizes for** | Flows & prompt chains | Knowledge stability |
117
+ | **Assumes** | Rapid experimentation | Systems live for years |
118
+ | **Switching paradigms** | Often means refactoring | Means changing engines |
119
+ | **Best for** | Exploring ideas | Building infrastructure |
120
+
121
+ 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.
122
+
123
+ ---
124
+
125
+ ## 🚀 Quick Start
126
+
127
+ ```bash
128
+ pip install fitz-ai
129
+ ```
130
+
131
+ ```python
132
+ from fitz_ai.engines.classic_rag import run_classic_rag
133
+
134
+ answer = run_classic_rag("What does our contract say about termination?")
135
+ print(answer.text)
136
+ ```
137
+
138
+ That's it. Classic RAG works out of the box.
139
+
140
+ ---
141
+
142
+ ## ⚙️ Engines
143
+
144
+ Engines encapsulate *how* knowledge is queried. They're not plugins. They're paradigms.
145
+
146
+ ### Classic RAG (Default) ✅
147
+
148
+ Production-ready retrieval-augmented generation.
149
+
150
+ ```python
151
+ from fitz_ai.engines.classic_rag import run_classic_rag
152
+
153
+ answer = run_classic_rag("What is our refund policy?")
154
+
155
+ for source in answer.provenance:
156
+ print(f"{source.source_id}: {source.excerpt}")
157
+ ```
158
+
159
+ ### CLaRa (Experimental) 🧪
160
+
161
+ Compression-native reasoning for large document collections. 16x to 128x compression with unified retrieval and generation.
162
+
163
+ ```python
164
+ from fitz_ai.engines.clara import create_clara_engine
165
+
166
+ engine = create_clara_engine()
167
+ engine.add_documents(my_documents)
168
+ answer = engine.answer(Query(text="What patterns emerge across these reports?"))
169
+ ```
170
+
171
+ > Engines are interchangeable. Your knowledge is not.
172
+
173
+ ---
174
+
175
+ ## ✅ When fitz-ai Makes Sense
176
+
177
+ - Internal company knowledge bases
178
+ - Compliance-sensitive environments
179
+ - Teams running local and cloud LLMs
180
+ - Long-lived systems where methods will change
181
+
182
+ ## ❌ When fitz-ai Is Not a Fit
183
+
184
+ - Prompt-only experiments
185
+ - One-off demos
186
+ - No ingestion, no retrieval needed
187
+
188
+ ---
189
+
190
+ ## 📁 Project Structure
191
+
192
+ ```
193
+ fitz_ai/
194
+ ├── core/ # Stable contracts (Query, Answer, Provenance)
195
+ ├── engines/ # Reasoning paradigms (classic_rag, clara)
196
+ ├── ingest/ # Knowledge ingestion
197
+ ├── runtime/ # Engine orchestration
198
+ ├── llm/ # LLM plugins
199
+ └── vector_db/ # Vector DB plugins
200
+ ```
201
+
202
+ Architecture enforces separation: engines can be added or removed without destabilizing the core.
203
+
204
+ ---
205
+
206
+ ## 💻 CLI
207
+
208
+ ### Core Commands
209
+
210
+ | Command | Description |
211
+ |---------|-------------|
212
+ | `fitz init` | Interactive setup wizard |
213
+ | `fitz ingest [path]` | Ingest documents into vector DB |
214
+ | `fitz query "question"` | Query your knowledge base |
215
+ | `fitz config` | View/manage configuration |
216
+ | `fitz doctor` | System diagnostics |
217
+
218
+ ### Quick Start
219
+
220
+ ```bash
221
+ # 1. Setup (detects Ollama, Qdrant, API keys automatically)
222
+ fitz init
223
+
224
+ # 2. Ingest documents
225
+ fitz ingest ./my-documents
226
+
227
+ # 3. Query
228
+ fitz query "What are the main topics?"
229
+
230
+ # 4. Verify everything works
231
+ fitz doctor --test
232
+ ```
233
+
234
+ ### Command Details
235
+
236
+ #### `fitz init`
237
+ Interactive setup wizard. Detects available providers and creates config.
238
+
239
+ ```bash
240
+ fitz init # Interactive mode
241
+ fitz init -y # Auto-detect defaults
242
+ fitz init --show # Preview without saving
243
+ ```
244
+
245
+ #### `fitz ingest`
246
+ Ingest documents into your vector database.
247
+
248
+ ```bash
249
+ fitz ingest # Interactive prompts
250
+ fitz ingest ./docs # Ingest specific directory
251
+ fitz ingest ./docs -y # Non-interactive with defaults
252
+ ```
253
+
254
+ Prompts for: collection name, chunker type, chunk size, overlap.
255
+
256
+ #### `fitz query`
257
+ Query your knowledge base with RAG.
258
+
259
+ ```bash
260
+ fitz query "your question" # Basic query
261
+ fitz query "your question" --stream # Streaming response
262
+ ```
263
+
264
+ Returns answer with source citations.
265
+
266
+ #### `fitz config`
267
+ Manage configuration.
268
+
269
+ ```bash
270
+ fitz config # Show summary
271
+ fitz config --raw # Show YAML
272
+ fitz config --json # JSON output
273
+ fitz config --edit # Open in $EDITOR
274
+ fitz config --path # Show file location
275
+ ```
276
+
277
+ #### `fitz doctor`
278
+ System diagnostics.
279
+
280
+ ```bash
281
+ fitz doctor # Quick check
282
+ fitz doctor -v # Verbose (shows optional deps)
283
+ fitz doctor --test # Test connections
284
+ ```
285
+
286
+ Checks: Python version, dependencies, Ollama/Qdrant/FAISS availability, API keys, connections.
287
+
288
+ ### Examples
289
+
290
+ ```bash
291
+ # Local-first setup (no API keys)
292
+ ollama serve
293
+ docker run -p 6333:6333 qdrant/qdrant
294
+ fitz init # Select ollama + qdrant
295
+ fitz ingest ./docs -y
296
+ fitz query "What's in my docs?"
297
+
298
+ # Cloud setup
299
+ export COHERE_API_KEY="your-key"
300
+ fitz init -y
301
+ fitz ingest ./docs -y
302
+ fitz query "Your question"
303
+
304
+ # Check everything is working
305
+ fitz doctor --test
306
+ ```
307
+
308
+ ### Environment Variables
309
+
310
+ ```bash
311
+ # API Keys (choose one or use Ollama)
312
+ export COHERE_API_KEY="..." # Recommended
313
+ export OPENAI_API_KEY="..." # Alternative
314
+ export AZURE_OPENAI_API_KEY="..." # Alternative
315
+
316
+ # Azure specific (if using Azure)
317
+ export AZURE_OPENAI_ENDPOINT="..."
318
+ export AZURE_OPENAI_API_VERSION="2024-02-15-preview"
319
+ ```
320
+
321
+ ### Configuration File
322
+
323
+ Created at `~/.fitz/fitz.yaml`:
324
+
325
+ ```yaml
326
+ chat:
327
+ plugin_name: cohere
328
+ kwargs:
329
+ model: command-a-03-2025
330
+ temperature: 0.2
331
+
332
+ embedding:
333
+ plugin_name: cohere
334
+ kwargs:
335
+ model: embed-english-v3.0
336
+
337
+ vector_db:
338
+ plugin_name: qdrant
339
+ kwargs:
340
+ host: "localhost"
341
+ port: 6333
342
+
343
+ retriever:
344
+ plugin_name: dense
345
+ collection: default
346
+ top_k: 5
347
+
348
+ rerank:
349
+ enabled: true
350
+ plugin_name: cohere
351
+ kwargs:
352
+ model: rerank-v3.5
353
+
354
+ rgs:
355
+ enable_citations: true
356
+ strict_grounding: true
357
+ max_chunks: 8
358
+ ```
359
+
360
+ Edit with: `fitz config --edit` or `vim ~/.fitz/fitz.yaml`
361
+
362
+ ---
363
+
364
+ ## 📐 Design Principles
365
+
366
+ - **Explicit over clever** | No hidden magic
367
+ - **Stable contracts** | The API doesn't break when internals change
368
+ - **Knowledge outlives methods** | Ingest once, query many ways
369
+ - **Engines are paradigms** | Not just config switches
370
+
371
+ ---
372
+
373
+ ## 💡 Philosophy
374
+
375
+ RAG is a method.
376
+ Knowledge access is a strategy.
377
+
378
+ fitz-ai is built for the strategy.
379
+
380
+ ---
381
+
382
+ ## 📚 Documentation
383
+
384
+ - [Engine Guide](docs/ENGINES.md) | Choosing and using engines
385
+ - [Architecture](docs/architecture.md) | Deep dive for contributors
386
+ - [Changelog](CHANGELOG.md) | Release history
387
+
388
+ ---
389
+
390
+ ## 📄 License
391
+
392
+ MIT