feat(ingestion): add Phase 1 database and application foundation

Add the scoped PostgreSQL/pgvector schema, independent ingestion settings and ports, embedding profile checks, and trusted administrator bootstrap.

Include repository contracts and guidance, organized provider-free and PostgreSQL tests, deployment setup, and byte-preserving migration attributes.

Validation: 163 tests passed; all 48 PostgreSQL cases passed with pgvector Python 0.5.0 and 0.3.6. No production schema or historical metadata was changed.
This commit is contained in:
amirhosein mazaheri
2026-10-05 16:38:28 +03:30
parent cb54a35c90
commit baf58da562
50 changed files with 4628 additions and 3 deletions
+29
View File
@@ -16,3 +16,32 @@ 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 future hosted 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"]'
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