Investment Portfolio Tracker
Flagship Project
A production-style FastAPI backend application for investment portfolio management that combines authentication, SQLAlchemy-based persistence, Retrieval-Augmented Generation (RAG), AI agent workflows, and Model Context Protocol (MCP) in a layered backend system.
Backend Features
- JWT authentication with access and refresh tokens.
- Multi-Demat account support.
- BUY/SELL transaction management.
- Portfolio summaries and holdings calculations.
- SQLAlchemy ORM with PostgreSQL and configurable relational database support.
- Layered architecture: Routes, Services, and Repository.
- User-scoped data access and trusted backend authorization boundaries.
AI and RAG Integration
- RAG pipeline for PDF, DOCX, TXT, and Markdown documents.
- Source-grounded answers with document citations.
- Configurable ChromaDB and Pinecone vector-store providers.
- Provider-agnostic LLM and embedding integration supporting Gemini, OpenAI-compatible, and local providers.
- LangGraph orchestration for AI agents and backend tool calling.
- Trusted user and chat context isolation during AI tool execution.
Model Context Protocol
- MCP support through STDIO and authenticated Streamable HTTP transports.
- Personal access token authentication with Argon2-hashed token storage.
- Chat-scoped document search with user ownership validation.
- Shared backend tools reused by the web assistant and MCP server.
Testing
- Automated Pytest suite covering authentication, portfolio workflows, repository contracts, document uploads, RAG, AI tools, LangGraph orchestration, and MCP security.
Technology Stack
Python, FastAPI, SQLAlchemy, PostgreSQL, LangChain, LangGraph, RAG, ChromaDB, Pinecone, Gemini, JWT, Argon2, Docker, MCP, and Pytest.