{"id":30285569,"url":"https://github.com/cyprianfusi/advanced-rag-chat-app","last_synced_at":"2026-04-11T17:36:40.082Z","repository":{"id":309879060,"uuid":"1037514597","full_name":"CyprianFusi/advanced-rag-chat-app","owner":"CyprianFusi","description":"A production-ready, full-stack Retrieval-Augmented Generation (RAG) application that enables intelligent conversations with your documents using advanced AI models. Upload files, ask natural language questions, and receive real-time, AI-generated responses complete with clear source attributions.","archived":false,"fork":false,"pushed_at":"2025-08-23T03:56:27.000Z","size":5300,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-24T07:21:44.489Z","etag":null,"topics":["fastapi","langchain","llms","nodejs","pgvector","postgresql","rag","rag-chatbot","react"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyprianFusi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-13T17:30:22.000Z","updated_at":"2025-08-23T03:56:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"9fb2b1aa-5a0b-489c-adf3-b4c1b63af856","html_url":"https://github.com/CyprianFusi/advanced-rag-chat-app","commit_stats":null,"previous_names":["cyprianfusi/advanced-rag-chat-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CyprianFusi/advanced-rag-chat-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyprianFusi%2Fadvanced-rag-chat-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyprianFusi%2Fadvanced-rag-chat-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyprianFusi%2Fadvanced-rag-chat-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyprianFusi%2Fadvanced-rag-chat-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyprianFusi","download_url":"https://codeload.github.com/CyprianFusi/advanced-rag-chat-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyprianFusi%2Fadvanced-rag-chat-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272031557,"owners_count":24861688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","langchain","llms","nodejs","pgvector","postgresql","rag","rag-chatbot","react"],"created_at":"2025-08-16T20:05:22.980Z","updated_at":"2026-04-11T17:36:40.075Z","avatar_url":"https://github.com/CyprianFusi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/CyprianFusi/advanced-rag-chat-app/main/public/binati_logo.png\" alt=\"BINATI AI Logo\" width=\"75\"/\u003e\u003cstrong\u003eBinati AInalytics\u003c/strong\u003e\n\n  # Advanced Multi-Files RAG Chat App\n\n  _By **BINATI AInalytics**_\n\u003c/div\u003e\n\n---\n\n## 🚀 Advanced Multi-Files RAG Chat Application\n\n[![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![FastAPI](https://img.shields.io/badge/FastAPI-0.104+-green.svg)](https://fastapi.tiangolo.com/)\n[![React](https://img.shields.io/badge/React-18.0+-61DAFB.svg)](https://reactjs.org/)\n[![LangChain](https://img.shields.io/badge/LangChain-0.1+-purple.svg)](https://langchain.com/)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-14+-336791.svg)](https://www.postgresql.org/)\n[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n\u003e A production-ready, full-stack Retrieval-Augmented Generation (RAG) application that enables intelligent conversations with your documents using advanced AI models. \n\u003e Upload files, ask natural language questions, and receive real-time, AI-generated responses complete with clear source attributions.\n\n# Demo\n![RAG Chat Demo](public/advanced_rag_ui_1.png)\n![RAG Chat Demo](public/advanced_rag_ui_2.png)\n![RAG Chat Demo](public/advanced_rag_ui_3.png)\n\n## ✨ Features\n\n### 🎯 Core Functionality\n- **Multi-Document Support** - Upload and process PDF, DOCX, TXT, CSV, XLSX, and more\n- **Real-time Streaming** - Smooth, typewriter-effect responses\n- **Intelligent Context Management** - Handles conversation history and pronouns\n- **Source Attribution** - Always shows which documents provided the answers\n- **Session Management** - Persistent chat sessions with full history\n\n### 🔧 Technical Excellence\n- **Multiple LLM Providers** - OpenAI, Anthropic, Google, Cohere, Hugging Face\n- **Vector Database** - PostgreSQL with pgvector for semantic search\n- **Semantic Chunking** - Advanced document splitting for better retrieval\n- **Context Length Management** - Automatic token limit handling\n- **Production Architecture** - Scalable, maintainable, and robust\n\n### 🎨 User Experience\n- **Modern UI** - Clean, responsive React interface\n- **File Management** - Easy upload, process, and delete documents\n- **Real-time Feedback** - Processing status and error handling\n- **Mobile Friendly** - Works seamlessly on all devices\n\n## 🏗️ Architecture\n\n```mermaid\ngraph TB\n    A[React Frontend] --\u003e B[FastAPI Backend]\n    B --\u003e C[RAG Service]\n    C --\u003e D[Vector Store\u003cbr/\u003ePostgreSQL + pgvector]\n    C --\u003e E[LLM Factory\u003cbr/\u003eMulti-provider support]\n    B --\u003e F[Document Processor]\n    F --\u003e G[Multi-format Loaders]\n    B --\u003e H[Chat Memory\u003cbr/\u003ePostgreSQL]\n    \n    style A fill:#61DAFB\n    style B fill:#009688\n    style C fill:#FF6B6B\n    style D fill:#336791\n    style E fill:#9C27B0\n```\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Python 3.8+\n- Node.js 16+\n- PostgreSQL 14+ with pgvector extension\n- OpenRouter API key (or other LLM provider)\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/CyprianFusi/advanced-rag-chat-app.git\ncd advanced-rag-chat-app\n```\n\n### 2. Backend Setup\n\n```bash\ncd backend\n\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n\n# Install dependencies\npip install -r requirements.txt\n\n# Set up environment variables\ncp .env.example .env\n# Edit .env with your database credentials and API keys\n```\n\n### 3. Database Setup\n\n```sql\n-- Connect to PostgreSQL and run:\nCREATE DATABASE rag_documents;\nCREATE DATABASE rag_memory;\n\n-- Enable pgvector extension\n\\c rag_documents;\nCREATE EXTENSION vector;\n\n\\c rag_memory;\nCREATE EXTENSION vector;\n```\n\n### 4. Frontend Setup\n\n```bash\ncd ../frontend\n\n# Install dependencies\nnpm install\n\n# Start development server\nnpm start\n```\n\n### 5. Start the Backend\n\n```bash\ncd ../backend\nuvicorn app.server:app --reload\n```\n\n### 6. Access the Application\n\n- Frontend: http://localhost:3000\n- Backend API: http://localhost:8000\n- API Documentation: http://localhost:8000/docs\n\n## 📋 Configuration\n\n### Environment Variables\n\nCreate a `.env` file in the backend directory:\n\n```env\n# Database Configuration\nPGVECTOR_CONNECTION_STRING=postgresql://user:password@localhost:5432/rag_documents\nPOSTGRES_MEMORY_URL=postgresql://user:password@localhost:5432/rag_memory\n\n# API Keys (choose your preferred provider)\nOPENROUTER_API_KEY=your_openrouter_api_key_here\nOPENAI_API_KEY=your_openai_api_key_here\nANTHROPIC_API_KEY=your_anthropic_api_key_here\n\n# Application Settings\nDOCUMENTS_DIRECTORY=./documents\nMAX_FILE_SIZE=52428800  # 50MB\nDEBUG=False\nLOG_LEVEL=INFO\n\n# CORS Settings\nCORS_ORIGINS=[\"http://localhost:3000\"]\n```\n\n### Supported File Formats\n\n- **Documents**: PDF, DOCX, DOC, TXT, RTF, ODT\n- **Data**: CSV, XLSX, XLS\n- **Web**: HTML, XML\n- **Other**: MD (Markdown), PPT, PPTX\n\n## 🔧 Usage\n\n### 1. Upload Documents\n- Click \"Choose Files\" to select your documents\n- Click \"Upload\" to store them on the server\n- Click \"Process\" to extract text and create embeddings\n\n### 2. Start Chatting\n- Type questions about your uploaded documents\n- Get intelligent, contextually-aware responses\n- Sources are automatically cited\n\n### 3. Advanced Features\n- **Conversation Context**: Ask follow-up questions using pronouns\n- **Multi-Document Queries**: Questions spanning multiple documents\n- **Session Management**: Your chat history persists across sessions\n\n## 🎯 Example Interactions\n\n```\n👤 User: \"What is this document about?\"\n🤖 Assistant: \"Based on the uploaded document 'annual_report.pdf', this appears to be a comprehensive annual report covering financial performance, operational highlights, and strategic initiatives for fiscal year 2023...\"\n\n👤 User: \"What were the key financial metrics?\"\n🤖 Assistant: \"From the annual report, the key financial metrics include:\n- Revenue: $2.4B (15% growth)\n- Net Income: $340M (22% growth)\n- EBITDA: $580M (18% growth)\nSources: annual_report.pdf\"\n```\n\n## 🏭 Production Deployment\n\n### Docker Deployment\n\n```bash\n# Build and run with Docker Compose\ndocker-compose up -d\n```\n\n### Manual Deployment\n\n1. **Database**: Set up PostgreSQL with pgvector\n2. **Backend**: Deploy FastAPI with gunicorn\n3. **Frontend**: Build and serve with nginx\n4. **Environment**: Configure production environment variables\n5. **Monitoring**: Set up logging and health checks\n\n### Environment-Specific Settings\n\n```python\n# Production settings in config.py\nDEBUG = False\nCORS_ORIGINS = [\"https://yourdomain.com\"]\nMAX_REQUESTS_PER_MINUTE = 100\nLOG_LEVEL = \"WARNING\"\n```\n\n## 📊 Performance\n\n- **Response Time**: \u003c 2 seconds for most queries\n- **Concurrent Users**: Supports 100+ simultaneous users\n- **Document Processing**: ~1MB per second\n- **Vector Search**: Sub-second retrieval from 10K+ documents\n\n\n## 🙏 Acknowledgments\n\n- **LangChain** - For the excellent RAG framework\n- **FastAPI** - For the high-performance web framework\n- **PostgreSQL \u0026 pgvector** - For robust vector storage\n- **React** - For the dynamic frontend experience\n- **OpenRouter** - For multi-provider LLM access\n\n## 📞 Support\n\n- **Documentation**: [docs/](docs/)\n- **Issues**: [GitHub Issues](https://github.com/yourusername/advanced-rag-chat-app/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/yourusername/advanced-rag-chat-app/discussions)\n- **Email**: cyprian.fusi@gmail.com\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**⭐ Star this repo if it helped you!**\n\nMade with ❤️ by [Cyprian Fusi](https://github.com/CyprianFusi)\n\n[🌟 Star](https://github.com/CyprianFusi/advanced-rag-chat-app/stargazers) • [🍴 Fork](https://github.com/CyprianFusi/advanced-rag-chat-app/fork) • [📋 Issues](https://github.com/CyprianFusi/advanced-rag-chat-app/issues) • [💬 Discussions](https://github.com/CyprianFusi/advanced-rag-chat-app/discussions)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyprianfusi%2Fadvanced-rag-chat-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyprianfusi%2Fadvanced-rag-chat-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyprianfusi%2Fadvanced-rag-chat-app/lists"}