File size: 3,375 Bytes
e6a90e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9ddbc7
e6a90e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9ddbc7
e6a90e9
 
 
 
 
b9ddbc7
 
 
 
 
 
 
 
e6a90e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b9ddbc7
e6a90e9
 
 
 
 
 
 
 
 
 
 
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
---
license: mit
title: 🧠 Multi-Agent AI Assistant
sdk: docker
emoji: πŸ’»
colorFrom: indigo
colorTo: indigo
pinned: true
---

# 🧠 Multi-Agent AI Assistant

This project is a **voice- and text-based AI assistant** powered by **FastAPI**, **LangGraph**, and **LangChain**. It supports:
- πŸ€– Multi-agent system
- πŸ—£οΈ Voice input via speech-to-text
- πŸŒ„ Image processing
- πŸ“‚ File processing
- 🌐 Web search, GitHub actions, weather, time, and geolocation tools
- 🧠 Memory-based conversation history per user
- πŸ“ Location-aware capabilities (e.g., timezone, weather)

---

## πŸš€ Features

- **FastAPI backend** with `/text`, `/image`, `/voice` and `/file` endpoints
- **LangGraph agents** with memory, tools, and typed state
- **User database** with persistent settings and config
- **Agents**:
  - Supervisor agent
  - Deep research agent
  - Coding agent
- **Supervisor tools**:
  - Web search
  - Current time
  - Weather
  - Yahoo finance news
- **Deep research tools**:
  - Web search
  - Wikipedia
  - Yahoo finance news
- **Coder tools**:
  - Github toolkit
  - Web search (For docs research)

---

## πŸ› οΈ Setup Instructions

### 1. Environment

This project requires no manual environment configuration β€” all secrets are passed dynamically with each request and stored in the database.

Just run:

```bash
docker build -t multi-agent-assistant .
docker run -p 7860:7860 multi-agent-assistant
```

The server will launch automatically at http://localhost:7860, with all dependencies installed and configured inside the container.

---

## πŸ“¦ API Reference

### `/text` – Send Text Prompt

```http
POST /text
Form data:
- state (str): JSON-encoded state dict
```

### `/voice` – Send Audio Prompt

```http
POST /voice
Form data:
- state (str): JSON-encoded state dict
- file (binary): Audio file (WAV, MP3, etc.)
```

### `/image` – Send Image Prompt

```http
POST /image
Form data:
- state (str): JSON-encoded state dict
- file (binary): Image file (JPEG, PNG, etc.)
```

### `/file` – Send File Prompt

```http
POST /file
Form data:
- state (str): JSON-encoded state dict
- file (binary): Image file (PDF, TXT, etc.)
```
---

## 🧩 Agent State Structure

The system operates using a JSON-based shared state object passed between agents.  
It follows a `TypedDict` schema and may contain keys such as:

```json
{
    message: AnyMessage (message to the agent)
    user_id: str (unique user id) 
    first_name: str
    last_name: str
    assistant_name: str
    latitude: str
    longitude: str
    location: str (user-readable location)
    openweathermap_api_key: str
    github_token: str
    tavily_api_key: str
    groq_api_key: str
    clear_history: bool (True/False)
    messages: list (Filled automatically from the database) 

}
```

This dictionary acts as a single mutable state shared across all agent steps, allowing for data accumulation, tool responses, and message tracking.

---

## 🧠 Built With

- [Groq](https://github.com/groq/groq-python)
- [LangGraph](https://github.com/langchain-ai/langgraph)
- [LangChain](https://github.com/langchain-ai/langchain)
- [FastAPI](https://fastapi.tiangolo.com/)
- [Whisper](https://github.com/openai/whisper)
- [SQLAlchemy + Async](https://docs.sqlalchemy.org/en/20/orm/extensions/asyncio.html)

---

## πŸ“ License

MIT β€” Feel free to use, modify, and contribute!