Summary
Rebuild the POST /query endpoint to search claims (not papers) and return source_id instead of paper_id.
Changes
- Graphiti search uses
group_ids=["claims"] (was ["papers"])
- Response shape:
{ query, answer, ranked_claims[] } — removes legacy sources list
RankedClaim has source_id (not paper_id), adds tags
- Context for LLM synthesis is built from claims with confidence scores
_rank_claims_from_graph uses claims table (not papers)
- Relevance is still a position-based stub (TODO: join on graphiti_node_uuid for real per-claim scores)
Files
backend/api/query.py — rewrite
backend/tests/test_query.py — rewrite
Summary
Rebuild the
POST /queryendpoint to search claims (not papers) and returnsource_idinstead ofpaper_id.Changes
group_ids=["claims"](was["papers"]){ query, answer, ranked_claims[] }— removes legacysourceslistRankedClaimhassource_id(notpaper_id), addstags_rank_claims_from_graphuses claims table (not papers)Files
backend/api/query.py— rewritebackend/tests/test_query.py— rewrite