A full-stack application that autonomously categorizes financial transactions using a hybrid approach: deterministic rules, vector similarity search, and LLM reasoning.
- Hybrid Categorization Engine:
- Rules: High-precision regex/string matching for recurring transactions.
- Vector Search: Uses OpenAI embeddings and
pgvectorto find similar past transactions. - LLM Fallback: Uses OpenAI GPT to categorize novel transactions based on context.
- Plaid Integration: Seamlessly fetches transactions from bank accounts.
- Modern Stack:
- Backend: Go (Golang) with
chirouter. - Database: PostgreSQL with
pgvectorextension. - Frontend: Next.js 14 (App Router) + TypeScript.
- Backend: Go (Golang) with
- Dockerized: Easy setup with Docker Compose.
graph TD
A[Plaid API] -->|Sync Transactions| B(Go Backend)
B -->|1. Check Rules| C{Match?}
C -->|Yes| D[Assign Category]
C -->|No| E[Generate Embedding]
E -->|2. Vector Search| F{Similar Found?}
F -->|Yes| D
F -->|No| G[3. Ask LLM]
G --> D
D --> H[(Postgres DB)]
- Docker & Docker Compose
- Go 1.21+
- Node.js 18+
-
Start the Database
docker-compose up -d
-
Configure Environment Ensure
backend/.envis set up with your keys:DATABASE_URL=postgres://saumyapailwan@localhost:5432/txagent?sslmode=disable PLAID_CLIENT_ID=... PLAID_SECRET=... OPENAI_API_KEY=...
-
Run Backend
cd backend go mod tidy go run ./cmd/server/main.go -
Run Frontend
cd frontend npm install npm run dev
Visit http://localhost:3000 to view transactions.
To run the backend tests:
cd backend
go test ./...