Loading repository data…
Loading repository data…
c-kiplimo / repository
FinSage is an AI-powered financial Q&A chatbot that uses a smart routing layer to decide whether to search a knowledge base or answer from conversation context before every response,reducing hallucinations and unnecessary lookups.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
An AI-powered financial Q&A chatbot that thinks before it answers. A Planner decides on every turn whether to retrieve knowledge from a document base or lean on conversation context, with no unnecessary lookups and no hallucinated facts.
Most chatbots fall into one of two traps:
| Trap | What goes wrong |
|---|---|
| Always retrieve | Slow, pulls irrelevant docs for simple follow-ups |
| Never retrieve | Hallucinates specific rates, rules, and figures |
Financial advice has zero tolerance for made-up numbers. FinSage adds a routing layer between the user and the LLM that asks "does this question need grounded knowledge?" before every response. If yes → retrieve and answer with context. If no → answer from the conversation alone, faster and cleaner.
finsage/
├── agentic_rag_financial_advisor/
│ ├── planner.py # Routes query → rag or chat_history mode
│ ├── retriever.py # FAISS vector search with sentence-transformers
│ ├── rag_pipeline.py # Prompt assembly + LLM call
│ ├── llm.py # LangChain ChatOpenAI wrapper
│ ├── config.py # API key loader from env vars
│ └── utils.py # Chat history cleaner
├── app.py # Gradio entry point
├── requirements.txt
└── README.md
git clone https://github.com/c-kiplimo/FinSage.git
cd FinSage
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
export OPENAI_API_KEY=sk-... # required
# export ANTHROPIC_API_KEY=... # optional
# export GEMINI_API_KEY=... # optional
python app.py # opens http://localhost:7860
| Layer | Library |
|---|---|
| LLM | OpenAI GPT-4o via LangChain |
| Embeddings | sentence-transformers/all-MiniLM-L6-v2 |
| Vector Search | FAISS (IndexFlatIP, cosine similarity) |
| UI | Gradio ChatInterface |
| Language | Python 3.10+ |
MIT