File size: 1,573 Bytes
a1bdec0
33a15a9
a1bdec0
33a15a9
a1bdec0
33a15a9
a1bdec0
 
 
33a15a9
a1bdec0
33a15a9
a1bdec0
 
 
 
 
 
 
 
 
 
33a15a9
a1bdec0
33a15a9
a1bdec0
33a15a9
a1bdec0
33a15a9
a1bdec0
33a15a9
a1bdec0
33a15a9
a1bdec0
33a15a9
 
a1bdec0
33a15a9
a1bdec0
 
 
 
 
 
 
 
33a15a9
a1bdec0
33a15a9
a1bdec0
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 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.