{"id":26229692,"url":"https://github.com/shantoroy/rag-chatbot-python-fullstack-template","last_synced_at":"2026-04-21T12:35:09.540Z","repository":{"id":279328291,"uuid":"935124159","full_name":"shantoroy/rag-chatbot-python-fullstack-template","owner":"shantoroy","description":"A Retrieval-Augmented Generation (RAG) based question-answering proof-of-concept (PoC) that enables users to query documents using natural language. This system leverages local LLMs via Ollama for enhanced privacy and performance and features a chat-based interface. Built entirely with Python, including both backend an frontend.","archived":false,"fork":false,"pushed_at":"2025-03-03T23:56:46.000Z","size":157,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-26T23:55:56.446Z","etag":null,"topics":["chainlit","chatbot","docker-compose","fastapi","kubernetes","langchain","ollama","python","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/shantoroy.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-19T00:08:31.000Z","updated_at":"2025-11-19T20:47:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"91149115-9f85-48d3-9c9f-1c40851fc9fb","html_url":"https://github.com/shantoroy/rag-chatbot-python-fullstack-template","commit_stats":null,"previous_names":["shantoroy/rag-chatbot-python-fullstack-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shantoroy/rag-chatbot-python-fullstack-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shantoroy%2Frag-chatbot-python-fullstack-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shantoroy%2Frag-chatbot-python-fullstack-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shantoroy%2Frag-chatbot-python-fullstack-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shantoroy%2Frag-chatbot-python-fullstack-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shantoroy","download_url":"https://codeload.github.com/shantoroy/rag-chatbot-python-fullstack-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shantoroy%2Frag-chatbot-python-fullstack-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32092031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["chainlit","chatbot","docker-compose","fastapi","kubernetes","langchain","ollama","python","retrieval-augmented-generation"],"created_at":"2025-03-12T22:17:30.639Z","updated_at":"2026-04-21T12:35:09.532Z","avatar_url":"https://github.com/shantoroy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RAG Chatbot (Python Fullstack template)\n\nA RAG (Retrieval Augmented Generation) based question-answering prrof-of-concept (PoC) system that allows a user to query target documents using natural language. The system uses local LLMs through Ollama for privacy and performance and provides a chat interface for easy interaction. The entire codebase (both backend and frontend are developed using Python3.10).\n\n## 🌟 Features\n\n* Local LLM Integration: Uses Ollama for running models locally, ensuring data privacy\n* Vector Search: Efficient document retrieval using FAISS\n* Modern Chat Interface: Built with Chainlit for a smooth user experience\n* Containerized Services: Easy deployment with Docker Compose\n* Async Processing: Built with FastAPI for high performance\n\n## 🔧 System Architecture\n```\n        \nUser ───────────────▶ Chainlit UI       Documents (txt/md/pdf)\n                           │                     │\n                           │                     │\n                    Query  │                     │ Retrieve\n                           │                     │ Documents\n                           ▼                     ▼\n                       FastAPI ◄───────────  RAG Model ◄─────── Local Ollama\n                       Backend                   │\n                           │                     │\n                           └─────────────────────┘\n                                Return Answer\n```\n\n## 🚀 Getting Started\n### Prerequisites\n\n* Docker\n    * **Linux**: Follow the official Docker documentation for your distribution.\n    * **Windows**: Download and install Docker Desktop for Windows.\n    * **MacOS**: Download and install Docker Desktop for MacOS.\n* Docker Compose\n* Ollama (for local model running)\n* Python 3.10+\n\n\n### Set-up\n#### Install Ollama\n* Install Ollama locally (for **Mac**): \n  ```bash\n  brew install ollama\n  brew services start ollama\n  ```\n\n* Install Ollama locally (for **Linux**): \n  ```bash\n  curl -fsSL https://ollama.com/install.sh | sh\n  ```\n\n* Install Ollama locally (for **Windows**): \nDownload and install Ollama from the official Ollama website.\n\n#### Next Steps\n* Download required models: \n  ```bash\n  ollama run mistral\n  ollama run nomic-embed-text\n  ```\n\n* Clone the repository:\n  ```bash\n  git clone https://github.com/shantoroy/rag-chatbot-python-fullstack-template.git\n  cd rag-chatbot-python-fullstack-template\n  ```\n\n* Configure .env file (check details at the **Configuration** section below)\n\n* Start the services:\n  ```bash\n  docker-compose build\n  docker-compose up -d\n  ```\n\n* Stop the services:\n  ```bash\n  docker-compose down\n  ```\n\n### Usage\n\n* Access the chat interface at http://localhost:8505\n* Keep your files under the documents directory\n* Start asking questions about your documents!\n\n## 🏗️ Project Structure\n```\nrag-chatbot-python-fullstack-template/\n├── backend/\n│   ├── model.py          # RAG model implementation\n│   └── api.py            # FastAPI backend\n├── frontend/\n│   └── app.py            # Chainlit chat interface\n├── docker/\n│   ├── backend.Dockerfile\n│   └── frontend.Dockerfile\n├── requirements/\n│   ├── backend_requirements.txt\n│   └── frontend_requirements.txt\n├── documents/            # Put/organize your documents here\n│   ├── test_file_1.txt \n│   └── test_file_2.md\n├── .env.example          # Example file, rename to .env\n├── .gitignore\n├── docker-compose.yml    # Service orchestration\n├── requirements.txt      # Python dependencies as a whole (not needed)\n├── chainlit.md          # Chainlit configuration\n└── README.md\n```\n\n## System Diagram\n![System Diagram](./miscellaneous/media/chatbot.drawio.png)\n\n## 🔒 Security\n\n* All processing is done locally through Ollama\n* No data leaves your infrastructure\n* Authentication can be added as needed\n\n\n## 🛠️ Configuration\n* Don't forget to rename the .env.example file to .env\n* Also add your own secret key.\n\n#### Environment variables (.env):\n* OLLAMA_URL=http://localhost:11434\n* CHAINLIT_AUTH_SECRET=your-secret-key\n\n#### Notes\nTo generate a CHAINLIT_AUTH_SECRET for your .env file, you can use the following command:\n```bash\nopenssl rand -hex 32\n```\n\nThis command uses OpenSSL to generate a secure random 32-byte hexadecimal string, which is suitable for use as an authentication secret. After running this command, you'll get a string that looks something like:\n```\n3d7c4e608f6df9a0e3e3ded3f1c3f384b9b3a9f9e5c1a0e2b4a8d1e0f2c3b4a7\n```\n\nYou would then add this to your .env file:\n```\nCHAINLIT_AUTH_SECRET=3d7c4e608f6df9a0e3e3ded3f1c3f384b9b3a9f9e5c1a0e2b4a8d1e0f2c3b4a7\n```\n\nFor Kubernetes, you'll need to encode this value as base64 before adding it to your secrets.yaml file:\n```bash\necho -n \"3d7c4e608f6df9a0e3e3ded3f1c3f384b9b3a9f9e5c1a0e2b4a8d1e0f2c3b4a7\" | base64\n```\nThen use the resulting base64 string in your Kubernetes secrets configuration.\n\n\n## Kubernetes Deployment\nAdded sample kubernetes config files under `kubernetes-template` folder. \nYou need to modify values before production usage.\nRead the [Deployment Steps](kubernetes-template/README-kubernetes.md) guide for details.\n\n\n## 🤝 Contributing\n\n* Fork the repository\n* Create your feature branch (git checkout -b feature/amazing-feature)\n* Commit your changes (git commit -m 'Add amazing feature')\n* Push to the branch (git push origin feature/amazing-feature)\n* Open a Pull Request\n\n## 📝 License\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n\n## 🙏 Acknowledgments\n\n* Ollama for local LLM support\n* LangChain for RAG implementation\n* Chainlit for the chat interface\n* FastAPI for the backend framework","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshantoroy%2Frag-chatbot-python-fullstack-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshantoroy%2Frag-chatbot-python-fullstack-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshantoroy%2Frag-chatbot-python-fullstack-template/lists"}