AgentScope Memory Finance Bot is a local-first AI finance assistant that combines:
- Persistent per-user memory stored in SQLite
- Local LLM inference using Ollama (Llama 3.2)
- Live market data via
yfinance - Tool-augmented reasoning using AgentScope
ReActAgent
This project is designed for fully local execution (no OpenAI dependency).
- 🧠 Persistent memory per user (
memories/<user_id>.db) - 🏦 Stock market quotes via
yfinance - 🤖 Local LLM via Ollama (
llama3.2:3b) - 🔧 Tool-based reasoning (ReAct agent architecture)
- ⚡ Async memory + engine lifecycle management
.
|-- main.py
|-- pyproject.toml
|-- uv.lock
|-- .env (optional, not required for LLM)
`-- memories/ # auto-created at runtime
Install:
- Python 3.12+
- Ollama
Check Python:
python --versionInstall Ollama: https://ollama.com/download
Then pull the model:
ollama pull llama3.2:3bStart server:
ollama serveEnsure it runs on:
http://localhost:11434
git clone https://github.com/pawan941394/agentscope-memory-finance-bot.git
cd agentscope-memory-finance-botor
mkdir agentscope-memory-finance-bot
cd agentscope-memory-finance-botpython -m venv .venv
source .venv/bin/activate # mac/linux
.venv\Scripts\activate # windowspip install agentscope sqlalchemy aiosqlite yfinanceor
uv syncpython main.pyYou will see:
Enter user id:
Use same user_id to continue memory across sessions.
- Agent: AgentScope
ReActAgent - Model: Ollama (
llama3.2:3b) - Memory: AsyncSQLAlchemyMemory (SQLite per user)
- Tool: Yahoo Finance via
yfinance
Example tool input:
AAPL, MSFT, TSLA
Output includes:
- Price
- Change
- Volume
- Day high/low
- “Get AAPL, MSFT and summarize market movement”
- “Compare NVDA vs AMD performance”
- “What do you remember about my investing style?”
- Stored in:
memories/<sanitized_user_id>.db - Backend: SQLite (async)
- Session:
default_session
- Fully local LLM (no OpenAI API required)
- Market data is via
yfinance(may be delayed) - Designed for learning agent systems + tool use
ollama serveollama pull llama3.2:3bpip install agentscope sqlalchemy aiosqlite yfinance- Streamlit UI/FE
- Multi-agent finance assistant
PRs welcome. Keep it simple, local-first, and modular.
MIT