Deterministic financial calculation engine with AI-powered advisory (RAG + Agents)
Easy Finance is a full-stack application for students, advisors, and finance professionals. It combines an exact calculation backend (no AI hallucinations) with a conversational assistant that consults technical documentation and runs precise mathematical operations as callable tools.
The UI ships with a dark/light theme switch and an English/Spanish language toggle, both available from the login screen and the sidebar.
| Rate Conversion (Light · Spanish) | Amortization Table (Dark · Spanish) |
|---|---|
![]() |
![]() |
| Annuities & Gradients (Light · English) | AI Assistant (Light · Spanish) |
|---|---|
![]() |
![]() |
| Module | Description |
|---|---|
| 🔄 Rate Conversion | Converts between Nominal, Periodic, and Effective Annual (EA) rates with exact formulas |
| 📈 Annuities & Gradients | Computes present/future value for ordinary and due annuities, plus arithmetic and geometric gradients |
| 📊 Amortization Tables | Generates full amortization schedules under the French (fixed installment) and German (fixed principal) systems |
| 🤖 AI Assistant (RAG) | Financial advisor that consults technical documentation (PDFs) and delegates exact math to deterministic tools |
| 🌓 Dark / Light Mode | Instant theme switch, persisted per session, applied consistently across every page |
| 🌐 English / Spanish | Full UI translation, including sidebar navigation, forms, and result messages |
Easy Finance/
├── backend/ # REST API with FastAPI
│ ├── api/ # Endpoints per module
│ │ ├── tasas.py
│ │ ├── amortizacion.py
│ │ ├── anualidades.py
│ │ └── chatbot.py # AI agent endpoint
│ ├── core/ # Deterministic financial logic (no AI)
│ │ ├── interest.py # Rate conversion
│ │ ├── amortization.py # Amortization tables
│ │ ├── annuities.py # Annuities
│ │ ├── gradients.py # Gradients
│ │ └── cashflows.py # Cash flow orchestration
│ ├── schemas.py # Pydantic models
│ └── main.py # FastAPI entry point
│
├── frontend/ # Streamlit UI
│ ├── app.py # Main entry point, auth gate, theme/language toggles
│ ├── auth.py # Session authentication
│ ├── utils.py # Helpers (CSS loading, theme sync, footer)
│ ├── i18n.py # Translation dictionaries and helpers
│ ├── assets/ # Static assets (logo, CSS, screenshots)
│ └── modulos/ # Application pages
│ ├── 1_tasas.py
│ ├── 2_anualidades.py
│ ├── 3_amortizacion.py
│ └── 4_chatbot_rag.py
│
├── ai_engine/ # AI engine
│ ├── agents/
│ │ ├── financial_agent.py # LangChain agent with tools
│ │ └── math_agent.py # Deterministic calculation tools
│ └── rag/
│ ├── ingest.py # PDF indexing → ChromaDB
│ ├── retriever.py # Semantic search
│ └── vectorstore/ # Vector database (local, gitignored)
│
├── data/
│ └── docs/ # Regulatory/reference PDFs (gitignored)
│
├── Dockerfile
├── docker-compose.yml
├── render.yaml # Render deployment configuration
├── pyproject.toml
└── .env # Environment variables (gitignored)
- Backend: FastAPI + Uvicorn
- Frontend: Streamlit
- AI / LLM: Gemini via
langchain-google-genai - Agent: LangChain —
AgentExecutorwithStructuredTool - RAG: ChromaDB +
GoogleGenerativeAIEmbeddings - Environment management: uv
- Deployment: Docker / Render
- Python 3.12+
uvinstalled- A Google API Key (free at Google AI Studio)
1. Clone the repository and install dependencies:
git clone <repository-url>
cd easy-finance
uv sync --link-mode=copy2. Configure environment variables:
# Create the .env file at the project root
cp .env.example .envEdit .env and add your key:
GOOGLE_API_KEY=your_api_key_here3. (Optional) Index your PDF documents:
Place PDF files in data/docs/ and run:
uv run python ai_engine/rag/ingest.pyThis processes the PDFs and builds the vector database in ai_engine/rag/vectorstore/.
.\run_app.ps1Terminal 1 — Backend (FastAPI):
uv run python -m uvicorn backend.main:app --reloadAPI available at: http://127.0.0.1:8000
Interactive docs: http://127.0.0.1:8000/docs
Terminal 2 — Frontend (Streamlit):
cd frontend
uv run python -m streamlit run app.pyApp available at: http://localhost:8501
Default demo credentials:
admin@riesgos.com/admin123(mock auth infrontend/auth.py, meant to be replaced with real authentication before production use).
docker-compose up --buildrender.yaml defines two services (backend and frontend).
- Connect your repository on Render.
- Go to the backend service's Environment tab and add:
GOOGLE_API_KEY→ your Google AI key.
- Render will detect
render.yamland deploy both services automatically.
| Conversion | Formula |
|---|---|
| Nominal → EA | EA = (1 + i_nom/n)^n - 1 |
| Periodic → EA | EA = (1 + i_per)^n - 1 |
| EA → Nominal | i_nom = n * ((1 + EA)^(1/n) - 1) |
| EA → Periodic | i_per = (1 + EA)^(1/n) - 1 |
| Instrument | Formula |
|---|---|
| Ordinary Annuity | VP = A * (1 - (1+i)^-n) / i |
| Annuity Due | VP = A * (1 - (1+i)^-n) / i * (1+i) |
| Arithmetic Gradient | VP = VP_annuity + (G/i) * ((1-(1+i)^-n)/i - n/(1+i)^n) |
| Geometric Gradient | VP = A * (1 - ((1+j)/(1+i))^n) / (i - j) |
Future value for any instrument is obtained as VF = VP * (1+i)^n.
- Fixed installment:
A = P * i(1+i)^n / ((1+i)^n - 1)
- Fixed principal installment:
K = P / n
- Theme and language preferences live in
st.session_stateand are re-applied on every page viafrontend/utils.py::load_css(). - Dark mode works by tagging the document root with
data-themeand switching CSS custom properties defined infrontend/assets/style.css. - Translations are centralized in
frontend/i18n.py; UI labels uset(key)while selectable option values keep their internal (Spanish) identifiers so the backend contract never changes — only their displayed label is translated viaopt(category, value).
- The
.envfile is excluded from the repository via.gitignore. - The
data/folder (PDFs) andai_engine/rag/vectorstore/(database) are local-only and not pushed to the repository. - The bundled login is a development mock — replace
frontend/auth.pywith real authentication before deploying publicly.
Faiber Andres Montes Gómez Applied computational finance project powered by AI.
Easy Finance — Exact calculations, intelligent advisory.



