Commit History
-
add source to stream output
Rifqi Hafizuddin277f7e2
-
[KM-564] edit agent logic
Rifqi Hafizuddin35b204d -
[NOTICKET] cleanup PR: wire ChatHandler, drop Phase 1 remnants, implement catalog rebuild
- wire chat.py to ChatHandler; remove inline intent routing, retrieval, and answer generation - drop Phase 1 dual-write in db_client /ingest: only on_db_registered runs now - implement on_catalog_rebuild_requested + POST /api/v1/data-catalog/rebuild endpoint - delete dead modules: agents/chatbot (Phase 1), pipeline/orchestrator, query/base, api/v1/knowledge, config/agents/ - rename answer_agent.py -> chatbot.py, AnswerAgent -> ChatbotAgent - fix ChatHandler to use RetrievalRouter (restores Redis retrieval cache) - remove dead _build_csv_documents/_build_excel_documents from processing_service - add top_values to ColumnStats for low-cardinality columns (query planner context) - replace deprecated @app.on_event("startup") with lifespan context manager Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>0700e2b
-
[KM-556][KM-562] fix tabular catalog pipeline: trigger wiring, parquet upload, lazy Azure init, backfill script
- Wire on_db_registered in /database-clients/{id}/ingest endpoint so DB registration now builds the catalog (was silently skipped before). - CSV/XLSX no longer ingested into vector store (embedding wasted); parquet upload preserved via _upload_parquet() so TabularExecutor can still read blobs at query time. - on_document_uploaded implemented (was raise NotImplementedError); opens its own AsyncSessionLocal session, calls document_pipeline.process(). - Lazy-init Azure/PGVector clients in retrieval/document.py via @functools.cache getters; RetrievalRouter holds DocumentRetriever lazily. FastAPI no longer crashes at startup if embedding env vars are missing. - _normalize_chunks in chat_handler.py now handles RetrievalResult objects (previously silently dropped, causing empty context for unstructured path). - Cache invalidation: retrieval_router.invalidate_cache(user_id) called after document process and delete; Redis failure is logged, not raised. - Add scripts/build_initia…59b14af
-
[NOTICKET] IntentRouter + planner + dispatcher + QueryService + AnswerAgent + ChatHandler
Rifqi Hafizuddin +1: Claude Opus 4.7Bundles every Both-PR work item that doesn't require teammate's tabular modules. Phase 1 endpoints and chatbot.py are intentionally NOT touched -- cleanup PR will rewire /chat/stream and rename answer_agent.py -> chatbot.py. - IntentRouter: classify chat / unstructured / structured; history-aware rewritten_query via Pydantic structured output. Prompt with full ruleset + few-shot in config/prompts/intent_router.md. - Planner prompt: build_planner_prompt(question, catalog, previous_error) reuses catalog.enricher.render_source so DB and tabular sources render identically across enricher and planner. System prompt has hard constraints + DB and tabular few-shot in config/prompts/query_planner.md. - QueryPlannerService: Azure OpenAI structured output -> QueryIR. Injectable chain. Supports retry via previous_error arg. - ExecutorDispatcher: pick(ir) routes by source.source_type. Lazy executor imports keep module import-safe. Caches per source_type. Tests inject factories. - Q…f65aee0