{"id":30389284,"url":"https://github.com/aimaster-dev/smartrag","last_synced_at":"2026-04-09T17:32:05.189Z","repository":{"id":296409421,"uuid":"993161034","full_name":"aimaster-dev/SmartRAG","owner":"aimaster-dev","description":"SmartRAG is a terminal-based RAG system using LangGraph. It processes queries by retrieving relevant content from markdown or PDFs, then responds using OpenAI GPT. Supports webpage-to-PDF conversion, vector DB search, and modular flow control.","archived":false,"fork":false,"pushed_at":"2025-06-17T11:58:24.000Z","size":54360,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-20T09:08:56.304Z","etag":null,"topics":["ai","automation","chatbot","cli","document-search","gpt","knowledge-base","langchain","langgraph","markdown","nlp","openai","pdf","python","query","rag","retrieval","terminal","vector-database","web-scraping"],"latest_commit_sha":null,"homepage":"","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/aimaster-dev.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}},"created_at":"2025-05-30T10:14:54.000Z","updated_at":"2025-10-19T10:20:51.000Z","dependencies_parsed_at":"2025-05-30T20:06:20.460Z","dependency_job_id":"2973223b-63fe-478a-a2d3-b7a11fac27c7","html_url":"https://github.com/aimaster-dev/SmartRAG","commit_stats":null,"previous_names":["aimaster-dev/smartrag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aimaster-dev/SmartRAG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimaster-dev%2FSmartRAG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimaster-dev%2FSmartRAG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimaster-dev%2FSmartRAG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimaster-dev%2FSmartRAG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aimaster-dev","download_url":"https://codeload.github.com/aimaster-dev/SmartRAG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aimaster-dev%2FSmartRAG/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28132549,"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-12-30T02:00:05.476Z","response_time":64,"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":["ai","automation","chatbot","cli","document-search","gpt","knowledge-base","langchain","langgraph","markdown","nlp","openai","pdf","python","query","rag","retrieval","terminal","vector-database","web-scraping"],"created_at":"2025-08-21T08:18:58.199Z","updated_at":"2025-12-30T21:06:04.749Z","avatar_url":"https://github.com/aimaster-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 SmartRAG\n\n**SmartRAG** is a terminal-based Retrieval-Augmented Generation (RAG) system built using [LangGraph](https://github.com/langchain-ai/langgraph). It routes user queries through a custom flow that includes message history, query transformation, and document retrieval from a vector store.\n\n\u003e 🔗 GitHub: [https://github.com/aimaster-dev/SmartRAG](https://github.com/aimaster-dev/SmartRAG)\n\n---\n\n## 🧠 Features\n\n* LangGraph-powered RAG pipeline\n* Smart routing of user queries\n* PDF and Markdown ingestion support\n* Optional webpage-to-PDF and PDF-to-Markdown conversion\n* OpenAI GPT integration for natural language responses\n\n---\n\n## 🗂️ Project Structure\n\n```\nSmartRAG/\n├── architecture/         # LangGraph RAG workflow logic\n├── data/                 # Processed markdown or PDF content\n├── modules/              # Core logic for query handling \u0026 doc processing\n├── main.py               # Entry point\n└── processDocs.py        # Document preprocessing script\n```\n\n---\n\n## ⚙️ Setup\n\nFollow the steps below to get SmartRAG up and running:\n\n### 1. Clone the Repo\n\n```bash\ngit clone https://github.com/aimaster-dev/SmartRAG.git\ncd SmartRAG\n```\n\n### 2. Create Virtual Environment\n\n```bash\npython3.12 -m venv venv\nsource venv/bin/activate  # Windows: venv\\Scripts\\activate\n```\n\n### 3. Install Dependencies\n\n```bash\npip install -r requirements.txt\nchoco install wkhtmltopdf  # for HTML to PDF conversion (Windows only)\n```\n\n### 4. Environment Setup\n\nCopy and edit the `.env` file:\n\n```bash\ncp .env.example .env\n```\n\nEdit `.env` to include:\n\n```env\nOPENAI_API_KEY=your_openai_key\nURLS=url1,url2         # Optional: URLs to fetch as PDF\nGET_WEB_PAGES_TO_PDF=True\nCONVERT_PDF_TO_MD=True\nINTERMEDIATE_PDF_DIR=./pdfs\nDATA_DIR=./data\n```\n\n### 5. Process Your Documents\n\n```bash\npython modules/processDocs.py\n```\n\n\u003e ⚠️ Make sure to update `.env` parameters based on your use case.\n\n### 6. Run SmartRAG\n\n```bash\npython main.py\n```\n\n---\n\n## 🔍 How It Works\n\n1. **User query** is passed into a LangGraph workflow.\n2. **Message history** is cached and contextually enriched.\n3. If needed, input is transformed for better retrieval.\n4. Documents are pulled from a **vector store** using similarity search.\n5. GPT model generates a context-aware answer.\n\n---\n\n## 🖼️ Architecture Overview\n\n### 📄 Vector Store Creation\n\n![Vector DB](https://github.com/aimaster-dev/SmartRAG/blob/main/architecture/RAG.png)\n\n### 🧠 RAG Pipeline\n\n![RAG Flow](https://github.com/aimaster-dev/SmartRAG/blob/main/architecture/RAG.png)\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions!\n\n* Fork the repo\n* Create a feature branch\n* Submit a pull request\n\n\u003e Got a big idea? Open an issue to discuss it first.\n\n---\n\n## 📬 Contact\n\nFor questions, feedback, or collaboration ideas — feel free to open an issue or reach out through GitHub!\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimaster-dev%2Fsmartrag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faimaster-dev%2Fsmartrag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faimaster-dev%2Fsmartrag/lists"}