explaingit

kaniikaaaa/financerag

Analysis updated 2026-05-18

0PythonAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

A tool that answers questions about recent stock market news using fresh Yahoo Finance headlines and always cites its sources.

Mindmap

mindmap
  root((FinanceRAG))
    What it does
      Answers finance questions
      Cites sources
      Recency weighted search
    Tech stack
      FastAPI
      PostgreSQL
      pgvector
      OpenAI API
    Use cases
      Market news chat
      Ticker tracking
      Dashboard search
    Audience
      Developers
      Finance builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a chat assistant that answers questions about today's market news with sources.

USE CASE 2

Track what is driving a specific stock ticker using recent headlines.

USE CASE 3

Add a cited answer search feature to a finance dashboard.

USE CASE 4

Prototype a retrieval augmented generation system using pgvector.

What is it built with?

PythonFastAPIPostgreSQLpgvectorOpenAI APISQLAlchemy

How does it compare?

kaniikaaaa/financerag0xhassaan/nn-from-scratch3ks/embedoc
Stars00
LanguagePythonPythonPython
Last pushed2023-06-08
MaintenanceDormant
Setup difficultymoderatemoderatehard
Complexity3/54/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a local PostgreSQL with the pgvector extension and an OpenAI API key.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

FinanceRAG is a tool that answers questions about recent stock market news by pulling in real financial headlines and citing its sources. Instead of relying on a language model's built in knowledge, which can be outdated or made up, this project builds its own small search engine over fresh news and only answers using what it finds there. On a schedule, the system pulls headlines from Yahoo Finance and converts each one into a numerical representation called an embedding, using an OpenAI embedding model. These are stored in PostgreSQL with a plugin called pgvector, which lets the database search by meaning instead of by exact words. When someone asks a question like what is driving NVDA today, the system finds the most relevant recent headlines and blends how closely they match the question with how recently they were published, so a question about today's news actually returns today's news rather than something from last month. Every answer comes with its sources: the article title, publish time, and ticker symbol. If the system cannot find supporting articles, it refuses to answer rather than making something up. Because the news is pre processed and stored ahead of time, answering a question only takes one database lookup and one call to GPT-4o-mini, so responses come back quickly. The project is built with FastAPI for the web server, PostgreSQL with pgvector for storage and search, SQLAlchemy for database access, and yfinance for pulling the news data. Setting it up means cloning the repository, installing Python dependencies, adding an OpenAI API key and a database connection string, then running a couple of setup scripts before starting the server. It exposes a single main endpoint that accepts a question and returns an answer along with its cited sources. It is released under the MIT license, which allows free use including commercial use.

Copy-paste prompts

Prompt 1
Help me set up pgvector in PostgreSQL and connect it to a FastAPI app like FinanceRAG.
Prompt 2
Show me how to add a new data source besides Yahoo Finance to a recency weighted retrieval system.
Prompt 3
Explain how to adapt FinanceRAG's citation or refuse pattern for my own RAG project.
Prompt 4
Write a script that schedules the yfinance ingestion job to run every hour.

Frequently asked questions

What is financerag?

A tool that answers questions about recent stock market news using fresh Yahoo Finance headlines and always cites its sources.

What language is financerag written in?

Mainly Python. The stack also includes Python, FastAPI, PostgreSQL.

What license does financerag use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is financerag to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is financerag for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.