# JanSahayak Development & Setup This guide provides instructions for developers to set up the JanSahayak MAS environment and run the system locally. ## Prerequisite Tools 1. **Python 3.10+**: Core language. 2. **Ollama**: For local LLM (defaults to `smollm2:1.7b`). 3. **Arize Phoenix**: For local observability (installed via `arize-phoenix`). ## Setup Instructions 1. Clone the repository and enter the directory. 2. Install dependencies: `pip install -r requirements.txt`. 3. Set up environment variables in `.env`: ```env GOOGLE_API_KEY=your_key LLAMA_CLOUD_API_KEY=your_key TELEGRAM_BOT_TOKEN=your_token OLLAMA_MODEL=smollm2:1.7b ``` 4. Initialize the vector database: `python src/tools/rag.py`. ## Running the System ### 1. Flask Web Interface ```bash python src/app.py ``` *Port: 5001* ### 2. Telegram Bot ```bash python src/telegram_bot.py ``` ## Local Observability (Arize Phoenix) To view real-time traces: 1. Both `app.py` and `telegram_bot.py` automatically launch the Phoenix server. 2. Open your browser and navigate to: `http://localhost:6006`. 3. Here you can see: - Detailed agent hand-offs. - Tool execution latency. - Guardrail triggers (Input/Output). - RAG context snippets used by each agent. ## Project Structure - `src/graph.py`: Main LangGraph MAS workflow. - `src/agents/`: Specialized agent subgraphs. - `src/tools/`: Custom citizen advocacy tools. - `src/utils/validators.py`: Custom Guardrails AI validators. - `src/core/observability.py`: Tracing configuration.