A multi-agent system that autonomously monitors financial markets, reads news articles, and analyzes sentiment to make predictions and generate reports. Fin-Agent acts as a personal financial advisor, with a strong focus on risk management and data-driven insights.
- Autonomous Market Monitoring: The Data Retrieval Agent autonomously pulls and processes real-time financial market data and news.
- Sentiment and News Analysis: The Sentiment Analysis Agent reads news articles and social media to gauge market sentiment, providing a crucial leading indicator.
- Predictive Modeling: The Modeling Agent runs complex simulations and analyzes historical data to generate predictions and identify potential risks.
- Comprehensive Reporting: The Reporting Agent synthesizes all findings into clear and concise reports, making complex financial data accessible to the user.
- Chart and Graph Interpretation: Utilizes a vision model to interpret charts and graphs directly from financial reports, adding a powerful layer of visual data analysis.
- Specialized Knowledge: Employs a specialized embedding model fine-tuned on financial news and SEC filings for highly accurate and contextually relevant analysis.
- Framework: Next.js 14+ (App Router) for Server-Side Rendering (SSR) and optimized performance.
- Styling: Tailwind CSS for a high-density, "Bloomberg-style" dark UI.
- State Management & Data Fetching: TanStack Query (React Query) for managing server state and caching.
- Icons & UI: Lucide React for financial icons and Framer Motion for smooth agent-status transitions.
- Protocol: tRPC for end-to-end typesafe API calls. This allows your Frontend to "know" exactly what data the Backend agents return without manually defining types twice.
- Validation: Zod for strict schema validation of ticker symbols and market data inputs.
- Runtime: Node.js with Express to manage the tRPC server and coordinate Python agent execution.
- Database (General): MongoDB (via Mongoose) to store user profiles, saved reports, and watchlists.
- Agent Bridge:
child_processandspawnmodules to execute Python scripts and stream real-time logs from the AI agents.
- Languages: Python 3.10+ for the heavy-duty data science and LLM logic.
- Orchestration: LangChain or a custom Agent class to manage the flow between retrieval and reporting.
- Models:
- Reasoning:
gpt-4ofor synthesizing complex financial reports. - Vision:
gpt-4o-visionfor interpreting candlestick charts and technical indicator graphs. - Embeddings:
text-embedding-3-smallfor specialized financial news processing.
- Vector Database: Qdrant (Running in Docker) for high-speed retrieval of SEC filings and historical news using RAG (Retrieval-Augmented Generation).
- Time-Series Database: QuestDB or TimescaleDB for storing millions of real-time price ticks with sub-millisecond query times.
- Containerization: Docker and Docker Compose to standardize the environment (Qdrant, Mongo, and the Python environment).
- CI/CD: GitHub Actions for automated
pytestand TypeScript build checks. - Testing:
Pytestfor Python agents andJestfor frontend components.
| Layer | Technology | Key Benefit |
|---|---|---|
| Type Safety | TypeScript + tRPC | Prevents runtime crashes between Frontend and Backend. |
| Intelligence | OpenAI GPT-4o | Allows the "Reporting Agent" to sound like a human analyst. |
| Memory | Qdrant | Allows agents to remember news from 2 years ago instantly. |
| Real-time | Custom Time-Series DB | Handles the high-frequency nature of market price updates. |
- Node.js (for Next.js)
- Python 3.10+ (for backend services and models)
- Docker (for the time-series database and Qdrant)
- Clone the repository:
git clone https://github.com/saadsalmanakram/Fin-Agent.git cd Fin-Agent - Start Docker containers:
docker-compose up -d
- Set up the frontend and backend:
Follow the instructions in the
frontend/andbackend/directories to install dependencies and configure the services.
Create a .env file to store your API keys for financial data providers and other necessary environment variables.
Run the Next.js server and the backend agent services to begin autonomous market monitoring and reporting.
To pull everything together for saadsalmanakram/Fin-Agent, here is the final, comprehensive directory structure. This includes the multi-agent Python scripts, the tRPC-powered backend, the Next.js frontend, and the automated CI/CD configurations.
Fin-Agent/
βββ .github/
β βββ workflows/
β βββ ci.yml # GitHub Actions pipeline
βββ docker-compose.yml # Qdrant, MongoDB, & Time-Series DB
βββ .env # API Keys (OpenAI, Qdrant, etc.)
βββ .gitignore
βββ backend/
β βββ src/
β β βββ agents/ # Python Multi-Agent Logic
β β β βββ data_retrieval.py
β β β βββ sentiment_analysis.py
β β β βββ vector_storage.py # Qdrant / RAG logic
β β β βββ modeling_agent.py # Prediction logic
β β β βββ reporting.py # Markdown synthesis
β β β βββ tests/ # Pytest suite for CI
β β βββ routers/ # tRPC Router definitions
β β β βββ index.ts # Root router
β β β βββ sentiment.ts
β β β βββ memory.ts
β β β βββ orchestrator.ts # Master agent coordinator
β β βββ models/ # MongoDB Schemas
β β βββ trpc.ts # tRPC initialization
β β βββ index.ts # Express server entry
β βββ package.json
β βββ tsconfig.json
β βββ requirements.txt # Python deps (pandas, openai, etc.)
βββ frontend/
β βββ src/
β β βββ app/ # Next.js App Router
β β β βββ layout.tsx
β β β βββ page.tsx # Main Dashboard UI
β β βββ components/ # UI Components
β β β βββ RiskGauge.tsx
β β β βββ SentimentCard.tsx
β β β βββ ReportMarkdown.tsx
β β βββ utils/
β β β βββ trpc.ts # tRPC Client & Hooks
β β βββ styles/
β βββ package.json
β βββ tailwind.config.js
β βββ tsconfig.json
βββ data/ # Local volume for DB persistence