Configuration Issues
Issue: “OpenAI API keys must be provided”
Solution: Make sure you’ve setOPENAI_API_KEYS or OPENAI_API_KEY environment variable:
Issue: “Supabase URL and key must be provided”
Solution: Set Supabase credentials:Issue: “Pinecone API key must be provided”
Solution: Set Pinecone credentials:Make sure your Pinecone index is created before using LangChat.
Runtime Issues
Issue: All API Keys Exhausted
Error:All API keys exhausted
Solutions:
- Add more API keys:
openai_api_keys=["sk-1", "sk-2", "sk-3"] - Increase retry count:
max_llm_retries=3 - Check API key validity
- Wait for rate limit reset
Issue: Rate Limit Errors
Error:Rate limit exceeded
Solutions:
- Use multiple API keys from different organizations
- Reduce request frequency
- Implement request queuing
- Upgrade OpenAI plan
Issue: Model Not Found
Error:Model not found
Solutions:
- Verify model name:
"gpt-4o-mini","gpt-4o", etc. - Check if model is available in your region
- Ensure you have access to the model
Vector Search Issues
Issue: No Relevant Results
Solutions:- Increase
retrieval_k:retrieval_k=10 - Check Pinecone index has documents
- Verify embeddings are generated correctly
- Try different embedding model
Issue: Index Not Found
Error:Index 'xxx' not found
Solutions:
- Check index name spelling
- Verify index exists in Pinecone console
- Check API key permissions
- Create index first
Issue: Dimension Mismatch
Error:Dimension mismatch
Solutions:
- Ensure embedding model dimension matches index dimension
- Recreate index with correct dimension:
text-embedding-3-large: 3072 dimensionstext-embedding-3-small: 1536 dimensionstext-embedding-ada-002: 1536 dimensions
Database Issues
Issue: Connection Failed
Error:Failed to connect to Supabase
Solutions:
- Verify URL includes
https:// - Check internet connection
- Verify project is active
- Check API key validity
Issue: Table Not Found
Error:Table 'xxx' not found
Solutions:
- Tables are auto-created on first run
- Verify table exists in Supabase dashboard
- Check table name spelling
- Ensure proper permissions
Issue: Permission Denied
Error:Permission denied
Solutions:
- Check RLS policies
- Use
service_rolekey for server-side operations - Verify API key permissions
- Review Row Level Security settings
Reranker Issues
Issue: Model Download Fails
Error:Failed to download model
Solutions:
- Check internet connection
- Verify model name:
"ms-marco-MiniLM-L-12-v2" - Check disk space
- Ensure write permissions on cache directory
Issue: Import Errors
Error:Could not import FlashrankRerank
Solutions:
Issue: Slow Performance
Solutions:- Use smaller model:
reranker_model="ms-marco-MiniLM-L-6-v2" - Reduce retrieval count before reranking
- Use GPU if available
Performance Issues
Issue: Slow Response Times
Solutions:- Reduce
retrieval_k:retrieval_k=5 - Use smaller embedding model
- Reduce
reranker_top_n:reranker_top_n=3 - Optimize Pinecone index
- Use faster model:
openai_model="gpt-4o-mini"
Issue: High Memory Usage
Solutions:- Reduce
max_chat_history:max_chat_history=10 - Use smaller reranker model
- Clear session history periodically
- Use streaming responses (if supported)
General Debugging
Enable Logging
Check Configuration
Test Individual Components
Getting Help
- Check GitHub Issues
- Review Configuration Guide
- See Examples
Related Documentation
- Configuration - Configuration options
- Performance - Performance optimization