{"id":31667972,"url":"https://github.com/harshindcoder/rag_pipeline_panscience_innovations","last_synced_at":"2025-10-08T00:50:14.792Z","repository":{"id":318352438,"uuid":"1070578124","full_name":"harshindcoder/rag_pipeline_PanScience_Innovations","owner":"harshindcoder","description":"Built a document parsing and LLM query application that extracts and structures information from PDFs, enabling natural language queries on the content using a vector database and local LLMs.","archived":false,"fork":false,"pushed_at":"2025-10-06T16:59:05.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T18:37:06.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harshindcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-06T06:28:17.000Z","updated_at":"2025-10-06T16:59:08.000Z","dependencies_parsed_at":"2025-10-06T18:37:09.792Z","dependency_job_id":null,"html_url":"https://github.com/harshindcoder/rag_pipeline_PanScience_Innovations","commit_stats":null,"previous_names":["harshindcoder/rag_pipeline_panscience_innovations"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/harshindcoder/rag_pipeline_PanScience_Innovations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshindcoder%2Frag_pipeline_PanScience_Innovations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshindcoder%2Frag_pipeline_PanScience_Innovations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshindcoder%2Frag_pipeline_PanScience_Innovations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshindcoder%2Frag_pipeline_PanScience_Innovations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harshindcoder","download_url":"https://codeload.github.com/harshindcoder/rag_pipeline_PanScience_Innovations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshindcoder%2Frag_pipeline_PanScience_Innovations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278872154,"owners_count":26060525,"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-10-07T02:00:06.786Z","response_time":59,"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":[],"created_at":"2025-10-08T00:50:10.469Z","updated_at":"2025-10-08T00:50:14.786Z","avatar_url":"https://github.com/harshindcoder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rag_pipeline_PanScience_Innovations\n\nBuilt a document parsing and LLM query application that extracts and structures information from PDFs, enabling natural language queries on the content using a vector database and local LLMs.\n\n![Data Pipeline Diagrma](images/RAG_PIPELINE.png)\n\n**Note:** To function properly, this pipeline requires a running **Mistral model on Ollama**, which serves as the local LLM backend for generating responses.\n\n---\n\n## Features\n\n- Parse PDF documents and extract structured information.\n- Store and query data using a vector database.\n- Query PDFs using natural language via a local LLM (Mistral on Ollama).\n- Fully containerized using Docker for easy setup.\n- Works on **Windows** and **Mac**. For **Linux**, future modifications may be required.\n\n---\n\n## Prerequisites\n\n- Docker installed on your system ([Docker Desktop](https://www.docker.com/products/docker-desktop)).\n- Docker Compose installed (usually included with Docker Desktop).\n- Ollama installed and the Mistral model running locally.\n- (Optional) Git, if you want to clone the repository.\n\n---\n\n## Setup Instructions\n\n### 1. Pull the Docker Images\n\nThe Docker Compose file will pull both the application and MongoDB images automatically. If you want to pull manually:\n\n```bash\ndocker pull ghcr.io/harshindcoder/rag-pipeline-panscience-innovations:latest\ndocker pull mongo:latest\n````\n\n---\n\n### 2. Run the Services via Docker Compose\n\nCreate a file named `docker-compose.yml` (or use the one provided) with the following content:\n\n```yaml\nversion: \"3.9\"\n\nservices:\n  app:\n    image: ghcr.io/harshindcoder/rag-pipeline-panscience-innovations:latest\n    container_name: rrag_app\n    ports:\n      - \"8000:8000\"\n    depends_on:\n      - mongo\n\n  mongo:\n    image: mongo:latest\n    container_name: rrag_mongo\n    ports:\n      - \"27017:27017\"\n```\n\nThen, in the terminal, run:\n\n```bash\ndocker-compose up\n```\n\n* To run in the background (detached mode):\n\n```bash\ndocker-compose up -d\n```\n\n* To view logs:\n\n```bash\ndocker-compose logs -f\n```\n\n* To stop all services:\n\n```bash\ndocker-compose down\n```\n\n---\n\n### 3. Start Ollama with Mistral\n\nOpen another terminal and run:\n\n```bash\nollama run mistral\n```\n\n* The container expects to connect to Ollama at `http://localhost:11434`.\n* Mistral must be running while using the API.\n\n---\n\n### 4. Upload a PDF\n\nOpen a **new terminal** and run:\n\n```bash\ncurl -X POST -F \"file=@/path/to/your/document.pdf\" http://localhost:8000/upload\n```\n\n* Replace `/path/to/your/document.pdf` with the actual path of your PDF.\n* This uploads the PDF to the pipeline for parsing and vectorization.\n\n---\n\n### 5. Ask Questions\n\nOnce the file is uploaded, in the same terminal (or a new one), run:\n\n```bash\ncurl -X POST -F \"question=What is this file about?\" http://localhost:8000/ask\n```\n\n* The pipeline will query the parsed document via Mistral on Ollama and return the answer.\n\n---\n\nHere’s the 6th point refined for your README:\n\n---\n\n### 6. Quick Manual Checks\n\nFor now, you can verify that everything is running with simple commands:\n\n* **Check Docker containers:**\n\n```bash\ndocker ps\n```\n\n* **Check FastAPI is responding:**\n\n```bash\ncurl -X GET http://localhost:8000/docs\n```\n\n* **Parser and VectorDB** are verified via pytest:\n\n```bash\npytest -v tests/\n```\nTests are available in the repo but are not included in the production Docker image. Run them locally using pytest.\n\n---\n\n## Notes\n\n* **Terminals:** You need at least **two terminals**: one for Docker Compose (FastAPI + MongoDB), one for Ollama. The `curl` commands can run in the same terminal or separate ones.\n* **File paths:** Replace `/path/to/your/document.pdf` with your PDF location.\n* **Ports:** FastAPI runs on `8000` and MongoDB on `27017`. Adjust the `ports` in `docker-compose.yml` if needed.\n\n---\n\n## Future Improvements\n\n* Add Linux compatibility.\n* Multi-user support for larger document processing.\n* Better error handling for missing Mistral/Ollama connections.\n\n---\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshindcoder%2Frag_pipeline_panscience_innovations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharshindcoder%2Frag_pipeline_panscience_innovations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshindcoder%2Frag_pipeline_panscience_innovations/lists"}