gitmyhub

meridian-wealth-deployment

Python ★ 20 updated 1mo ago

Meridian Wealth is a FastAPI web service that wraps an AI agent — specifically a LangGraph ReAct agent — designed to act as a financial analyst assistant for a fictional firm called Meridian Wealth Partners. FastAPI is a Python framework for building web APIs; LangGraph is a library for building AI agents that can use tools in a loop to reason through complex questions (the ReAct pattern: Reason, then Act, then observe the result).

The agent has five tools it can call to answer questions: it can look up client portfolio data and market data from a SQLite database (a simple local database file), run Python calculations for financial metrics like returns and percentages, search over investment policy documents using a vector search index called FAISS (which lets you find relevant passages from PDF files using semantic similarity rather than keyword matching), and run live web searches via the Tavily API for current news and market updates. The policy PDFs are included in the repository; the database is not and must be provided separately.

You send questions to the /chat endpoint, optionally with a conversation ID to maintain context across multiple messages. The agent figures out which combination of tools to call, calls them, uses the results to form a follow-up reasoning step if needed, and eventually returns a final answer. Optionally you can request the tool-call trace showing exactly what steps the agent took.

Setup requires creating a Python virtual environment, installing dependencies, copying the example environment file and filling in an OpenAI API key and a Tavily API key, and then running the server with uvicorn. The first startup embeds the policy PDFs into the FAISS index, which takes about a minute; subsequent starts load the saved index.