Skip to content

Add chunking and multi-query retrieval#2

Merged
stevez merged 2 commits into
mainfrom
feat/multi-query-and-chunking
Apr 10, 2026
Merged

Add chunking and multi-query retrieval#2
stevez merged 2 commits into
mainfrom
feat/multi-query-and-chunking

Conversation

@stevez

@stevez stevez commented Apr 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • RecursiveCharacterTextSplitter in ingestion pipeline — chunks PDFs into 1000-char segments with 200-char overlap instead of storing whole pages
  • Multi-query retrieval — generates 3 query variants via LLM, retrieves docs for all queries in parallel, and deduplicates results

Why

  • Smaller chunks improve retrieval precision (less noise per chunk)
  • Multiple query variants improve recall (catches docs a single query would miss)

Test plan

  • Clear Supabase documents table
  • Re-upload a PDF and verify row count increased (more chunks)
  • Ask a question and verify the answer quality improves
  • Backend unit tests pass (6/6)

🤖 Generated with Claude Code

stevez and others added 2 commits April 10, 2026 01:54
- Chunk documents (1000 chars, 200 overlap) before embedding for
  better retrieval precision
- Generate multiple query variants using LLM to improve recall
- Retrieve docs for all queries in parallel and deduplicate results

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Limit retrieved docs to k*2 to reduce noise in sources
- Click source cards to expand and view the actual chunk text

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@stevez stevez merged commit 68bf809 into main Apr 10, 2026
1 check passed
@stevez stevez deleted the feat/multi-query-and-chunking branch April 10, 2026 06:16
stevez added a commit that referenced this pull request Apr 10, 2026
* Add RecursiveCharacterTextSplitter and multi-query retrieval

- Chunk documents (1000 chars, 200 overlap) before embedding for
  better retrieval precision
- Generate multiple query variants using LLM to improve recall
- Retrieve docs for all queries in parallel and deduplicate results

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Cap multi-query results and add expandable source citations

- Limit retrieved docs to k*2 to reduce noise in sources
- Click source cards to expand and view the actual chunk text

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant