File size: 5,180 Bytes
8c8945a
 
 
 
 
 
 
 
572acf4
8c8945a
db219a4
 
8c8945a
 
db219a4
 
 
 
 
 
572acf4
 
 
 
 
 
db219a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
---
title: Expensynth
emoji: 🌖
colorFrom: pink
colorTo: green
sdk: gradio
sdk_version: 5.33.0
app_file: app.py
pinned: true
short_description: Application for tracking personal spending habits
tags:
    - agent-demo-track
---

# GreenSmokeLabs-Expensynth

## Overview

GreenSmokeLabs-Expensynth is an AI-powered financial management platform designed to transform the way users track, analyze, and understand their expenses. By leveraging artificial intelligence and natural language processing, the system automatically categorizes transactions, provides financial insights, and offers an intelligent assistant for financial queries.

## Video Link

Watch our project demonstration:

[![Expensynth Demo](https://img.youtube.com/vi/D9ebiTkRXZQ)](https://youtu.be/D9ebiTkRXZQ)

## System Architecture

The application is built on a robust three-tier architecture:

![alt text](image.png)

### Database Schema

![alt text](image-1.png)

## Key Components

### Backend

The backend is built with FastAPI and provides the following key services:

1. **Transaction Parsing Service**: Uses CrewAI to analyze and categorize financial transactions.
2. **User RAG Service**: Provides question-answering capabilities through Retrieval Augmented Generation.
3. **Database Layer**: PostgreSQL for structured data and Vector DB for embeddings.
4. **API Endpoints**: RESTful endpoints for all system functionalities.

### Frontend

The frontend is a Gradio-based web application with the following features:

1. **Financial Dashboard**: Shows key financial metrics and summaries.
2. **Interactive Charts**: Visualizes financial data through various charts and graphs.
3. **AI Assistant**: Chat interface for natural language queries about financial data.

### Mobile App

A mobile application will provide:

1. Transaction Message Categorization
2. Transaction Message Syncing
3. Mobile dashboard access

## Installation & Setup


### Prerequisites

- Python 3.10-3.12
- PostgreSQL
- Node.js (for optional frontend development)


### Backend Setup


1. Clone the repository:
   
```bash
   git clone https://github.com/yourusername/GreenSmokeLabs-Expensynth.git
   cd GreenSmokeLabs-Expensynth
   ```

2. Set up a Python virtual environment:
   
```bash
   python -m venv .venv
   source .venv/bin/activate  # On Windows: .venv\Scripts\activate
   ```

3. Install backend dependencies:
   
```bash
   cd backend
   pip install -e .
   ```

4. Configure environment variables:
   
```bash
   cp .env.example .env
   # Edit .env with your configuration
   ```

5. Run database migrations:
   
```bash
   alembic upgrade head
   ```

6. Start the backend server:
   
```bash
   uvicorn green_smoke_labs_expensynth.main:app --reload
   ```


### Frontend Setup


1. Install frontend dependencies:
   
```bash
   cd frontend
   pip install -r requirements.txt
   ```

2. Start the frontend server:
   
```bash
   python server.py
   ```


## Usage Guide


### Transaction Processing


1. Submit transaction messages through the API:
   
```bash
   curl -X POST http://localhost:8000/transaction-parsing/parse-transaction \
     -H "Content-Type: application/json" \
     -d '{"transaction_message": "You spent $75.40 at Whole Foods Market on June 10th, 2025"}'
   ```


2. The system will automatically:
   - Parse the transaction details
   - Categorize the transaction
   - Store it in the database
   - Update the vector embeddings for search


### Financial Dashboard

Access the dashboard at [http://localhost:7860](http://localhost:7860) to:

- View financial summaries
- Explore interactive charts
- Analyze spending patterns
- Query your financial data using natural language


### AI Assistant

Use the chatbot interface to ask questions such as:

- "What were my biggest expenses last month?"
- "How has my spending on groceries changed over time?"
- "What is my current balance?"


## API Documentation


### Transaction Parsing API

- `POST /transaction-parsing/parse-transaction`: Parse and process a new transaction
- `GET /transaction-parsing/transactions`: Get all transactions


### User Query API
- `POST /bot/query`: Submit a natural language query about financial data


### Health Check API
- `GET /health`: Check system health status


## Technologies Used


- **Backend**:
  - FastAPI
  - SQLAlchemy
  - CrewAI
  - Modal (serverless deployment)
  - Alembic (migrations)
  - Pydantic
  - PostgreSQL

- **Frontend**:
  - Gradio
  - Plotly
  - Pandas

- **AI & Machine Learning**:
  - Vector Embeddings
  - LLM APIs
  - CrewAI Agents
  - Retrieval Augmented Generation


## Future Roadmap


1. Mobile Application Development
2. Banking API Integrations
3. Advanced Financial Planning Features
4. Multi-currency Support
5. Budget Management
6. Export to Accounting Software


## Contributors


- Shrijeeth S ([[email protected]](mailto:[email protected]))
- Sethuram SV ([[email protected]](mailto:[email protected]))
- Shankar Mahadevan ([[email protected]](mailto:[email protected]))


## License

This project is proprietary and confidential. All rights reserved.

---

© 2025 Green Smoke Labs. All rights reserved.