🚀 A modular, production-grade Retrieval-Augmented Generation (RAG) system with PDF & GitHub ingestion, FAISS vector search, and local LLM inference through Ollama — designed for real-world, offline AI pipelines.
RAG Corp is a corporate-style RAG pipeline designed to answer questions from PDF documents and GitHub repositories using local LLMs.
It’s built for offline, secure, and configurable deployments, with robust logging, modular architecture, and full error handling.
- PDF Loader – Extracts text from uploaded PDFs
- GitHub Repo Loader – Clones repos and indexes documentation/code
- Configurable via YAML – Control chunk size, model name, retriever depth, etc.
- Fast, memory-efficient similarity search
- Persistent offline index in
data/index/faiss/ - Incremental updates supported
- Ollama-powered models (
llama3.2:1b,tinyllama:1.1b,deepseek-coder:6.7b) - Embeddings:
nomic-embed-textor fallback tobge-m3 - Fully offline pipeline — no API calls or cloud dependency
- Centralized logging with
logging_conf.py - Error-handled RAG core (graceful model or data fallback)
- Modular structure for easy extension (Chroma, Weaviate, etc.)
- Auto-discovery of configuration paths
- Clean, responsive dashboard
- Upload PDFs or Git repos directly
- Real-time logs: document count, index progress, error reports
- Query chat interface for retrieval-based QA
Rag_application/ ├── app/ │ ├── api/ # (Optional) REST endpoints (FastAPI-ready) │ ├── configs/ # YAML configs │ ├── rag-corp/ │ │ ├── rag_core/ │ │ │ ├── embeddings/ # Ollama + HF embedding providers │ │ │ ├── llm/ # Local LLM interface (Ollama) │ │ │ ├── loaders/ # GitHub + PDF data ingestion │ │ │ ├── vectorstores/ # FAISS integration │ │ │ ├── config.py # Auto-path + .env aware settings loader │ │ │ ├── logging_conf.py # Central logging system │ │ │ ├── rag_service.py # RAG logic orchestration │ │ │ └── utils.py # Helpers / validation │ └── ui/ # Streamlit front-end ├── configs/settings.yaml # Global configuration ├── data/ # Local index storage ├── requirements.txt ├── Dockerfile ├── docker-compose.yaml ├── Makefile ├── pyproject.toml └── .env.example
| Layer | Technology | Purpose |
|---|---|---|
| UI | Streamlit | Web-based dashboard |
| Core Framework | LangChain | RAG orchestration |
| LLM | Ollama | Local inference engine |
| Vector Database | FAISS | Embedding similarity search |
| Config | YAML + dotenv | Dynamic environment setup |
| Deployment | Docker + Compose | Reproducible environments |
- Upload PDF / GitHub URL
- Text Chunking & Embedding
- Split into overlapping chunks
- Generate embeddings (Ollama / HF)
- Vector Indexing
- Stored in FAISS index for fast retrieval
- User Query → Retrieval + LLM Answer
- Relevant chunks retrieved
- LLM synthesizes answer with context
All runtime settings are stored in configs/settings.yaml:
`yaml env: dev data_dir: data index_dir: data/index/faiss chunk_size: 1000 chunk_overlap: 200 retriever_k: 4 embed_model: bge-m3 llm_model: llama3.2:1b git: branch: main include_exts: [".py", ".md", ".txt"] exclude_dirs: ["pycache", "tests"]
export CONFIG_PATH=./configs/settings.yaml
git clone https://github.com//Rag_application.git cd Rag_application
ollama serve
ollama pull llama3.2:1b ollama pull tinyllama:1.1b ollama pull deepseek-coder:6.7b-instruct ollama pull nomic-embed-text