{"id":30496945,"url":"https://github.com/en-atul/ask-docs","last_synced_at":"2026-04-13T04:44:15.917Z","repository":{"id":311470958,"uuid":"1043378262","full_name":"en-atul/ask-docs","owner":"en-atul","description":"A Retrieval-Augmented Generation (RAG) app that lets you query your documents (PDF, TXT, MD, etc.) using LangChain, Chroma, and OpenAI API.","archived":false,"fork":false,"pushed_at":"2025-08-24T21:09:15.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-24T21:10:58.647Z","etag":null,"topics":["chromadb","docker-compose","fastapi","langchain","nextjs","openai-api","python","rag"],"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/en-atul.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-23T18:15:36.000Z","updated_at":"2025-08-24T21:09:18.000Z","dependencies_parsed_at":"2025-08-24T21:21:34.021Z","dependency_job_id":null,"html_url":"https://github.com/en-atul/ask-docs","commit_stats":null,"previous_names":["en-atul/ask-docs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/en-atul/ask-docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en-atul%2Fask-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en-atul%2Fask-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en-atul%2Fask-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en-atul%2Fask-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/en-atul","download_url":"https://codeload.github.com/en-atul/ask-docs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/en-atul%2Fask-docs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271999954,"owners_count":24856186,"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":["chromadb","docker-compose","fastapi","langchain","nextjs","openai-api","python","rag"],"created_at":"2025-08-25T02:37:54.262Z","updated_at":"2026-04-13T04:44:10.874Z","avatar_url":"https://github.com/en-atul.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RAG with FastAPI \u0026 LangChain\n\nA modern document Q\u0026A system built with FastAPI, LangChain, and Next.js that allows users to upload documents and ask questions about their content using Retrieval-Augmented Generation (RAG).\n\n## 🚀 Features\n\n- **Document Upload**: Support for PDF and TXT files\n- **Smart Search**: Document-specific search with global fallback capabilities\n- **Real-time Streaming**: Server-Sent Events for live query responses\n- **Contextual Compression**: Automatic result sanitization and deduplication\n- **Modern UI**: Beautiful, responsive interface built with Next.js and Tailwind CSS\n- **Vector Database**: ChromaDB for efficient document storage and retrieval\n- **OpenAI Integration**: Human-readable answer formatting\n\n## 📸 Screenshots\n\n![Application Screenshot](assets/photo.png)\n\n## 🎥 Demo Video\n\n[Watch Demo](assets/recording.mov)\n\n## 🏗️ Architecture\n\n- **Backend**: FastAPI with LangChain for RAG implementation\n- **Frontend**: Next.js 15 with TypeScript and Tailwind CSS\n- **Vector Database**: ChromaDB for document embeddings\n- **AI Provider**: OpenAI for text generation and embeddings\n\n## 📋 Prerequisites\n\n- Python 3.8+\n- Node.js 18+\n- Docker and Docker Compose\n- OpenAI API key\n\n## 🛠️ Installation \u0026 Setup\n\n### 1. Clone the Repository\n\n```bash\ngit clone \u003cyour-repo-url\u003e\ncd ask-docs\n```\n\n### 2. Start ChromaDB\n\nFirst, start the ChromaDB vector database using Docker:\n\n```bash\ncd server\ndocker-compose up -d\n```\n\nThis will start ChromaDB on port 8001.\n\n### 3. Set Up the Backend\n\n```bash\ncd server\npip install -r requirements.txt\n```\n\nCreate a `.env` file in the server directory:\n\n```bash\nOPENAI_API_KEY=your_openai_api_key_here\n```\n\n### 4. Set Up the Frontend\n\n```bash\ncd client\nnpm install\n```\n\n## 🚀 Running the Application\n\n### 1. Start the Server\n\n```bash\ncd server\npython main.py\n```\n\nThe FastAPI server will start on `http://localhost:8000`\n\n### 2. Start the Client\n\n```bash\ncd client\nnpm run dev\n```\n\nThe Next.js application will start on `http://localhost:3000`\n\n## 🔧 API Endpoints\n\n- `POST /api/documents/upload` - Upload a document\n- `POST /api/documents/query` - Query documents\n- `POST /api/documents/query/stream` - Stream query responses\n- `GET /api/documents/stats` - Get document statistics\n- `GET /api/documents/health` - Health check\n- `GET /docs` - API documentation (Swagger UI)\n\n## 🏃‍♂️ Quick Start\n\n1. **Start ChromaDB**: `docker-compose up -d`\n2. **Start Server**: `python main.py` (from server directory)\n3. **Start Client**: `npm run dev` (from client directory)\n4. **Open Browser**: Navigate to `http://localhost:3000`\n5. **Upload Document**: Click the upload button and select a PDF or TXT file\n6. **Ask Questions**: Start asking questions about your uploaded document!\n\n## 🛠️ Development\n\n### Backend Development\n\nThe backend is built with FastAPI and includes:\n- Document processing with LangChain\n- Vector embeddings with OpenAI\n- ChromaDB integration for document storage\n- Streaming responses with Server-Sent Events\n\n### Frontend Development\n\nThe frontend is built with Next.js 15 and includes:\n- Modern React with TypeScript\n- Tailwind CSS for styling\n- Real-time chat interface\n- File upload functionality\n- Responsive design\n\n## 📁 Project Structure\n\n```\nask-docs/\n├── client/                 # Next.js frontend\n│   ├── src/app/           # App router components\n│   ├── public/            # Static assets\n│   └── package.json       # Frontend dependencies\n├── server/                # FastAPI backend\n│   ├── controller/        # API controllers\n│   ├── service/           # Business logic\n│   ├── config/            # Configuration files\n│   ├── main.py           # FastAPI application\n│   └── requirements.txt   # Python dependencies\n├── assets/               # Media files\n│   ├── photo.png         # Screenshot\n│   └── recording.mov     # Demo video\n└── README.md             # This file\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## 📄 License\n\nThis project is created for **learning purposes** and is open source. Feel free to use, modify, and learn from this code for educational purposes.\n\n**Note**: This is a learning project demonstrating RAG (Retrieval-Augmented Generation) implementation with FastAPI, LangChain, and Next.js. The code is provided as-is for educational use.\n\n## 🙏 Acknowledgments\n\n- [LangChain](https://langchain.com/) for RAG implementation\n- [FastAPI](https://fastapi.tiangolo.com/) for the backend framework\n- [Next.js](https://nextjs.org/) for the frontend framework\n- [ChromaDB](https://www.trychroma.com/) for vector storage\n- [OpenAI](https://openai.com/) for AI capabilities\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fen-atul%2Fask-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fen-atul%2Fask-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fen-atul%2Fask-docs/lists"}