stocks insights ai agent

Report Abuse

Basic Information

This repository implements a full stack Stock Data Insights application that demonstrates Agentic Retrieval-Augmented Generation (RAG) workflows to extract insights from news and financial data for companies and the broader stock market. It integrates Large Language Models with vector and relational storage to support semantic retrieval and structured queries. The project shows how to asynchronously scrape news into MongoDB and synchronize documents to ChromaDB for semantic search, while financial time series are stored in PostgreSQL. LangChain, LangChain Expression Language (LCEL), LangGraph and ChromaDB are used to build agentic workflows. The codebase includes LangGraph RAG graphs for news retrieval, SQL generation and charting, an OpenAPI specification for REST endpoints, test cases using pytest, and observability integration via LangSmith for tracing LLM calls.

Links

App Details

Features
Stock performance visualization with generated charts and histograms. Attribute-specific data retrieval powered by LLM-generated SQL and execution against a PostgreSQL store. News aggregation with asynchronous scraping, document grading and semantic search via ChromaDB and LangChain. Agentic RAG graphs implemented in LangGraph for three primary flows: News Data RAG (retrieve, grade, web search, generate results), Stock Data RAG (LLM-generated SQL, execute SQL, generate results), and Stock Data Charts RAG (query SQL and produce visualizations). REST APIs are provided with an attached openapi.json describing endpoints for price statistics, charts, and topic-based news. Integrated testing via pytest and LLM observability through LangSmith tracing.
Use Cases
For analysts and developers working with financial and news data, the project provides a reusable example of combining LLMs, vector search, and SQL-backed data to answer stock-related queries. It automates collection of news and financial data, enables semantic retrieval of relevant documents, and uses LLMs to translate natural language queries into SQL for precise data access. The built RAG workflows can fall back to web search when local documents are insufficient, improving recall. Exposed APIs allow programmatic access to price statistics, charts and topic-specific news. LangSmith tracing and pytest tests aid debugging and reliability, making the repository useful as a prototype or starting point for productionizing AI-assisted stock analysis.

Please fill the required fields*