-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
106 lines (98 loc) · 5.5 KB
/
Copy pathpyproject.toml
File metadata and controls
106 lines (98 loc) · 5.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
[project]
name = "context-runtime"
version = "0.1.0"
description = "Context Runtime — a database query planner for LLM context. The runtime decides what a model sees before it answers."
readme = "README.md"
requires-python = ">=3.12"
license = { text = "AGPL-3.0" }
# v0.1 core runs fully offline with the stub plugins — zero hard runtime deps.
dependencies = [
"pyyaml>=6.0",
]
[project.optional-dependencies]
# Real model transport across 100+ providers (the ModelPlugin binding).
litellm = ["litellm>=1.40"]
# Single-hop hybrid retrieval (DuckDB vector + BM25 + RRF + rerank).
rag = ["redevops-rag @ git+https://github.com/redevops-io/redevops-rag.git"]
# Multi-hop graph retrieval (knowledge graph + Personalized PageRank).
hipporag = ["hipporag @ git+https://github.com/redevops-io/HippoRAG.git"]
# Bi-temporal graph retrieval (the `temporal` method) — real Graphiti KG over Neo4j.
# Pinned to the redevops fork for G1 source hydration (recovers the raw source turns
# behind each lossy LLM-extracted fact); neo4j ships with graphiti-core.
graphiti = [
"graphiti-core @ git+https://github.com/redevops-io/graphiti.git@redevops/g1-source-hydration",
"sentence-transformers>=3.0",
]
# Semantic (embedding) retrieval + hybrid BM25⊕semantic fusion — deterministic ONNX
# embeddings (no torch) that bridge synonyms/morphology lexical BM25 can't. The runtime
# falls back to pure BM25 when this isn't installed.
embeddings = ["fastembed>=0.3", "numpy>=1.24"]
# Vectorized reciprocal-rank fusion for the sharded parallel retriever (Polars, MIT) —
# a multi-threaded group-by over the candidate union. Opt-in; the scheduler fans out to
# shards regardless, and fusion falls back to pure-Python RRF when this isn't installed.
polars = ["polars>=1.0"]
# Persistent BM25 index backend (DuckDB `fts`, MIT) — one file per shard / per user's local
# data. The in-memory store is the zero-dep default; this is the real-index backend.
duckdb = ["duckdb>=1.0"]
# Postgres full-text store backend (psycopg v3) — the same flat index over tsvector, for
# data that already lives in Postgres. psycopg_pool enables real parallel queries under the
# concurrent control plane (falls back to a lock-guarded single connection without it). Optional.
postgres = ["psycopg[binary]>=3.1", "psycopg_pool>=3.2"]
# Columnar corpus interchange + fast bulk-load (one corpus.parquet vs thousands of .txt).
# Any one of pyarrow / polars / duckdb satisfies it; pyarrow is the light default. The
# persistent BM25 index stays native .duckdb — parquet is only the corpus/bulk-load format.
parquet = ["pyarrow>=14.0"]
# Cross-modal IMAGE retrieval (Phase 2a multimodal): a text query retrieves images/diagrams/
# frames via a CLIP/SigLIP text↔image joint space, ONNX runtime (no torch — same stack as
# [embeddings]). `image` becomes a routable method the bandit can pick. Opt-in via CR_MULTIMODAL.
multimodal = ["fastembed>=0.3", "pillow>=10.0", "numpy>=1.24"]
# Quantized ANN vector index for the `vector` method at scale (TurboQuant, MIT). A
# drop-in for brute-force cosine once the corpus is large (16x memory at 2-bit); quality
# ≈ semantic, the win is memory+speed. Opt-in; the default path stays brute-force exact.
turbovec = ["turbovec>=0.1", "fastembed>=0.3", "numpy>=1.24"]
# Physical execution binding (the SchedulerPlugin compiles to Dagster runs).
dagster = ["dagster>=1.7"]
# Multimodal ingestion (mixed assets → normalized text corpus). Text-layer formats
# (PDF/DOCX/HTML) need only the base extras; image OCR and audio/video ASR activate
# when the userland backends below are present (no system tesseract / torch required).
ingest = ["pypdf>=4.0", "python-docx>=1.1", "beautifulsoup4>=4.12", "lxml>=5.0"]
ingest-multimodal = ["pypdf>=4.0", "python-docx>=1.1", "beautifulsoup4>=4.12", "lxml>=5.0",
"rapidocr-onnxruntime>=1.3", "faster-whisper>=1.0"]
# Data connectors (SourcePlugin) — dlt is a library-shaped, Apache-2.0 connector suite
# (SQL / REST / filesystem / S3 / SaaS). Connectors run Python-side; the Go runtime
# consumes the normalized output. Absent this, only the local-folder source is available.
connectors = ["dlt>=1.0"]
# OCR + table recognition (ExtractorPlugin) — PaddleOCR/PP-Structure (Apache-2.0). Adds
# multilingual OCR and lab-table extraction on top of the base rapidocr backend.
ocr = ["paddleocr>=2.7", "paddlepaddle>=2.6"]
# Text-layer PDF table extraction (ExtractorPlugin) — pdfplumber (MIT). Preserves tables
# from financial filings / reports so figures stay retrievable (vs. flattened text).
pdf-tables = ["pdfplumber>=0.11"]
# Observability export.
otel = ["opentelemetry-sdk>=1.20"]
langfuse = ["langfuse>=2.0"]
# The control plane (fleet dashboard + API over the ModuleTenant fleet).
control-plane = ["fastapi>=0.110", "uvicorn>=0.29", "httpx>=0.27"]
dev = ["pytest>=8.0", "ruff>=0.7"]
[project.scripts]
context-runtime = "context_runtime.runtime.cli:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["context_runtime"]
# Some optional-dependency extras (e.g. `rag`) use direct URL/VCS references;
# hatchling requires this to be opted in, else building a wheel from an sdist/
# tarball (as the reference apps do: `context-runtime @ .../main.tar.gz`) fails
# metadata generation even though those extras aren't being installed.
[tool.hatch.metadata]
allow-direct-references = true
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"]
ignore = ["E501"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-q"