osh-agentic-rag / README.md
Rofati's picture
Update ML Intern artifact metadata
94d8cd8 verified
|
Raw
History Blame Contribute Delete
1.13 kB
---
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")
```