{"id":25562638,"url":"https://github.com/mostafa-ghaith/agentic-rag-app","last_synced_at":"2026-07-02T11:34:30.015Z","repository":{"id":276158532,"uuid":"928408920","full_name":"mostafa-ghaith/agentic-rag-app","owner":"mostafa-ghaith","description":"A powerful chatbot application that uses Agentic RAG (Retrieval Augmented Generation) to intelligently answer questions about uploaded PDF documents. The system combines the power of LangChain, OpenAI's GPT models, and vector storage to provide accurate, context-aware responses.","archived":false,"fork":false,"pushed_at":"2025-02-06T18:01:26.000Z","size":496,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-24T17:41:21.331Z","etag":null,"topics":["chatbot","langchain","rag","retrieval-augmented-generation"],"latest_commit_sha":null,"homepage":"","language":"Python","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/mostafa-ghaith.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-02-06T15:37:23.000Z","updated_at":"2025-04-20T14:51:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"d15e16b3-a133-4583-bb16-54eb57feb218","html_url":"https://github.com/mostafa-ghaith/agentic-rag-app","commit_stats":null,"previous_names":["mostafa-ghaith/agentic-rag-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mostafa-ghaith/agentic-rag-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mostafa-ghaith%2Fagentic-rag-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mostafa-ghaith%2Fagentic-rag-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mostafa-ghaith%2Fagentic-rag-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mostafa-ghaith%2Fagentic-rag-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mostafa-ghaith","download_url":"https://codeload.github.com/mostafa-ghaith/agentic-rag-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mostafa-ghaith%2Fagentic-rag-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35045923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"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":["chatbot","langchain","rag","retrieval-augmented-generation"],"created_at":"2025-02-20T19:48:43.538Z","updated_at":"2026-07-02T11:34:30.009Z","avatar_url":"https://github.com/mostafa-ghaith.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agentic RAG PDF Chatbot\n\n\u003cdiv align=\"center\"\u003e\n\n![Chatbot Banner](docs/banner.png)\n\nA powerful chatbot application that uses Agentic RAG (Retrieval Augmented Generation) to intelligently answer questions about uploaded PDF documents. The system combines the power of LangChain, OpenAI's GPT models, and vector storage to provide accurate, context-aware responses.\n\n[Features](#features) • [Technology Stack](#technology-stack) • [API Documentation](#api-documentation) • [Setup](#setup--installation) • [Usage](#usage) • [Security](#security)\n\n\u003c/div\u003e\n\n## Features\n\n- 📄 PDF Document Upload \u0026 Processing\n- 💬 Interactive Chat Interface\n- 🔍 Intelligent Document Search using RAG\n- 🧠 Context-Aware Responses\n- 📊 Conversation History Management\n- 🎭 Customizable Assistant Personalities\n- 🔒 Secure Document Handling\n- 🚀 RESTful API Architecture\n\n## Technology Stack\n\n### Backend\n- FastAPI - Modern web framework for building APIs\n- LangChain - Framework for developing applications powered by language models\n- OpenAI GPT-4o - Advanced language model for generating responses\n- FAISS - Vector storage for efficient document retrieval\n- PyPDF - PDF document processing\n\n### Frontend\n- Streamlit - Interactive web interface\n- Python Requests - HTTP client for API communication\n\n## API Documentation\n\nThe backend provides a RESTful API with the following endpoints:\n\n### Conversation Management\n\n#### Create New Conversation\n```http\nPOST /conversations/new\n```\nCreates a new conversation session and returns a unique conversation ID.\n\n**Response:**\n```json\n{\n    \"conversation_id\": \"uuid-string\",\n    \"message\": \"New conversation created successfully\"\n}\n```\n\n#### Upload Documents\n```http\nPOST /conversations/{conversation_id}/upload\n```\nUpload PDF documents for processing in a specific conversation.\n\n**Parameters:**\n- `conversation_id` (path): UUID of the conversation\n- `files` (form-data): List of PDF files to upload\n\n**Response:**\n```json\n{\n    \"message\": \"Documents uploaded and processed successfully.\"\n}\n```\n\n#### Chat with Documents\n```http\nPOST /conversations/{conversation_id}/chat\n```\nSend a question and receive an AI-generated response based on the uploaded documents.\n\n**Request Body:**\n```json\n{\n    \"question\": \"Your question here\",\n    \"assistant_name\": \"AI Assistant\",\n    \"assistant_behavior\": \"Professional\",\n    \"custom_instructions\": \"\"\n}\n```\n\n**Response:**\n```json\n{\n    \"answer\": \"AI-generated response based on document context\"\n}\n```\n\n### Additional Endpoints\n\n- `GET /conversations` - List all conversations\n- `GET /conversations/{conversation_id}/history` - Get chat history\n- `GET /conversations/{conversation_id}/files` - List uploaded files\n- `GET /health` - API health check\n- `POST /conversations/{conversation_id}/load` - Load conversation documents\n\n## Setup \u0026 Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/mostafa-ghaith/agentic-rag-app.git\ncd agentic-rag-app\n```\n\n2. Set up environment variables:\nCreate a `.env` file in the root directory with the following variables:\n```env\nOPENAI_API_KEY=your_openai_api_key\n```\n\n3. Using Docker (Recommended):\n```bash\ndocker-compose up --build\n```\n\n4. Manual Setup:\n\nBackend:\n```bash\ncd backend\npip install -r requirements.txt\nuvicorn api.main:app --reload\n```\n\nFrontend:\n```bash\ncd frontend\npip install -r requirements.txt\nstreamlit run app.py\n```\n\n## Usage\n\n1. Access the web interface at `http://localhost:8501`\n2. Upload PDF documents using the sidebar and click on \"Process Documents\"\n3. Set the custom behaviour of the chatbot as wanted (Optional)\n4. Start chatting with the bot about your documents\n5. You can navigate to previous conversations and continue them from the sidebar\n\n\n\u003cdiv align=\"center\"\u003e\n\n### Chatbot Interface\n\n![Chatbot Interface Screenshot](docs/chatbot-ui-screenshot.png)\n*Interactive chat interface with document upload and customizable assistant behavior*\n\n\u003c/div\u003e\n\n## Development\n\nTo contribute to the project:\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Submit a pull request\n\n## Security\n\n- API keys and sensitive data are managed through environment variables\n- Document storage is temporary and session-based\n- Secure file handling and validation\n- Rate limiting on API endpoints\n- Input sanitization and validation\n- CORS policy implementation\n- Regular security updates and dependency scanning\n\n## License\n\nMIT License\n\nCopyright (c) 2025 Mostafa Ghaith\n\n\n## Contact\n\nMostafa Ghaith\\\nlinkedin.com/in/mostafa-ghaith\\\ngithub.com/mostafa-ghaith","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmostafa-ghaith%2Fagentic-rag-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmostafa-ghaith%2Fagentic-rag-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmostafa-ghaith%2Fagentic-rag-app/lists"}