demo.mp4
TrueWealth AI is a end-to-end Multi-Agent Financial Advisor AI System that combines LangGraph-powered orchestration, advanced LLM reasoning (LLaMA-3 via Groq), and RAG with ChromaDB + HuggingFace embeddings to deliver professional, context-aware financial insights. The system features Planner, Retriever, Generator, News, Web Search, and Memory agents with intelligent tool routing, retry logic, and multi-source knowledge fusion for high accuracy and reliability. It supports PDF ingestion, financial news retrieval, and fallback web search to ensure comprehensive answers. Built with a modular architecture for scalability, it provides FastAPI APIs for testing, a Flask-based responsive UI (HTML, CSS, JS) for client interaction, and is fully Dockerized for portability. Deployed on Render with an integrated CI/CD pipeline, it reflects enterprise-level engineering practices, making it a industry-grade AI solution ready for real-world deployment.
π― Try the real-time TrueWealth AI:
π TrueWealth AI β Click Here
- Helps individual investors make informed decisions on stocks, bonds, and long-term investments.
- Acts as a tutor for users reading financial books (e.g., The Intelligent Investor).
- Provides up-to-date financial news from Yahoo Finance.
- Assists small business owners in budgeting, tax planning, and investment decisions.
- Offers retirement planning insights (e.g., 401(k), Roth IRA strategies).
β Step | π§ Feature | βοΈ Tech Stack / Tool Used |
---|---|---|
1οΈβ£ | π§ LLM-based Financial Query Understanding | Groq + LLaMA-3 |
2οΈβ£ | β¨ Professional Tone Personalization | Prompt Engineering + Advisor Persona Templates |
3οΈβ£ | π RAG-based Financial Answering | LangChain + ChromaDB + Sentence Transformers (all-MiniLM-L6-v2) |
4οΈβ£ | π Financial Document Retriever Agent | RetrieverAgent + Vector Store Search |
5οΈβ£ | π§ Answer Generator Agent | GeneratorAgent (LLM-based factual + professional financial style) |
6οΈβ£ | π° Financial News Retrieval Agent | YahooFinanceNewsTool |
7οΈβ£ | π Web Search Agent (Fallback) | DuckDuckGo Search Tool |
8οΈβ£ | π§ Planner Agent | LangGraph Planner Node |
9οΈβ£ | π Intelligent Tool Routing & Fallback | Retry Logic + Conditional Branching + Multi-step Tool Selection |
π | π§ Short-Term Conversational Memory | LangGraph Memory Integration (Buffer-based) |
1οΈβ£1οΈβ£ | π PDF Knowledge Ingestion | PyPDFLoader + RecursiveCharacterTextSplitter |
1οΈβ£2οΈβ£ | π Vector Embedding & Storage | HuggingFaceEmbeddings + ChromaDB |
1οΈβ£3οΈβ£ | βοΈ State-based Multi-Agent Orchestration | LangGraph StateGraph + Conditional Edges + Dynamic State Updates |
1οΈβ£4οΈβ£ | π Multi-source Knowledge Fusion | LLM + RAG + Yahoo Finance + DuckDuckGo Combined Answer Synthesis |
1οΈβ£5οΈβ£ | π§ͺ API Testing & Integration | FastAPI (API endpoints for agent orchestration testing) |
1οΈβ£6οΈβ£ | π Modular Code Architecture | Separation of Concerns + Service/Agent Modules |
1οΈβ£7οΈβ£ | π» Responsive Web UI | Flask + HTML5, CSS3, JavaScript |
1οΈβ£8οΈβ£ | π Cloud Deployment | Render (Production hosting) |
1οΈβ£9οΈβ£ | π CI/CD Pipeline | GitHub Actions / CI/CD Workflows |
2οΈβ£0οΈβ£ | π¦ Containerization for Portability | Docker (App + Dependencies + Environment) |
TrueWealth AI/
β
βββ .github/
β βββ workflows/
β βββ main.yml
β
βββ agents/
β βββ __init__.py
β βββ duckduckgo.py
β βββ executor.py
β βββ generator.py
β βββ llm.py
β βββ memory_store.py
β βββ memory.py
β βββ planner.py
β βββ rag.py
β βββ yfinance.py
β
βββ core/
β βββ __init__.py
β βββ config.py
β βββ state.py
β βββ workflow.py
β
βββ data/
β βββ The Intelligent Investor - BENJAMIN GRAHAM.pdf
β
βββfinance_db/
β βββ chroma.sqlite3
β
βββ notebook/
β βββ experiment.ipynb
β
βββ static/
β βββ css/
β β βββ style.css
β βββ images/
β β βββ logo.png
β βββ js/
β βββ script.js
β
βββ templates/
β βββ index.html
β
βββ tests/
β βββ test_app.py
β
βββ tools/
β βββ __init__.py
β βββ document_loader.py
β βββ llm_client.py
β βββ search_tools.py
β βββ vector_store.py
β
βββ .gitignore
βββ api.py
βββ app.py
βββ app.png
βββ demo.mp4
βββ Dockerfile
βββ LICENSE
βββ main.py
βββ README.md
βββ render.yaml
βββ requirements.txt
βββ setup.py
flowchart TD
A[User Query] --> B[Planner]
B --> C[Recall Memory]
C --> D[LLM Direct Answer Attempt]
D -->|Success| E[Generate Response]
D -->|Failure| F[Executor: Retry Logic]
F --> G{Retry Count < 3?}
G -->|Yes| H[RAG: Search PDF Knowledge]
G -->|No| I[Yahoo Finance Search]
H -->|Found Docs| E
H -->|No Docs| I
I -->|Found News| E
I -->|No News| J[DuckDuckGo Web Search]
J --> E
E --> K[Store in Memory]
K --> L[Return Final Answer]
%% External Tools
H --> M[(ChromaDB)]
I --> N[[Yahoo Finance]]
J --> O[[DuckDuckGo]]
%% LLM Core
D --> P[[Groq-LLaMA3]]
E --> P
Process a financial question and return an AI-generated response with source information.
Request:
POST /chat HTTP/1.1
Content-Type: application/json
Host: localhost:8000
{
"message": "What are the top performing stocks this week?",
"session_id": "optional_existing_id"
}
Parameters:
message
(required) β The financial question to processsession_id
(optional) β Existing session ID for context continuity (default:"default"
)
Response:
{
"response": "Based on Yahoo Finance data, the top performing stocks this week are...",
"session_id": "20250813123045",
"source": "YahooFinance"
}
Status Codes:
200
β Successful response400
β Invalid request (missingmessage
)500
β Internal server error
- Service Containerization: The entire TrueWealth AI system is broken down into microservices, each housed within its own Docker container.
- Docker Compose: Used to coordinate and manage multi-container services for local development and testing.
-
Build Docker Image:
docker build -t truewealth-ai .
-
Run Application in Docker:
docker-compose up --build
Continuous Integration and Continuous Deployment (CI/CD) is implemented using GitHub Actions to automate testing, building, and deploying the project.
- Automated Testing: Every code push triggers automated unit and integration tests.
- Automated Deployment: Successful builds are automatically deployed to production or staging environments.
- Multilingual Support: Future iterations will include multilingual capabilities to cater to a global client base.
- Advanced Financial Analytics: Integration with more sophisticated financial forecasting models and real-time market analysis.
- Long-Term Memory: Extended memory for better long-term personalized financial advice.
- Developer: Md Emon Hasan
- GitHub: Md-Emon-Hasan
- LinkedIn: Md Emon Hasan
- Email: iconicemon01@gmail.com
- WhatsApp: +8801834363533