Skip to content

feat(M1): query endpoint — claims-native, returns ranked_claims with source_id #46

Description

@ARC345

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions