Rag Search - Capsize-Games/airunner GitHub Wiki
Using AI Runner with RAG (Retrieval-Augmented Generation)
AI Runner provides a Retrieval-Augmented Generation (RAG) system that allows you to enhance your AI's responses with knowledge from your own documents.
How RAG Works in AI Runner
AI Runner uses a keyword-based retrieval system to find relevant information in your documents. When you ask a question, the system:
- Extracts keywords from your query
- Searches the index for documents containing those keywords
- Retrieves the most relevant passages
- Uses those passages to generate a more informed response
Performance Optimizations
RAG search in AI Runner has been optimized for performance:
- Caching of keyword extraction: Previously extracted keywords are cached to avoid redundant processing
- Throttled index refreshing: The index is only refreshed after a certain time interval (5 minutes) to avoid excessive processing during multiple searches
- Batched document processing: Documents are processed in batches for more efficient indexing
- Progress reporting: Long-running operations show progress indicators
- Performance timing: Key operations are timed to help identify bottlenecks
Using RAG with Your Documents
To use RAG with your own documents:
- Add documents in the AI Runner interface
- The system will automatically index them
- When chatting with your AI, it will now use these documents to enhance its responses
Troubleshooting
If RAG search seems slow:
- Reduce the number of documents in your index
- Use smaller documents or break large documents into smaller chunks
- Ensure your documents are properly formatted
- Check the logs for any error messages related to indexing