*not to be used as actual financial advice
This project is a small retrieval-augmented agent built with:
- 🧠
smolagentsfor tool-using LLM orchestration - 🔎
Qdrantfor vector search over structured knowledge fragments - 🧬
fastembedfor embeddings - 🦙 a local LLM served via Ollama (
qwen3-coderin this setup)
The system is designed to produce structured financial hardship advice by retrieving small, focused knowledge fragments and then synthesising them into an actionable plan.

Click the image above to watch the demo
Instead of storing full answers, the system stores fine-grained financial facts, such as:
- Definitions (e.g. what mortgage arrears are)
- Regulations (e.g. FCA rules)
- Remedies (e.g. payment plans, refinancing options)
- Risks (e.g. credit impact)
- Support schemes (e.g. UK SMI)
When given a real-world scenario, the agent:
- Queries a vector database (Qdrant)
- Retrieves multiple relevant fragments
- Combines them using an LLM
- Produces a personalised 4–6 step action plan
User Scenario
↓
CodeAgent (smolagents)
↓
QdrantQueryTool (semantic retrieval)
↓
Qdrant Vector DB (embedded financial knowledge)
↓
LLM (Ollama / Qwen3 Coder)
↓
Synthesised Action Plan
The embedded dataset (FINANCIAL_KNOWLEDGE) includes:
- Mortgage arrears rules and forbearance options
- Credit card debt spirals
- Payday loan regulations
- Council tax arrears processes
- Overdraft dependency risks
- Student loan repayment structures
- Business cash flow issues
- Medical debt handling
- Retirement shortfalls
- Identity theft recovery steps
Each entry is intentionally atomic (one fact per chunk) to improve retrieval quality and compositional reasoning.
pip install fastembed qdrant-client smolagents litellmYou also need a running Qdrant instance:
docker run -p 6333:6333 qdrant/qdrantMake sure Ollama is running locally:
ollama run qwen3-coder:30bUpdate the model config if needed:
model_id="ollama/qwen3-coder:30b"
api_base="http://localhost:11434"python main.pyThe core tool is QdrantQueryTool, which:
- Embeds a query using
jinaai/jina-embeddings-v2-base-en - Searches Qdrant for the most relevant knowledge fragments
- Returns top-k results with scores and metadata
Each result contains:
- Topic (e.g. Mortgage Arrears)
- Type (definition, remedy, regulation, etc.)
- Raw fact text
- Similarity score
The agent is explicitly instructed to:
- Run multiple retrieval queries
- Cover different angles (risk, regulation, remedy, etc.)
- Avoid relying on a single chunk of knowledge
- Produce a structured, contextual action plan
- Only use retrieved facts (no hallucinated policy or advice)
The default scenario:
A UK homeowner has missed two mortgage payments, is self-employed, has no savings buffer, and has received an arrears warning letter.
The agent is expected to produce:
- Prioritised steps (contact lender, check forbearance options, etc.)
- References to UK-specific regulation (MCOB rules)
- Debt support pathways (e.g. StepChange, SMI scheme)
- Risk explanation (credit impact, repossession process)
Each fact is atomic to allow recombination during reasoning.
The agent is encouraged to run multiple semantic searches instead of relying on a single embedding result.
The LLM does not directly “know” finance — it must query tools.
- Qdrant runs locally
- Ollama runs locally
- No external API dependency required
.
├── main.py # Agent + tool + knowledge base
├── pyproject.toml # Python project config
├── qdrant_storage/ # Local vector DB state (ignored in git)
├── output.md # Generated outputs (optional)
- Add document ingestion pipeline (PDFs, scraping, etc.)
- Introduce query planner agent (decides which angles to search)
- Add reranking stage for better retrieval quality
- Persist Qdrant collection instead of re-seeding each run
- Add structured output schema for action plans
This system is for experimental and educational purposes. It is not a substitute for professional financial advice.
MIT