legco_ai_assistant/backend/app/services
Woody 57a130dc96 feat(services): add per-sub-question retrieval, filtering, and response generation
Add retrieve_per_subquestion() that queries ChromaDB independently per sub-question instead of joining all sub-qs into one query string. Add filter_per_subquestion() that evaluates each chunk against its own originating sub-question in a single LLM call with a redesigned grouped prompt. Add generate_response_per_subquestion() that produces markdown sections per sub-question with grouped sources and {context_sections} template support. All existing methods preserved for backward compatibility.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-26 23:27:50 +08:00
..
__init__.py feat: Phase 1.1 project setup with config, database, and models 2026-04-22 16:13:52 +08:00
embedding_client.py feat(backend): add embedding client and update LLM client 2026-04-23 13:26:43 +08:00
history_service.py feat(history): Phase 3.5 — Query History backend (service, API, timing, XML capture) 2026-04-25 22:59:53 +08:00
llm_client.py debug(backend): add LLM request/response logging for OpenRouter debugging 2026-04-23 16:28:43 +08:00
prompt_service.py feat(prompts): Phase 3.2 — Prompt Backend (CRUD service, REST API, 33 tests) 2026-04-25 21:11:17 +08:00
query_decomposer.py feat(history): Phase 3.5 — Query History backend (service, API, timing, XML capture) 2026-04-25 22:59:53 +08:00
rag.py feat(services): add per-sub-question retrieval, filtering, and response generation 2026-04-26 23:27:50 +08:00
relevance_filter.py feat(services): add per-sub-question retrieval, filtering, and response generation 2026-04-26 23:27:50 +08:00