๐ RAG LanceDB Demo Agent
The RAG LanceDB Demo Agent showcases high-performance RAG capabilities with LanceDB vector database in SuperOptiX. This demo focuses specifically on how to configure and use RAG with LanceDB for scalable, production-ready knowledge retrieval.
๐ฏ What This Demo Shows
This demo demonstrates:
- ๐ High-Performance RAG: How to configure RAG with LanceDB in SuperOptiX
- ๐ Scalable Knowledge Retrieval: Production-ready vector database
- โก Fast Semantic Search: Optimized retrieval performance
- โ๏ธ Playbook Configuration: How to set up RAG with LanceDB in agent playbooks
๐ Setup RAG with LanceDB
1. Install Ollama Model
# Install the Ollama model used in this demo
super model install llama3.2:8b
2. Start Ollama Server
# Start Ollama server (runs on port 11434 by default)
ollama serve
3. Pull and Run the Demo
# Pull the RAG LanceDB demo agent
super agent pull rag_lancedb_demo
# Compile the agent
super agent compile rag_lancedb_demo
# Run the agent
super agent run rag_lancedb_demo --goal "What is the SuperOptiX framework?"
๐ง RAG Configuration in Playbook
The RAG LanceDB demo showcases how to configure RAG with LanceDB in the agent playbook:
Language Model Configuration
language_model:
location: local
provider: ollama
model: llama3.2:8b
api_base: http://localhost:11434
temperature: 0.7
max_tokens: 2048
RAG Configuration
rag:
enabled: true
retriever_type: lancedb
config:
top_k: 5
chunk_size: 512
chunk_overlap: 50
similarity_threshold: 0.7
vector_store:
embedding_model: sentence-transformers/all-MiniLM-L6-v2
table_name: lancedb_demo_table
database_path: ./data/lancedb
Key RAG Configuration Points:
enabled: true: Enables RAG functionality- ๐๏ธ
retriever_type: lancedb: Uses LanceDB as vector database - ๐
top_k: 5: Retrieves top 5 most similar documents - ๐
chunk_size: 512: Document chunk size for processing - ๐
chunk_overlap: 50: Overlap between chunks for context - ๐ฏ
similarity_threshold: 0.7: Minimum similarity score for retrieval - ๐ง
embedding_model: Sentence transformers for embeddings - ๐
table_name: LanceDB table name - ๐พ
database_path: Local storage directory
๐ LanceDB: Enterprise-Grade RAG
LanceDB is built for production environments where performance and scalability matter. It's the vector database of choice for serious applications:
- โก Lightning Fast: Optimized for high-speed semantic search across millions of documents
- ๐ Enterprise Scale: Handles massive document collections with ease
- ๐ข Production Ready: Built with enterprise-grade reliability and consistency
- โ๏ธ Cloud Native: Seamlessly works with cloud storage and distributed systems
- ๐ ACID Compliant: Guarantees data consistency and transaction safety
- ๐ Version Control: Track changes and maintain document history
๐ง Customizing RAG Configuration
Adjust Retrieval Settings
Edit agents/rag_lancedb_demo/playbook/rag_lancedb_demo_playbook.yaml:
rag:
config:
top_k: 10 # Retrieve more documents
chunk_size: 1024 # Larger chunks
similarity_threshold: 0.8 # Higher similarity threshold
Change Vector Database
rag:
retriever_type: chroma # Use ChromaDB instead
vector_store:
collection_name: chromadb_demo_collection
persist_directory: ./data/chromadb
Use Different Embedding Model
rag:
vector_store:
embedding_model: sentence-transformers/all-mpnet-base-v2 # Different embeddings
๐จ Troubleshooting RAG
Common Issues
-
Ollama Server Not Running
# Check if Ollama server is running curl http://localhost:11434/api/tags # Start Ollama server ollama serve -
LanceDB Issues
# Check RAG configuration super agent inspect rag_lancedb_demo # Clear LanceDB data if needed rm -rf ./data/lancedb -
RAG Not Working
# Check RAG configuration super agent inspect rag_lancedb_demo # Verify knowledge base is populated
Getting Help
# Check agent status
super agent inspect rag_lancedb_demo
# View agent logs
super agent logs rag_lancedb_demo
# Get RAG help
super agent --help
๐ Related Documentation
- RAG Guide - Complete RAG setup and usage
- RAG Integration Guide - LanceDB configuration and setup
- Agent Development - Building custom agents
๐ Next Steps
- Try Other RAG Backends: Explore RAG ChromaDB for development