--- title: OSH Agentic RAG emoji: 🤖 colorFrom: purple colorTo: blue sdk: docker pinned: false tags: - ml-intern --- # 🤖 OSH Agentic RAG An **agentic** RAG system that uses tool-calling to answer legal questions about Kenyan OSH law. ## How it works Unlike traditional RAG (retrieve → generate), this agent **decides what to do**: 1. **Receives question** → analyzes what information is needed 2. **Calls tools** → `search_documents` or `search_specific_act` 3. **Reviews results** → decides if it has enough context 4. **Generates answer** → with citations to specific Acts/sections ## Architecture | Component | Role | Size | |-----------|------|------| | **Qwen3 1.7B** (Q4_K_M) | Agent brain with tool-calling | 1.1 GB | | **BGE-small-en-v1.5** | Semantic search embeddings | 130 MB | | **FAISS** | Vector similarity search | — | ## Speed Expected ~**10-20s per response** on free HF CPU (vs 75-90s for the non-agentic version). ## API ```python from gradio_client import Client client = Client("Rofati/osh-agentic-rag") result = client.predict("What are noise exposure limits?", api_name="/ask") ```