Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 FinAgent

This repository accompanies the tutorial article
RAG Agent with Custom Tool: Development to Deployment
on Medium

architecture diagram

FinAgent is a retrieval-augmented generation (RAG) financial insights agent that delivers real-time, context-aware explanations of market trends and financial concepts.
It leverages LangChain, FAISS, LangGraph, and GPT-4o, storing conversation history in PostgreSQL for persistent context.

Response

Query: "Explain NVDA trend from 01/01/2024 to 01/01/2025" response


✨ Features

  • 🧠 RAG pipeline: Uses LangChain + FAISS for retrieval + LangGraph orchestration to deliver detailed, explainable answers.
  • 🔗 FastAPI service: Exposes an HTTP GET / endpoint for real-time querying.
  • 🗄 Persistent history: Saves conversation state to PostgreSQL using psycopg_pool and PostgresSaver.
  • ⚙️ Scalable deployment: Containerized with Docker, deployable via Kubernetes.

⚙️ Tech Stack

  • LangChain, FAISS, LangGraph, GPT-4o
  • FastAPI
  • PostgreSQL
  • Docker & Kubernetes

🚀 Getting Started

Prerequisites

  • Python 3.9+
  • Docker
  • Kubernetes (e.g., Minikube)
  • PostgreSQL instance

🛠 Installation & Setup

  1. Clone the repository:
git clone https://github.com/raoashish10/FinAgent.git
cd finagent
  1. Create .env file:
touch .env

Example .env:

DB_URI=postgresql://username:password@host:port/dbname
OPENAI_API_KEY=your_openai_key
  1. Install dependencies:
pip install -r requirements.txt

🧪 Usage

The API is served by default at localhost:8000.

curl example:

curl -X 'GET'   'http://127.0.0.1:8000/?query=Explain%20NVDA%20trend%20from%2001%2F01%2F2024%20to%2001%2F01%2F2025'   -H 'accept: application/json'

📄 Example response (as seen in FastAPI docs):

{
  "response": "NVIDIA's stock trend between January 2024 and January 2025 shows..."
}

Deploy to Kubernetes

minikube start
kubectl apply -f kubernetes/postgres-deployment.yaml
kubectl apply -f kubernetes/finagent-api-deployment.yaml

About

A RAG agent that explains financial market trends and concepts using LangChain, FAISS, and LangGraph, powered by GPT-4o. Serves responses via FastAPI and persists conversations with PostgreSQL. The system is containerized with Docker and orchestrated using local Kubernetes.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages