Skip to content

perf: Batch embeddings in RAGIndexer instead of per-file encode#156

Open
shrutu0929 wants to merge 1 commit intoRefactron-ai:mainfrom
shrutu0929:perf/ragindexer-batch-encode
Open

perf: Batch embeddings in RAGIndexer instead of per-file encode#156
shrutu0929 wants to merge 1 commit intoRefactron-ai:mainfrom
shrutu0929:perf/ragindexer-batch-encode

Conversation

@shrutu0929
Copy link
Copy Markdown

@shrutu0929 shrutu0929 commented Apr 7, 2026

solve #150
The recent update to the RAGIndexer resolves a significant bottleneck in the index-building process by eliminating the overhead of per-file embedding encoding. Previously, the system would invoke the machine learning model immediately after processing each file, which essentially starved the SentenceTransformer model of its ability to process text in bulk. To solve this, we decoupled chunk extraction from vector submission: the indexer now continuously sweeps through Python files in the repository and funnels all generated chunks into shared memory rather than committing them file-by-file. We exposed a configurable parameter, batch_size (defaulted to 100), which dictates the maximum size of this accumulation pool. The system only triggers the expensive hardware encoding step once that precise batch threshold is breached, safely carrying over any residual chunks across module boundaries. By feeding the underlying neural network large, unified batches of documents instead of countless sparse ones, you gain drastically improved GPU throughput and significantly lower wall-clock indexing times.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

Warning

Rate limit exceeded

@shrutu0929 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 12 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 9 minutes and 12 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bcd8b6e8-644e-437f-bbf3-2ce794df1564

📥 Commits

Reviewing files that changed from the base of the PR and between a9659f5 and 08e87c6.

📒 Files selected for processing (1)
  • refactron/rag/indexer.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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