Files
rag-technical-docs-assistant/.env.example
T
amirhosein mazaheri 0a998ac94a feat(ingestion): extend domain types, ports, and configuration for ingestion pipeline
- Add ExtractedBlock, ExtractionEnvelope, and StagedDocument data models in types.py
- Define ingestion repository, file store, vision, and extraction ports in ports.py
- Extend IngestionSettings with limits, policies, vision, and embedding configuration
- Update database compatibility verification to support worker and review schema revisions
- Add PyMuPDF, Pillow, defusedxml, and tiktoken dependencies to pyproject.toml
2026-10-07 16:20:19 +03:30

80 lines
3.0 KiB
Bash

# App Config
APP_NAME="Technical Documentation Assistant"
APP_VERSION="1.0.0"
APP_ENVIRONMENT="development"
# LLM Config
API_KEY="your-api-key-here"
LLM_BASE_URL="https://openrouter.ai/api/v1"
LLM_MODEL="gpt-4o-mini"
LLM_TEMPERATURE=0.0
LLM_MAX_TOKENS=2048
LLM_MAX_ITERATIONS=3
# RAG Config
CHUNK_SIZE=1000
CHUNK_OVERLAP=200
DOCS_DIR="./data/documents"
CHROMA_PERSIST_DIR="./data/vector_db"
# Independent ingestion settings. Choose the real deployment profile explicitly.
INGEST_DATABASE_URL="postgresql+psycopg://user:password@localhost:5432/rag"
INGEST_EMBEDDING_PROVIDER=""
# HTTP(S) host/optional port/path only; no userinfo/query/fragment/encoded components.
INGEST_EMBEDDING_ENDPOINT=""
INGEST_EMBEDDING_MODEL=""
INGEST_EMBEDDING_DIMENSIONS=
# Not needed for schema/bootstrap; required by the hosted embedding adapter.
INGEST_EMBEDDING_API_KEY=""
INGEST_EMBEDDING_PREPROCESSING_VERSION="v1"
INGEST_EMBEDDING_TIMEOUT_SECONDS=60
INGEST_ORIGINAL_DIRECTORY="data/originals"
INGEST_ACCEPTED_FORMATS='[".pdf", ".md", ".docx", ".jpg", ".jpeg", ".png"]'
INGEST_MAX_ORIGINAL_BYTES=20971520
INGEST_MAX_PDF_PAGES=200
INGEST_MAX_NORMALIZED_CHARACTERS=1000000
INGEST_MAX_CHUNKS=2000
INGEST_CHUNK_SIZE_CHARACTERS=1000
INGEST_CHUNK_OVERLAP_CHARACTERS=200
INGEST_EMBEDDING_BATCH_SIZE=32
INGEST_MAX_STAGED_BYTES=134217728
INGEST_WORKER_CONCURRENCY=1
INGEST_POLL_SECONDS=2
INGEST_HEARTBEAT_SECONDS=20
INGEST_LEASE_SECONDS=120
INGEST_MAX_AUTOMATIC_ATTEMPTS=3
INGEST_RETRY_BASE_SECONDS=2
INGEST_RETRY_CAP_SECONDS=300
# Engineering deployment defaults, not product-owner approval. No OCR at intake.
INGEST_EXTRACTION_DIRECTORY="data/extractions"
INGEST_MAX_DOCX_ENTRIES=2048
INGEST_MAX_DOCX_MEMBER_BYTES=16777216
INGEST_MAX_DOCX_EXPANDED_BYTES=67108864
INGEST_MAX_DOCX_COMPRESSION_RATIO=200
INGEST_MAX_IMAGE_WIDTH=12000
INGEST_MAX_IMAGE_HEIGHT=12000
INGEST_MAX_IMAGE_PIXELS=40000000
INGEST_EXTRACTION_STRATEGY="direct-quality-fallback-v1"
# Optional identity: configure all three together; credentials are needed only for opt-in Phase 3 vision.
# INGEST_VISION_PROVIDER="<chosen-provider>"
# INGEST_VISION_ENDPOINT="https://provider.example.invalid/v1"
# INGEST_VISION_MODEL="<chosen-model>"
# INGEST_VISION_API_KEY="<secret>"
INGEST_VISION_TIMEOUT_SECONDS=60
INGEST_FALLBACK_POLICY="affected-pages-v1"
INGEST_QUALITY_POLICY="bounded-checks-manual-review-v1"
# Preserve existing embedding preprocessing. New Persian normalization requires migration/reindex design.
INGEST_NORMALIZATION_POLICY="unicode-line-endings-v1"
INGEST_CHUNKING_POLICY="paragraph-v1"
INGEST_RENDER_DPI=144
INGEST_MAX_RENDERED_PAGE_PIXELS=20000000
INGEST_MAX_EXTRACTION_ARTIFACT_BYTES=33554432
INGEST_MAX_EXTRACTED_BLOCKS=10000
# Phase 4: select endpoint/model limits explicitly; no character-to-token estimate.
# INGEST_EMBEDDING_LIMITS='{"unit":"tokens","max_input_units":8192,"max_batch_units":300000,"max_batch_inputs":2048,"tokenizer":"tiktoken:cl100k_base"}'
# The example is NOT compatibility approval for an arbitrary endpoint/model.
INGEST_EMBEDDING_SEND_DIMENSIONS=false
INGEST_EMBEDDING_MAX_RESPONSE_BYTES=16777216