Spaces:
Sleeping
Sleeping
Commit History
-
Give every module one definition of the data directory
Donne120 +1: Claude Opus 5Three modules worked out where to put files independently and disagreed. retrieval_engine.py honoured the DATA_DIR environment variable — but only when DEPLOYMENT_ENV was "huggingface". document_processor.py and prompt_engine/templates.py hardcoded Path("./data") and ignored it. Nothing sets DATA_DIR in production, so all three resolved to the same directory by coincidence and the split was invisible. Set it — which is the obvious thing to do when mounting persistent storage during the AWS migration — and uploads write to ./data while retrieval searches somewhere else. Nothing raises: the upload reports success and the document simply never becomes answerable. paths.py now owns DATA_DIR, DOCUMENTS_DIR, METADATA_FILE, VECTOR_DB_DIR, PROMPTS_DIR and ALU_BRAIN_DIR; the three modules import from it. Also removed retrieval_engine's DEPLOYMENT_ENV branch, whose non-Hugging-Face path preferred ./backend/data when it existed — verified it does not exist in this repo, so that branch never ran…c8527f1
-
feat(retrieval): scope document retrieval to the caller's organization
Donne120 +1: Claude Sonnet 5Phase 2 (part 1 of 2) of the multi-university platform plan. The one production route with per-user auth already wired (/api/chat/claude) now resolves the caller's organization_id (reusing Phase 1's auth work via admin_routes.current_org_any_user) and asks a new org_registry for that org's own retrieval engine, instead of always using the single global ALU engine. - retrieval_engine.py / retrieval_engine_extended.py: RetrievalEngine and ExtendedRetrievalEngine now take an optional collection_name / brain_dir, defaulting to ALU's existing "alu_documents" collection and "alu_brain" folder — so building either with no arguments is byte-identical to before this change. Also fixes a real, pre-existing bug this work surfaced: get_collection()'s "does not exist" case was caught as ValueError, which is version-fragile (newer chromadb raises a different exception type) and would have silently broken the "create it" fallback for any collection that doesn't exist yet, including e…3700462
-
Improve list-answer recall: retrieval top_k 5 -> 8
Donne120 +1: Claude Opus 4.8"List all X" questions (ML faculty, clubs) spread their answer across several Sheet rows; top-5 retrieval often surfaced only one, so the model honestly said it lacked a full list even though the data was indexed. Raising the default to 8 lets sibling rows reach the model. The extended engine merges this with brain results and caps at 10, so cost stays bounded. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>fe72d27
-
best move
Donne120f4cfd3f