--- title: AI Embedded Knowledge Agent emoji: ๐Ÿง  colorFrom: indigo colorTo: purple sdk: gradio sdk_version: "5.33.0" app_file: app.py pinned: false --- # ๐Ÿง  AI Embedded Knowledge Agent (Payman) A comprehensive Retrieval-Augmented Generation (RAG) system that allows you to upload documents, process URLs, and ask intelligent questions about your knowledge base. Built with modern AI technologies and optimized for deployment on Hugging Face Spaces. ## ๐ŸŽฅ Demo Video Watch our comprehensive demo showcasing the live search capabilities and RAG system in action: [![RAG AI Demo](https://img.shields.io/badge/๐ŸŽฅ_Watch_Demo-Loom-00D4AA?style=for-the-badge)](https://www.loom.com/share/f1a3c79b75ad4b65b528b2973612cdd9?sid=a0932972-2926-42ab-a031-3149e40b1b97) _See how the system processes documents, performs live web searches, and generates intelligent responses with real-time data integration._ ## โœจ Features ### ๐Ÿ”ฅ Core Capabilities - **๐Ÿ“„ Document Processing**: Support for PDF, DOCX, CSV, XLSX, PPTX, TXT, MD, and more - **๐ŸŒ URL Processing**: Extract content from web pages with intelligent crawling - **๐Ÿ” Live Web Search**: Real-time web search using Tavily API for up-to-date information - **๐Ÿง  Smart Q&A**: Ask questions and get contextual answers with source attribution - **๐ŸŽฏ High Accuracy**: Advanced embedding and similarity search for precise results - **โšก Real-time Processing**: Fast document ingestion and query processing ### ๐Ÿš€ Advanced Features - **๐Ÿค– Multiple LLM Support**: Gemini 2.5 Flash, OpenAI GPT models with automatic fallback - **๐Ÿ“Š Analytics Dashboard**: Query analytics, system metrics, and performance monitoring - **๐Ÿ” Smart Query Processing**: Query expansion, caching, and suggestion system - **๐Ÿ“š Knowledge Base Management**: View, manage, and export your knowledge base - **๐Ÿ›ก๏ธ Robust Error Handling**: Graceful degradation and comprehensive error recovery - **๐ŸŽจ Beautiful UI**: Modern Gradio interface optimized for user experience ### ๐Ÿ—๏ธ Technical Excellence - **๐Ÿ”ง Modular Architecture**: Clean, maintainable, and extensible codebase - **โš™๏ธ Configurable**: Comprehensive YAML configuration for all components - **๐Ÿ”’ Secure**: Input sanitization, rate limiting, and security best practices - **๐Ÿ“ˆ Scalable**: Designed for production deployment with monitoring and health checks - **๐Ÿงช Well-tested**: Comprehensive test suite and example usage ## ๐ŸŽฏ Project Origin & Agentic Vision This project was initially conceived and developed as part of the **`payman`**, showcasing a robust **`paymanai`** for intelligent knowledge retrieval and generation. Our vision was to build an autonomous AI agent capable of: - **๐Ÿง  Intelligent Information Retrieval**: Acting as a smart agent to fetch, process, and synthesize information from diverse sources (documents, URLs, live web). - **๐Ÿš€ Dynamic Query Routing**: Intelligently deciding between local knowledge base retrieval and real-time web search based on query intent. - **๐Ÿ’ก Autonomous Knowledge Management**: Providing a self-contained system for building and querying a dynamic knowledge base. This system embodies the principles of agentic AI, offering a powerful, self-sufficient solution for complex information needs.