refactor: Update agentic_rag_gpt5 to use new Knowledge class and improve URL management

- Replaced UrlKnowledge with Knowledge for better document loading.
- Enhanced session state management for URLs to prevent duplicates.
- Updated placeholder URLs and query prompts for clarity.
- Adjusted requirements.txt to specify a minimum version for the 'agno' package.
This commit is contained in:
Shubhamsaboo
2025-11-09 11:59:28 -08:00
parent b7f74685a4
commit 5685c508fc
3 changed files with 45 additions and 82 deletions

View File

@@ -105,49 +105,3 @@ An agentic RAG application built with the Agno framework, featuring GPT-5 and La
- **Query Input**: Large text area for custom questions
- **Real-time Streaming**: Live answer generation
- **Markdown Rendering**: Beautiful formatted responses
## 🛠️ Technical Details
### Dependencies
```
streamlit>=1.28.0
agno>=0.1.0
openai>=1.0.0
lancedb>=0.4.0
python-dotenv>=1.0.0
```
### Key Features
- **Event Filtering**: Only shows `RunResponseContent` events for clean output
- **Safe Attribute Access**: Prevents errors from missing attributes
- **Caching**: Efficient resource loading with Streamlit caching
- **Error Handling**: Graceful handling of API and processing errors
## 🔍 Troubleshooting
### Common Issues
**ModelProviderError with max_tokens**
- ✅ Fixed: Uses `max_completion_tokens` instead of `max_tokens`
**Tool calls appearing in output**
- ✅ Fixed: Filters to only show `RunResponseContent` events
**Knowledge base not loading**
- Check OpenAI API key is valid
- Ensure URLs are accessible
- Verify internet connection
### Performance Tips
- **Cache Resources**: Knowledge base and agent are cached for efficiency
- **Streaming**: Real-time updates without blocking
- **LanceDB**: Fast local vector search without external dependencies
## 🎯 Use Cases
- **Documentation Q&A**: Ask questions about technical documentation
- **Research Assistant**: Get answers from multiple knowledge sources
- **Learning Tool**: Interactive exploration of complex topics
- **Content Discovery**: Find relevant information across multiple sources
**Built with ❤️ using Agno, GPT-5, and LanceDB**