pilotrag 0.1.0__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.
- pilotrag-0.1.0/.gitignore +38 -0
- pilotrag-0.1.0/LICENSE +21 -0
- pilotrag-0.1.0/PKG-INFO +413 -0
- pilotrag-0.1.0/README.md +351 -0
- pilotrag-0.1.0/docs/api-reference/openapi/README.md +27 -0
- pilotrag-0.1.0/docs/api-reference/openapi/config.schema.json +176 -0
- pilotrag-0.1.0/docs/api-reference/overview.md +151 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0001-layered-hexagonal-architecture.md +33 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0002-registry-lazy-imports-entry-points.md +40 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0003-generation-based-atomic-index-swap.md +34 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0004-index-fingerprint-compatibility.md +30 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0005-deterministic-ids.md +26 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0006-local-first-defaults.md +29 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0007-huggingface-default-embedder.md +43 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0008-untrusted-context-prompt-policy.md +45 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0009-remove-rebuild-parameter.md +23 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0010-library-first-sync-first.md +29 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0011-frameworks-behind-owned-ports.md +28 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0012-embedding-params-in-fingerprint.md +31 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/ADR-0013-reference-counted-query-store.md +32 -0
- pilotrag-0.1.0/docs/architecture/architecture-decisions/README.md +21 -0
- pilotrag-0.1.0/docs/architecture/component-diagram.md +100 -0
- pilotrag-0.1.0/docs/architecture/data-flow.md +102 -0
- pilotrag-0.1.0/docs/architecture/database-design.md +163 -0
- pilotrag-0.1.0/docs/architecture/system-overview.md +67 -0
- pilotrag-0.1.0/docs/deployment/deployment-architecture.md +81 -0
- pilotrag-0.1.0/docs/deployment/deployment-process.md +122 -0
- pilotrag-0.1.0/docs/development/configuration.md +306 -0
- pilotrag-0.1.0/docs/development/development-workflow.md +121 -0
- pilotrag-0.1.0/docs/development/setup.md +85 -0
- pilotrag-0.1.0/docs/index.md +131 -0
- pilotrag-0.1.0/docs/operations/monitoring.md +93 -0
- pilotrag-0.1.0/docs/operations/troubleshooting.md +274 -0
- pilotrag-0.1.0/docs/releases/known-issues.md +41 -0
- pilotrag-0.1.0/docs/releases/release-notes.md +115 -0
- pilotrag-0.1.0/docs/requirements/functional-requirements.md +72 -0
- pilotrag-0.1.0/docs/requirements/non-functional-requirements.md +72 -0
- pilotrag-0.1.0/docs/requirements/overview.md +128 -0
- pilotrag-0.1.0/docs/requirements/user-stories/README.md +18 -0
- pilotrag-0.1.0/docs/requirements/user-stories/US-001-ingest-markdown-folder.md +26 -0
- pilotrag-0.1.0/docs/requirements/user-stories/US-002-ask-question-with-sources.md +17 -0
- pilotrag-0.1.0/docs/requirements/user-stories/US-003-insufficient-evidence.md +25 -0
- pilotrag-0.1.0/docs/requirements/user-stories/US-004-filter-by-metadata.md +18 -0
- pilotrag-0.1.0/docs/requirements/user-stories/US-005-use-from-python.md +21 -0
- pilotrag-0.1.0/docs/requirements/user-stories/US-006-choose-embedding-model.md +25 -0
- pilotrag-0.1.0/docs/requirements/user-stories/US-007-configure-with-yaml.md +19 -0
- pilotrag-0.1.0/docs/requirements/user-stories/US-008-safe-reingest.md +20 -0
- pilotrag-0.1.0/docs/requirements/user-stories/US-009-validate-and-monitor.md +17 -0
- pilotrag-0.1.0/docs/requirements/user-stories/US-010-understand-errors.md +17 -0
- pilotrag-0.1.0/docs/requirements/user-stories/US-011-extend-with-plugins.md +19 -0
- pilotrag-0.1.0/docs/technical-design/backend-design.md +91 -0
- pilotrag-0.1.0/docs/technical-design/frontend-design.md +113 -0
- pilotrag-0.1.0/docs/technical-design/integration-design.md +260 -0
- pilotrag-0.1.0/docs/testing/test-cases/README.md +15 -0
- pilotrag-0.1.0/docs/testing/test-cases/cli-security-packaging.md +53 -0
- pilotrag-0.1.0/docs/testing/test-cases/config-and-providers.md +66 -0
- pilotrag-0.1.0/docs/testing/test-cases/ingestion.md +53 -0
- pilotrag-0.1.0/docs/testing/test-cases/query-and-index.md +60 -0
- pilotrag-0.1.0/docs/testing/test-strategy.md +80 -0
- pilotrag-0.1.0/examples/custom_chunker/README.md +41 -0
- pilotrag-0.1.0/examples/custom_chunker/custom_chunker.py +98 -0
- pilotrag-0.1.0/examples/custom_chunker/docs/oncall-rotation.md +10 -0
- pilotrag-0.1.0/examples/custom_chunker/docs/vacation-policy.md +9 -0
- pilotrag-0.1.0/examples/custom_chunker/pilotrag.yaml +22 -0
- pilotrag-0.1.0/examples/custom_chunker/run_example.py +48 -0
- pilotrag-0.1.0/examples/markdown_qa/README.md +60 -0
- pilotrag-0.1.0/examples/markdown_qa/app.py +48 -0
- pilotrag-0.1.0/examples/markdown_qa/docs/equipment.md +9 -0
- pilotrag-0.1.0/examples/markdown_qa/docs/oncall-rotation.md +10 -0
- pilotrag-0.1.0/examples/markdown_qa/docs/vacation-policy.md +20 -0
- pilotrag-0.1.0/examples/markdown_qa/pilotrag.yaml +29 -0
- pilotrag-0.1.0/pyproject.toml +234 -0
- pilotrag-0.1.0/src/pilotrag/__init__.py +55 -0
- pilotrag-0.1.0/src/pilotrag/_langchain.py +33 -0
- pilotrag-0.1.0/src/pilotrag/_version.py +1 -0
- pilotrag-0.1.0/src/pilotrag/bootstrap.py +383 -0
- pilotrag-0.1.0/src/pilotrag/cli/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/cli/exit_codes.py +6 -0
- pilotrag-0.1.0/src/pilotrag/cli/main.py +135 -0
- pilotrag-0.1.0/src/pilotrag/cli/rendering.py +57 -0
- pilotrag-0.1.0/src/pilotrag/core/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/core/config.py +117 -0
- pilotrag-0.1.0/src/pilotrag/core/config_errors.py +55 -0
- pilotrag-0.1.0/src/pilotrag/core/config_loader.py +144 -0
- pilotrag-0.1.0/src/pilotrag/core/config_schema.py +12 -0
- pilotrag-0.1.0/src/pilotrag/core/exceptions.py +171 -0
- pilotrag-0.1.0/src/pilotrag/core/fingerprint.py +39 -0
- pilotrag-0.1.0/src/pilotrag/core/ids.py +36 -0
- pilotrag-0.1.0/src/pilotrag/core/registry.py +238 -0
- pilotrag-0.1.0/src/pilotrag/core/retry.py +134 -0
- pilotrag-0.1.0/src/pilotrag/core/runtime_defaults.py +22 -0
- pilotrag-0.1.0/src/pilotrag/core/secrets.py +124 -0
- pilotrag-0.1.0/src/pilotrag/core/types.py +165 -0
- pilotrag-0.1.0/src/pilotrag/embeddings/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/embeddings/factory.py +28 -0
- pilotrag-0.1.0/src/pilotrag/embeddings/providers/__init__.py +29 -0
- pilotrag-0.1.0/src/pilotrag/embeddings/providers/huggingface.py +262 -0
- pilotrag-0.1.0/src/pilotrag/embeddings/providers/ollama.py +145 -0
- pilotrag-0.1.0/src/pilotrag/evaluation/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/evaluation/datasets.py +38 -0
- pilotrag-0.1.0/src/pilotrag/evaluation/retrieval_metrics.py +19 -0
- pilotrag-0.1.0/src/pilotrag/evaluation/runner.py +78 -0
- pilotrag-0.1.0/src/pilotrag/facade.py +141 -0
- pilotrag-0.1.0/src/pilotrag/generation/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/generation/factory.py +13 -0
- pilotrag-0.1.0/src/pilotrag/generation/providers/__init__.py +19 -0
- pilotrag-0.1.0/src/pilotrag/generation/providers/ollama.py +98 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/chunking/__init__.py +18 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/chunking/factory.py +16 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/chunking/recursive_markdown.py +277 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/loaders/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/loaders/factory.py +10 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/loaders/providers/__init__.py +18 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/loaders/providers/markdown.py +131 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/sources/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/sources/factory.py +14 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/sources/providers/__init__.py +18 -0
- pilotrag-0.1.0/src/pilotrag/ingestion/sources/providers/local_directory.py +89 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/__init__.py +43 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/chunker.py +22 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/document_loader.py +19 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/document_source.py +18 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/embeddings.py +21 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/index_layout.py +9 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/llm.py +23 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/progress.py +15 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/prompt_builder.py +20 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/query_rewriter.py +17 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/reranker.py +23 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/retriever.py +17 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/runtime.py +31 -0
- pilotrag-0.1.0/src/pilotrag/interfaces/vector_store.py +62 -0
- pilotrag-0.1.0/src/pilotrag/observability/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/observability/logging.py +70 -0
- pilotrag-0.1.0/src/pilotrag/observability/metrics.py +13 -0
- pilotrag-0.1.0/src/pilotrag/pipelines/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/pipelines/health.py +105 -0
- pilotrag-0.1.0/src/pilotrag/pipelines/index_lifecycle.py +321 -0
- pilotrag-0.1.0/src/pilotrag/pipelines/indexing.py +264 -0
- pilotrag-0.1.0/src/pilotrag/pipelines/query.py +177 -0
- pilotrag-0.1.0/src/pilotrag/pipelines/rag.py +161 -0
- pilotrag-0.1.0/src/pilotrag/prompts/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/prompts/base.py +46 -0
- pilotrag-0.1.0/src/pilotrag/prompts/templates.py +14 -0
- pilotrag-0.1.0/src/pilotrag/py.typed +0 -0
- pilotrag-0.1.0/src/pilotrag/retrieval/__init__.py +27 -0
- pilotrag-0.1.0/src/pilotrag/retrieval/dense.py +53 -0
- pilotrag-0.1.0/src/pilotrag/retrieval/factory.py +25 -0
- pilotrag-0.1.0/src/pilotrag/retrieval/fusion.py +29 -0
- pilotrag-0.1.0/src/pilotrag/retrieval/query_rewriter.py +27 -0
- pilotrag-0.1.0/src/pilotrag/retrieval/rerankers/__init__.py +18 -0
- pilotrag-0.1.0/src/pilotrag/retrieval/rerankers/factory.py +10 -0
- pilotrag-0.1.0/src/pilotrag/retrieval/rerankers/none.py +36 -0
- pilotrag-0.1.0/src/pilotrag/testing/__init__.py +17 -0
- pilotrag-0.1.0/src/pilotrag/testing/contracts.py +559 -0
- pilotrag-0.1.0/src/pilotrag/testing/fakes.py +238 -0
- pilotrag-0.1.0/src/pilotrag/vector_stores/__init__.py +1 -0
- pilotrag-0.1.0/src/pilotrag/vector_stores/factory.py +16 -0
- pilotrag-0.1.0/src/pilotrag/vector_stores/providers/__init__.py +20 -0
- pilotrag-0.1.0/src/pilotrag/vector_stores/providers/chroma.py +318 -0
- pilotrag-0.1.0/tests/architecture/test_imports.py +50 -0
- pilotrag-0.1.0/tests/architecture/test_ocp_plugin.py +92 -0
- pilotrag-0.1.0/tests/conftest.py +89 -0
- pilotrag-0.1.0/tests/contract/test_chunker_contract.py +79 -0
- pilotrag-0.1.0/tests/contract/test_embedding_contract.py +64 -0
- pilotrag-0.1.0/tests/contract/test_reader_contract.py +37 -0
- pilotrag-0.1.0/tests/contract/test_retrieval_contract.py +87 -0
- pilotrag-0.1.0/tests/contract/test_vector_store_contract.py +42 -0
- pilotrag-0.1.0/tests/e2e/test_e2e_fake.py +176 -0
- pilotrag-0.1.0/tests/fixtures/plugins/example_plugin_pkg/pyproject.toml +15 -0
- pilotrag-0.1.0/tests/fixtures/plugins/example_plugin_pkg/src/example_plugin_pkg/__init__.py +1 -0
- pilotrag-0.1.0/tests/fixtures/plugins/example_plugin_pkg/src/example_plugin_pkg/chunker.py +66 -0
- pilotrag-0.1.0/tests/integration/test_chroma_integration.py +365 -0
- pilotrag-0.1.0/tests/packaging/conftest.py +5 -0
- pilotrag-0.1.0/tests/packaging/test_distribution.py +297 -0
- pilotrag-0.1.0/tests/regression/test_real_provider_bugs.py +122 -0
- pilotrag-0.1.0/tests/security/test_path_traversal.py +90 -0
- pilotrag-0.1.0/tests/security/test_secrets_canary.py +135 -0
- pilotrag-0.1.0/tests/security/test_yaml_safeload.py +44 -0
- pilotrag-0.1.0/tests/unit/cli/test_cli_and_health.py +49 -0
- pilotrag-0.1.0/tests/unit/cli/test_cli_happy_path.py +375 -0
- pilotrag-0.1.0/tests/unit/core/test_bootstrap.py +142 -0
- pilotrag-0.1.0/tests/unit/core/test_config_loader.py +93 -0
- pilotrag-0.1.0/tests/unit/core/test_ids_and_fusion.py +72 -0
- pilotrag-0.1.0/tests/unit/core/test_registry.py +110 -0
- pilotrag-0.1.0/tests/unit/core/test_retry.py +266 -0
- pilotrag-0.1.0/tests/unit/core/test_secrets.py +119 -0
- pilotrag-0.1.0/tests/unit/embeddings/test_huggingface_embeddings.py +407 -0
- pilotrag-0.1.0/tests/unit/embeddings/test_huggingface_real_model.py +46 -0
- pilotrag-0.1.0/tests/unit/embeddings/test_ollama_embeddings.py +175 -0
- pilotrag-0.1.0/tests/unit/evaluation/test_metrics.py +162 -0
- pilotrag-0.1.0/tests/unit/generation/test_ollama_chat.py +99 -0
- pilotrag-0.1.0/tests/unit/ingestion/test_chunker.py +264 -0
- pilotrag-0.1.0/tests/unit/ingestion/test_local_source.py +70 -0
- pilotrag-0.1.0/tests/unit/ingestion/test_markdown_loader.py +72 -0
- pilotrag-0.1.0/tests/unit/pipelines/test_index_lifecycle.py +269 -0
- pilotrag-0.1.0/tests/unit/pipelines/test_ingestion.py +231 -0
- pilotrag-0.1.0/tests/unit/pipelines/test_query.py +125 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
.eggs/
|
|
8
|
+
|
|
9
|
+
# Environments
|
|
10
|
+
.venv/
|
|
11
|
+
venv/
|
|
12
|
+
.env
|
|
13
|
+
|
|
14
|
+
# Tooling caches
|
|
15
|
+
.pytest_cache/
|
|
16
|
+
.mypy_cache/
|
|
17
|
+
.ruff_cache/
|
|
18
|
+
.coverage
|
|
19
|
+
coverage.xml
|
|
20
|
+
htmlcov/
|
|
21
|
+
.hypothesis/
|
|
22
|
+
.import_linter_cache/
|
|
23
|
+
|
|
24
|
+
# PilotRAG local artifacts
|
|
25
|
+
.pilotrag/
|
|
26
|
+
|
|
27
|
+
# OS / editor
|
|
28
|
+
.DS_Store
|
|
29
|
+
Thumbs.db
|
|
30
|
+
.idea/
|
|
31
|
+
.vscode/
|
|
32
|
+
|
|
33
|
+
# Local agent skills (copied from the user's Windsurf skills; never commit)
|
|
34
|
+
.claude/skills/
|
|
35
|
+
|
|
36
|
+
# Local assistant instructions (contain local machine paths; never commit)
|
|
37
|
+
CLAUDE.md
|
|
38
|
+
HANDOFF.md
|
pilotrag-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PilotRAG contributors
|
|
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.
|
pilotrag-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: pilotrag
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Markdown-first, local-first Retrieval-Augmented Generation for Python developers.
|
|
5
|
+
Project-URL: Homepage, https://github.com/praveen9392/pilot-rag
|
|
6
|
+
Project-URL: Documentation, https://github.com/praveen9392/pilot-rag/blob/main/docs/index.md
|
|
7
|
+
Project-URL: Repository, https://github.com/praveen9392/pilot-rag.git
|
|
8
|
+
Project-URL: Issues, https://github.com/praveen9392/pilot-rag/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/praveen9392/pilot-rag/blob/main/docs/releases/release-notes.md
|
|
10
|
+
Author: Praveenkumar B
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: chroma,embeddings,huggingface,llm,markdown,ollama,rag,retrieval,sentence-transformers
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Requires-Dist: filelock<5,>=3.16
|
|
26
|
+
Requires-Dist: pydantic<3,>=2.9
|
|
27
|
+
Requires-Dist: pyyaml<7,>=6.0.1
|
|
28
|
+
Requires-Dist: twine>=7.0.0
|
|
29
|
+
Requires-Dist: typer<1,>=0.16
|
|
30
|
+
Provides-Extra: chroma
|
|
31
|
+
Requires-Dist: chromadb<2,>=1.0; extra == 'chroma'
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
34
|
+
Requires-Dist: check-wheel-contents>=0.6; extra == 'dev'
|
|
35
|
+
Requires-Dist: chromadb<2,>=1.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: hypothesis<7,>=6; extra == 'dev'
|
|
37
|
+
Requires-Dist: import-linter<3,>=2.0; extra == 'dev'
|
|
38
|
+
Requires-Dist: langchain-core<2,>=1.0; extra == 'dev'
|
|
39
|
+
Requires-Dist: langchain-ollama<2,>=1.0; extra == 'dev'
|
|
40
|
+
Requires-Dist: mypy<3,>=2.4; extra == 'dev'
|
|
41
|
+
Requires-Dist: pytest-asyncio<2,>=1.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: pytest-cov<8,>=5; extra == 'dev'
|
|
43
|
+
Requires-Dist: pytest-httpx<0.37,>=0.30; extra == 'dev'
|
|
44
|
+
Requires-Dist: pytest<10,>=8; extra == 'dev'
|
|
45
|
+
Requires-Dist: python-dotenv<2,>=1.0; extra == 'dev'
|
|
46
|
+
Requires-Dist: ruff<0.18,>=0.17; extra == 'dev'
|
|
47
|
+
Requires-Dist: twine>=6; extra == 'dev'
|
|
48
|
+
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
|
|
49
|
+
Provides-Extra: dotenv
|
|
50
|
+
Requires-Dist: python-dotenv<2,>=1.0; extra == 'dotenv'
|
|
51
|
+
Provides-Extra: huggingface
|
|
52
|
+
Requires-Dist: sentence-transformers<7,>=3; extra == 'huggingface'
|
|
53
|
+
Provides-Extra: local
|
|
54
|
+
Requires-Dist: chromadb<2,>=1.0; extra == 'local'
|
|
55
|
+
Requires-Dist: langchain-core<2,>=1.0; extra == 'local'
|
|
56
|
+
Requires-Dist: langchain-ollama<2,>=1.0; extra == 'local'
|
|
57
|
+
Requires-Dist: sentence-transformers<7,>=3; extra == 'local'
|
|
58
|
+
Provides-Extra: ollama
|
|
59
|
+
Requires-Dist: langchain-core<2,>=1.0; extra == 'ollama'
|
|
60
|
+
Requires-Dist: langchain-ollama<2,>=1.0; extra == 'ollama'
|
|
61
|
+
Description-Content-Type: text/markdown
|
|
62
|
+
|
|
63
|
+
# PilotRAG
|
|
64
|
+
|
|
65
|
+
Markdown-first, local-first Retrieval-Augmented Generation for Python.
|
|
66
|
+
|
|
67
|
+
Point PilotRAG at a folder of Markdown files, build a local search index once, and
|
|
68
|
+
ask questions that are answered **only** from those files, with source references.
|
|
69
|
+
Embeddings run locally through Hugging Face sentence-transformers, answers come
|
|
70
|
+
from a local [Ollama](https://ollama.com) model, and the index is a local
|
|
71
|
+
[Chroma](https://www.trychroma.com) directory, so nothing leaves your machine and
|
|
72
|
+
no API key is needed. It is a library first (a thin CLI is included); every
|
|
73
|
+
component can be replaced without touching your application code.
|
|
74
|
+
|
|
75
|
+
## How it works
|
|
76
|
+
|
|
77
|
+
PilotRAG has two separate phases. **Asking a question never re-embeds your
|
|
78
|
+
documents**: only the question itself is embedded.
|
|
79
|
+
|
|
80
|
+
**Phase 1: build the index** (only when you run `pilotrag ingest`)
|
|
81
|
+
|
|
82
|
+
1. **Find files**: scan the docs folder for `.md` files. Hidden files, files over the
|
|
83
|
+
size limit and files with other extensions are never discovered (they are not
|
|
84
|
+
counted anywhere); the report's `skipped` count covers discovered files that no
|
|
85
|
+
loader handles.
|
|
86
|
+
2. **Read**: extract the text, the frontmatter (e.g. `team: platform`) and the title.
|
|
87
|
+
3. **Chunk**: split each file into pieces of about 1000 characters at headings and
|
|
88
|
+
paragraphs, with 200 characters of overlap.
|
|
89
|
+
4. **Embed**: the Hugging Face model turns every chunk into a vector (384 numbers
|
|
90
|
+
that capture its meaning). This is the slow part.
|
|
91
|
+
5. **Save**: store chunks and vectors in a new Chroma index under `.pilotrag/index/`.
|
|
92
|
+
6. **Swap**: when the new index is complete, the `CURRENT` pointer switches to it and
|
|
93
|
+
the old one is removed. If anything failed, the old index stays in use.
|
|
94
|
+
|
|
95
|
+
**Phase 2: answer a question** (every `pilotrag query` / `rag.query()`)
|
|
96
|
+
|
|
97
|
+
1. **Open** the saved index from disk; documents are not re-read or re-embedded.
|
|
98
|
+
2. **Embed the question** only (one short text, milliseconds).
|
|
99
|
+
3. **Search** for the chunks whose vectors are closest to the question (top 5 by default).
|
|
100
|
+
4. **Check evidence**: if nothing is retrieved (or, when you set `retrieval.min_score`,
|
|
101
|
+
everything scores below it), reply "not enough information" without calling the
|
|
102
|
+
LLM.
|
|
103
|
+
5. **Ask the LLM** (Ollama) with the question plus those chunks, instructed to answer
|
|
104
|
+
only from them and to say when they are insufficient.
|
|
105
|
+
6. **Return** the answer with its sources (file, heading, score, snippet).
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
INGEST (when you run it): docs/*.md -> chunks -> embeddings -> saved index
|
|
109
|
+
QUERY (every question): question -> embedding -> search saved index -> LLM -> answer + sources
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The index does **not** update by itself: nothing watches your files and nothing
|
|
113
|
+
runs on a schedule. When documents change, run `pilotrag ingest` again, by hand or
|
|
114
|
+
on a schedule (see [Keep the index up to date](#step-8-keep-the-index-up-to-date)).
|
|
115
|
+
|
|
116
|
+
## Features
|
|
117
|
+
|
|
118
|
+
- **Local and free by default**: Hugging Face embeddings, Ollama chat, Chroma
|
|
119
|
+
storage, no accounts or API keys.
|
|
120
|
+
- **Grounded answers with sources**: every `Answer` lists the files, headings,
|
|
121
|
+
scores and snippets of the chunks given to the model. When nothing relevant is
|
|
122
|
+
found (no chunks retrieved, or all below `retrieval.min_score`) you get
|
|
123
|
+
`status="insufficient_evidence"` and no LLM call. By default `min_score` is unset,
|
|
124
|
+
so a non-empty index always returns `top_k` chunks and the model itself is
|
|
125
|
+
instructed to say when the context does not answer the question.
|
|
126
|
+
- **Safe index updates**: each ingest builds a new index generation and swaps it in
|
|
127
|
+
atomically; a failed run leaves the previous index queryable.
|
|
128
|
+
- **Compatibility checks**: the index records which embedding model and chunker
|
|
129
|
+
built it, and queries refuse a mismatched index instead of returning wrong results.
|
|
130
|
+
- **Metadata filters**: restrict a query to documents whose frontmatter matches.
|
|
131
|
+
- **Typed errors with hints**: every failure has a stable `code` and a fix.
|
|
132
|
+
- **Extensible and testable**: plugin entry points, deterministic fakes and
|
|
133
|
+
contract test suites.
|
|
134
|
+
|
|
135
|
+
## Step-by-step guide
|
|
136
|
+
|
|
137
|
+
Commands are shown for Windows PowerShell; macOS/Linux differences are noted.
|
|
138
|
+
|
|
139
|
+
### Step 1: Install the prerequisites (once)
|
|
140
|
+
|
|
141
|
+
1. **Python 3.10 - 3.13**: check with `python --version`.
|
|
142
|
+
2. **Ollama** (generates the answers): install from
|
|
143
|
+
<https://ollama.com/download> and make sure it is running (it starts
|
|
144
|
+
automatically on Windows/macOS; on Linux run `ollama serve`).
|
|
145
|
+
3. **Pull a chat model**:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
ollama pull qwen2.5:0.5b
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
This one is small and fast. For better answers use a larger model such as
|
|
152
|
+
`qwen2.5:3b` or `llama3.2:3b` and set `llm.model` accordingly.
|
|
153
|
+
|
|
154
|
+
### Step 2: Create a project and install PilotRAG
|
|
155
|
+
|
|
156
|
+
```powershell
|
|
157
|
+
mkdir my-kb
|
|
158
|
+
cd my-kb
|
|
159
|
+
python -m venv .venv
|
|
160
|
+
.venv\Scripts\activate # macOS/Linux: source .venv/bin/activate
|
|
161
|
+
pip install "pilotrag[local]"
|
|
162
|
+
pilotrag --version # verify the install
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`local` = Hugging Face embeddings + Ollama client + Chroma. It pulls in PyTorch,
|
|
166
|
+
so the first install is large. Smaller installs: `pilotrag[huggingface]`,
|
|
167
|
+
`pilotrag[ollama]`, `pilotrag[chroma]`; plain `pip install pilotrag` is the core
|
|
168
|
+
only (bring your own providers or use the shipped test fakes).
|
|
169
|
+
|
|
170
|
+
To install from a local checkout of this repository instead of PyPI:
|
|
171
|
+
|
|
172
|
+
```powershell
|
|
173
|
+
pip install "C:/path/to/pilot-rag[local]"
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Step 3: Add your documents
|
|
177
|
+
|
|
178
|
+
```powershell
|
|
179
|
+
mkdir docs
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Put your `.md` files in `docs/` (subfolders are fine). Optionally add frontmatter
|
|
183
|
+
at the top of a file so you can filter on it later:
|
|
184
|
+
|
|
185
|
+
```markdown
|
|
186
|
+
---
|
|
187
|
+
team: platform
|
|
188
|
+
---
|
|
189
|
+
# Deploy process
|
|
190
|
+
|
|
191
|
+
Deploys happen every Tuesday at 10am UTC.
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Step 4: Write the config file
|
|
195
|
+
|
|
196
|
+
Create `pilotrag.yaml` in `my-kb/`:
|
|
197
|
+
|
|
198
|
+
```yaml
|
|
199
|
+
version: 1
|
|
200
|
+
documents:
|
|
201
|
+
path: ./docs
|
|
202
|
+
on_error: skip # skip unreadable files instead of stopping the run
|
|
203
|
+
chunking:
|
|
204
|
+
strategy: recursive_markdown
|
|
205
|
+
size: 1000
|
|
206
|
+
overlap: 200
|
|
207
|
+
embeddings:
|
|
208
|
+
provider: huggingface
|
|
209
|
+
model: BAAI/bge-small-en-v1.5
|
|
210
|
+
llm:
|
|
211
|
+
provider: ollama
|
|
212
|
+
model: qwen2.5:0.5b
|
|
213
|
+
vector_store:
|
|
214
|
+
provider: chroma
|
|
215
|
+
path: ./.pilotrag/index
|
|
216
|
+
retrieval:
|
|
217
|
+
strategy: dense
|
|
218
|
+
top_k: 5
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
> **Relative paths are resolved from the folder you run the command in, not from the
|
|
222
|
+
> config file's location.** `./docs` and `./.pilotrag/index` above work when you run
|
|
223
|
+
> `pilotrag` from `my-kb/`. If you run it from elsewhere (for example a scheduler),
|
|
224
|
+
> either `cd` into the project folder first or use absolute paths.
|
|
225
|
+
|
|
226
|
+
### Step 5: Build the index
|
|
227
|
+
|
|
228
|
+
```powershell
|
|
229
|
+
pilotrag ingest
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
- The first run downloads the embedding model (about 130 MB) to your Hugging Face
|
|
233
|
+
cache; later runs reuse it.
|
|
234
|
+
- The output shows documents discovered/processed/skipped, chunks indexed and
|
|
235
|
+
`Status: success`.
|
|
236
|
+
- Preview without embedding or writing anything: `pilotrag ingest --dry-run`.
|
|
237
|
+
|
|
238
|
+
### Step 6: Ask questions
|
|
239
|
+
|
|
240
|
+
```powershell
|
|
241
|
+
pilotrag query "When do deploys happen?"
|
|
242
|
+
pilotrag query "When do deploys happen?" --top-k 3
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
You get the answer plus the source files and headings it used. The model is
|
|
246
|
+
instructed to answer only from the retrieved chunks and to say when they do not
|
|
247
|
+
contain the answer (small models may still guess). To make weak matches count as
|
|
248
|
+
"no evidence" (`status="insufficient_evidence"`, no LLM call), set
|
|
249
|
+
`retrieval.min_score` (for example `0.5`; tune it per embedding model).
|
|
250
|
+
|
|
251
|
+
### Step 7: Use it from Python (your application)
|
|
252
|
+
|
|
253
|
+
```python
|
|
254
|
+
import asyncio
|
|
255
|
+
|
|
256
|
+
from pilotrag import RAG
|
|
257
|
+
from pilotrag.core.types import MetadataFilter
|
|
258
|
+
|
|
259
|
+
with RAG.from_config("pilotrag.yaml") as rag: # closes resources on exit
|
|
260
|
+
answer = rag.query("When do deploys happen?") # Answer
|
|
261
|
+
print(answer.text)
|
|
262
|
+
for source in answer.sources: # SourceReference
|
|
263
|
+
print(source.relative_path, source.heading_path, source.score)
|
|
264
|
+
|
|
265
|
+
if answer.status == "insufficient_evidence":
|
|
266
|
+
print("Not in the docs.")
|
|
267
|
+
|
|
268
|
+
# Only search documents whose frontmatter has `team: platform`
|
|
269
|
+
scoped = rag.query(
|
|
270
|
+
"Deploy steps?",
|
|
271
|
+
filters=MetadataFilter(equalities={"team": "platform"}),
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
# Async twin for async apps (e.g. FastAPI): runs on a worker thread
|
|
275
|
+
later = asyncio.run(rag.aquery("What is the rate limit?"))
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Your application should **only query**. Build the index separately (Step 5 or
|
|
279
|
+
Step 8), not before every question. Ingesting from Python is also possible:
|
|
280
|
+
|
|
281
|
+
```python
|
|
282
|
+
with RAG.from_config("pilotrag.yaml") as rag:
|
|
283
|
+
report = rag.ingest() # IngestionReport
|
|
284
|
+
print(report.status, report.chunks_indexed, report.skipped)
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Also available: `RAG.from_mapping({...})`, `RAG.from_settings(settings)`,
|
|
288
|
+
`rag.validate()`, `rag.ingest(dry_run=True)`. Full reference:
|
|
289
|
+
[docs/api-reference/overview.md](https://github.com/praveen9392/pilot-rag/blob/main/docs/api-reference/overview.md).
|
|
290
|
+
|
|
291
|
+
### Step 8: Keep the index up to date
|
|
292
|
+
|
|
293
|
+
Whenever your documents change, run `pilotrag ingest` again. It builds a fresh
|
|
294
|
+
index and swaps it in safely; a lock file prevents two ingests from overlapping.
|
|
295
|
+
To automate it:
|
|
296
|
+
|
|
297
|
+
- **Windows Task Scheduler** (daily at 02:00; use `/sc hourly` instead of
|
|
298
|
+
`/sc daily /st 02:00` for every hour). Scheduled tasks start in
|
|
299
|
+
`C:\Windows\System32`, so the task changes into the project folder first
|
|
300
|
+
(relative paths in the config resolve from there):
|
|
301
|
+
|
|
302
|
+
```powershell
|
|
303
|
+
schtasks /create /tn "pilotrag-ingest" /sc daily /st 02:00 /tr "cmd /c cd /d C:\path\to\my-kb && .venv\Scripts\pilotrag.exe ingest"
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
- **macOS/Linux cron** (every hour):
|
|
307
|
+
|
|
308
|
+
```text
|
|
309
|
+
0 * * * * cd /path/to/my-kb && .venv/bin/pilotrag ingest
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
- **On every new build or deploy**: add `pilotrag ingest -c pilotrag.yaml` as a step
|
|
313
|
+
in your CI/CD pipeline.
|
|
314
|
+
|
|
315
|
+
Current limitations to plan around:
|
|
316
|
+
|
|
317
|
+
- Every ingest re-embeds **all** documents, even unchanged ones (no incremental
|
|
318
|
+
ingestion yet).
|
|
319
|
+
- A long-running application keeps using the index it already opened; restart it
|
|
320
|
+
(or create a new `RAG` object) after a scheduled ingest to pick up the new index.
|
|
321
|
+
|
|
322
|
+
### Step 9: If something goes wrong
|
|
323
|
+
|
|
324
|
+
| Problem | Fix |
|
|
325
|
+
| --- | --- |
|
|
326
|
+
| `Error [index_not_found]` | Run `pilotrag ingest` first |
|
|
327
|
+
| `Error [index_incompatible]` | You changed the embedding model or chunking settings: run `pilotrag ingest` again |
|
|
328
|
+
| `Error [provider_unavailable]` (Ollama) | Start Ollama (`ollama serve`) and check `llm.base_url` |
|
|
329
|
+
| `Error [provider_response]` 404 | The model is not pulled: `ollama pull <model>` |
|
|
330
|
+
| `Error [missing_extra]` | `pip install "pilotrag[local]"` |
|
|
331
|
+
| Embedding model download fails | The first run needs internet; afterwards you can set `HF_HUB_OFFLINE=1`. See [troubleshooting](https://github.com/praveen9392/pilot-rag/blob/main/docs/operations/troubleshooting.md#hugging-face-embedder) |
|
|
332
|
+
| Weak or off-topic answers | Use a larger chat model, or set `retrieval.min_score: 0.5` to drop weak matches |
|
|
333
|
+
|
|
334
|
+
More: [docs/operations/troubleshooting.md](https://github.com/praveen9392/pilot-rag/blob/main/docs/operations/troubleshooting.md).
|
|
335
|
+
Known limitations: [docs/releases/known-issues.md](https://github.com/praveen9392/pilot-rag/blob/main/docs/releases/known-issues.md).
|
|
336
|
+
|
|
337
|
+
## Configuration summary
|
|
338
|
+
|
|
339
|
+
Required sections: `documents`, `chunking`, `embeddings`, `llm`, `vector_store`.
|
|
340
|
+
`version` is optional and defaults to `1` (setting it is recommended). Every key is
|
|
341
|
+
validated; unknown keys and bad values are reported together with their paths.
|
|
342
|
+
Relative paths resolve from the current working directory.
|
|
343
|
+
|
|
344
|
+
| Section | Key options (defaults) |
|
|
345
|
+
| --- | --- |
|
|
346
|
+
| `documents` | `path`, `extensions` (`[".md"]`), `follow_symlinks` (false), `include_hidden` (false), `max_file_size_mb` (5), `on_error` (`fail` or `skip`) |
|
|
347
|
+
| `chunking` | `strategy: recursive_markdown`, `size` (1000), `overlap` (200) |
|
|
348
|
+
| `embeddings` | `provider: huggingface` (default) or `ollama`; `model`, `batch_size`, `device`, ... |
|
|
349
|
+
| `llm` | `provider: ollama`, `model`, `temperature` (0.0), `timeout_s` (120), `base_url` |
|
|
350
|
+
| `vector_store` | `provider: chroma`, `path` (`./.pilotrag/index`), `collection` |
|
|
351
|
+
| `retrieval` | `strategy: dense`, `top_k` (5), `min_score` (null, range -1..1) |
|
|
352
|
+
| `generation` | `insufficient_evidence_message`, `max_context_chunks` (8) |
|
|
353
|
+
| `logging` | `level`, `format` (`text` or `json`), `redact` |
|
|
354
|
+
|
|
355
|
+
Override any value with `PILOTRAG__SECTION__KEY` environment variables or
|
|
356
|
+
`${ENV}` references. Complete reference:
|
|
357
|
+
[docs/development/configuration.md](https://github.com/praveen9392/pilot-rag/blob/main/docs/development/configuration.md).
|
|
358
|
+
|
|
359
|
+
## CLI reference
|
|
360
|
+
|
|
361
|
+
```text
|
|
362
|
+
pilotrag --version
|
|
363
|
+
pilotrag ingest [--config/-c PATH] [--dry-run]
|
|
364
|
+
pilotrag query QUESTION [--config/-c PATH] [--top-k N]
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
| Option | Default | Meaning |
|
|
368
|
+
| --- | --- | --- |
|
|
369
|
+
| `--config`, `-c` | `pilotrag.yaml` | Config file |
|
|
370
|
+
| `--dry-run` (ingest) | off | Plan only; nothing embedded or written |
|
|
371
|
+
| `--top-k` (query) | config value | Chunks to retrieve |
|
|
372
|
+
|
|
373
|
+
| Exit code | Meaning |
|
|
374
|
+
| --- | --- |
|
|
375
|
+
| 0 | Success |
|
|
376
|
+
| 1 | Failure (see `Error [code]` / `Hint:` on stderr) |
|
|
377
|
+
| 2 | Invalid configuration or usage |
|
|
378
|
+
| 3 | Ingest finished with some files failed (`on_error: skip`) |
|
|
379
|
+
|
|
380
|
+
## Choosing an embedding model
|
|
381
|
+
|
|
382
|
+
The default is `BAAI/bge-small-en-v1.5` (384 dimensions, MIT license), a strong
|
|
383
|
+
small English model that runs on CPU. For an even smaller model use
|
|
384
|
+
`sentence-transformers/all-MiniLM-L6-v2`; any sentence-transformers model id
|
|
385
|
+
works. Use `device: cuda` or `mps` for acceleration, `query_instruction` for
|
|
386
|
+
models that need a query prefix, and `HF_HOME` / `HF_HUB_OFFLINE=1` to control the
|
|
387
|
+
model cache and network use. Ollama embeddings (`provider: ollama`) remain
|
|
388
|
+
available.
|
|
389
|
+
|
|
390
|
+
**Switching models requires re-ingesting.** The index fingerprint records the
|
|
391
|
+
embedding provider, model, dimension and vector settings (and the chunker
|
|
392
|
+
settings); after a change, queries fail with `index_incompatible` until you run
|
|
393
|
+
`pilotrag ingest` again.
|
|
394
|
+
|
|
395
|
+
## Extending
|
|
396
|
+
|
|
397
|
+
Replace any component (chunker, loader, embedder, chat model, vector store,
|
|
398
|
+
retriever, reranker) by registering a `ProviderSpec` in code or publishing it
|
|
399
|
+
under a `pilotrag.<kind>` entry-point group, then select it in YAML. See
|
|
400
|
+
[docs/technical-design/integration-design.md](https://github.com/praveen9392/pilot-rag/blob/main/docs/technical-design/integration-design.md)
|
|
401
|
+
and the offline example [examples/custom_chunker](https://github.com/praveen9392/pilot-rag/tree/main/examples/custom_chunker/).
|
|
402
|
+
A runnable end-to-end project lives in [examples/markdown_qa](https://github.com/praveen9392/pilot-rag/tree/main/examples/markdown_qa/).
|
|
403
|
+
|
|
404
|
+
## Documentation
|
|
405
|
+
|
|
406
|
+
Start at [docs/index.md](https://github.com/praveen9392/pilot-rag/blob/main/docs/index.md): requirements, architecture and
|
|
407
|
+
decisions, technical design, API reference, development setup, deployment, testing,
|
|
408
|
+
operations and release notes. Release history:
|
|
409
|
+
[docs/releases/release-notes.md](https://github.com/praveen9392/pilot-rag/blob/main/docs/releases/release-notes.md).
|
|
410
|
+
|
|
411
|
+
## License
|
|
412
|
+
|
|
413
|
+
MIT. See [LICENSE](https://github.com/praveen9392/pilot-rag/blob/main/LICENSE).
|