Browse Source

docs: finalize BOUNTY.md with specific customer, complete data sources, and explicit CRUD operations

Made-with: Cursor
pull/6453/head
Priyanka Punukollu 1 month ago
parent
commit
930515f5c4
  1. 333
      BOUNTY.md

333
BOUNTY.md

@ -2,17 +2,22 @@
## The Customer ## The Customer
Tech professionals anywhere in the world evaluating a job offer, relocation, **A 32-year-old software engineer** who uses Ghostfolio to track their $94k investment
or first home purchase. Specifically: someone with investments in Ghostfolio portfolio and is trying to figure out:
who wants to know:
- "Is this job offer in Seattle/London/Tokyo actually a real raise after cost of living?" 1. Whether their portfolio can fund a down payment on a home
- "Can my portfolio fund a down payment? Where can I afford?" 2. Whether to accept a $180k job offer in Seattle (is it actually a raise after cost of living?)
- "What is my total net worth including my home equity?" 3. What their retirement looks like if they start buying rental properties now
**The pain:** "I have money in the market. I got a $180k offer in Seattle. ...all in one conversation, without switching between a portfolio app, a real estate site,
I don't know if I can afford to move, whether I can buy a house, or if the a COL calculator, a spreadsheet, and a financial advisor.
raise is even real."
**The specific pain:** _"I have $94k in my Ghostfolio portfolio, I got a job offer in
Seattle, I'm thinking about buying a house, and I want to know if any of this makes sense
together — but every tool I use only knows about one piece."_
This person needs a financial co-pilot that knows about their whole picture — investments,
real estate equity, and major life decisions — and can reason about all three in one place.
--- ---
@ -20,260 +25,164 @@ raise is even real."
### 1. Portfolio → Down Payment Bridge ### 1. Portfolio → Down Payment Bridge
Reads the user's live Ghostfolio portfolio and calculates exactly which housing Reads the user's live Ghostfolio portfolio and calculates exactly which housing markets they
markets they can afford at 20% down with monthly payment estimates and rent vs can afford at 20% down. Compares conservative (60%), full (100%), and safe (80%) scenarios.
buy comparison. Works for Austin (real MLS data) and any city worldwide Includes monthly payment estimates and rent vs. buy verdict.
(Teleport API).
### 2. Job Offer Affordability Calculator ### 2. Job Offer Affordability Calculator
Takes any salary offer and destination city anywhere in the world, adjusts for Takes any salary offer and destination city, adjusts for cost of living difference, and
cost of living, and tells the user whether it is a real raise in purchasing tells the user whether it is a real raise in purchasing power. Compares state income tax.
power terms. Covers 200+ cities via Teleport API + real Austin MLS data. Works for 200+ cities worldwide. Example: `$180k Seattle vs $120k Austin = NOT a real raise
Handles state income tax comparison automatically. (-$5,593 purchasing power loss after COL adjustment)`.
### 3. Property Tracker — Full CRUD ### 3. Property Tracker — Full CRUD
Users log owned properties, track equity, monitor appreciation. Agent supports Users log owned properties, track equity, monitor appreciation over time. The agent supports
create, read, update, and delete via natural language. Stored in SQLite — all four CRUD operations via natural language:
persists across sessions. Soft-delete preserves audit trail.
- **CREATE:** `add_property(address, purchase_price, current_value, mortgage_balance)` → stores in SQLite, returns equity
- **READ:** `get_properties()` → lists all active properties with equity, appreciation, mortgage balance
- **UPDATE:** `update_property(id, current_value=490000)` → recalculates equity after market changes
- **DELETE:** `remove_property(id)` → soft-delete preserving audit trail, property no longer in active list
Persists across sessions in `agent/data/properties.db` (SQLite).
### 4. Unified Net Worth View ### 4. Unified Net Worth View
Agent combines live investment portfolio + real estate equity into one complete Combines live investment portfolio from Ghostfolio API + real estate equity from SQLite into
financial picture in a single conversation turn. one complete financial picture. Single conversation turn: "What is my total net worth?"
returns portfolio + all property equity + total.
### 5. Relocation Runway Calculator ### 5. Relocation Runway Calculator
Calculates month-by-month how long until the user Calculates month-by-month timeline until the user rebuilds emergency fund, reaches down
rebuilds emergency fund, reaches a down payment, payment, and feels financially stable after any relocation. Works for any two cities globally.
and feels financially stable after any relocation.
Works for any two cities globally via Teleport API
- ACTRIS Austin data.
### 6. Wealth Gap Visualizer ### 6. Wealth Gap Visualizer
Compares actual net worth against Federal Reserve Compares actual net worth against Federal Reserve median wealth by age group. Projects
median wealth by age group. Projects retirement income retirement income at current savings rate. Source: Federal Reserve SCF 2022.
at current savings rate. Shows what-if scenarios.
Source: Federal Reserve Survey of Consumer Finances 2022.
### 7. Life Decision Advisor ### 7. Life Decision Advisor
Orchestrates all tools into one complete recommendation Orchestrates all tools into one complete recommendation for job offers, relocations, home
for any major life decision — job offer, relocation, purchases, and rent vs. buy decisions. Returns verdict, tradeoffs, confidence level, and
home purchase, rent vs buy. Returns structured verdict next steps.
with tradeoffs, confidence level, and next steps.
### 8. Equity Unlock Advisor ### 8. Equity Unlock Advisor
For homeowners: models three 10-year options for home For homeowners: models three 10-year scenarios for home equity — keep untouched, cash-out
equity — leave untouched, cash-out refi and invest, refi and invest, or use as rental property down payment.
or use as rental property down payment. Uses real Austin
appreciation data and current mortgage rates.
### 9. Family Financial Planner ### 9. Real Estate Strategy Simulator
Models financial impact of having children for any city Simulates buying a home every N years for M years and renting previous ones. Uses the user's
worldwide. Covers 25+ US cities and international cities own appreciation/rent assumptions, not guesses. Returns year-by-year net worth projection.
including European subsidized childcare. Shows income
needed, cost breakdown, alternatives, and international ### 10. Family Financial Planner
comparisons (Berlin $333/mo vs Austin $1,500/mo).
Models the financial impact of having children for any city. Covers 25+ US cities and
international cities. Shows income needed, childcare cost breakdown, and international
comparisons (Berlin $333/month vs Austin $1,500/month).
--- ---
## Data Sources ## Data Sources
**User's own property data** — stored in SQLite, ### Primary: SQLite Property Database (`agent/data/properties.db`)
persists across sessions, full CRUD via natural language
**Ghostfolio portfolio API** — live investment holdings, **This is the stateful CRUD data the agent uses.** Users add their own properties via
total value, performance data natural language. The data persists in SQLite across sessions. The agent reads, writes,
updates, and soft-deletes property records through 5 tool functions:
**Federal Reserve Survey of Consumer Finances 2022** — ```
wealth percentile benchmarks by age group (public data) add_property → INSERT into properties table
get_properties → SELECT all active properties
update_property → UPDATE specific fields (value, mortgage, etc.)
remove_property → UPDATE is_active=0 (soft delete)
get_total_net_worth → aggregate equity across all active properties
```
**US Dept of Labor + Care.com 2024** — childcare cost The agent accesses this data by calling `property_tracker.py` tool functions through the
estimates for family planning feature (background data) LangGraph routing layer. The LangGraph graph classifies the user's intent → routes to the
property tracker node → executes the appropriate CRUD function → returns structured JSON
result → LLM formats into natural language response.
**ACTRIS/Unlock MLS January 2026** — Austin TX market ### Supporting: Ghostfolio Portfolio API
data available as background context when asked
(provided by developer, licensed Austin real estate agent)
--- Live investment portfolio data (holdings, total value, allocation, performance) fetched
from `http://localhost:3333/api/v1/portfolio` using the user's bearer token. This is the
existing Ghostfolio data the agent is built on top of.
## The Impact **How accessed:** The agent receives the user's Ghostfolio bearer token from the Angular
frontend, uses it to call the Ghostfolio REST API, and incorporates the live portfolio
data into property-aware calculations (e.g., net worth = portfolio value + real estate equity).
The app solves a real problem: most people have money ### Supporting: ACTRIS/Unlock MLS January 2026
in both investments and real estate but no single place
to see the complete picture or run scenarios on their
own numbers.
A user adds their home (bought $400k, worth $480k,
mortgage $310k) and immediately sees $170k equity
tracked alongside their $94k investment portfolio —
total net worth $264k in one view.
They then ask: "What if I buy a home every 2 years
for the next 10 years and rent the previous one?"
The agent asks what appreciation and rent assumptions
they want to use — because we do not guess at numbers
for markets we cannot verify. The user says "moderate
— 4% appreciation." The agent runs the projection using
their actual portfolio balance, their income, and their
assumptions — and returns a year-by-year picture of
what their net worth could look like at retirement.
This is a conversation people pay financial advisors
hundreds of dollars per hour to have. This app does it
in 30 seconds — honestly, with the user's own numbers,
and with clear disclaimers about what is a projection
vs a prediction.
No market data promises. No city comparisons we cannot
stand behind. Just the user's numbers, their assumptions,
and honest math.
--- Licensed Austin TX real estate market data for listing search and neighborhood comparisons.
Provided by the developer, who is a licensed Austin real estate agent. Embedded in
`agent/tools/real_estate.py` as structured data.
## Suggestion Chips (UI) **Usage:** Powers the Portfolio → Down Payment Bridge feature for Austin markets, and the
real estate search/compare features. Cited in agent responses as _"ACTRIS/Unlock MLS
January 2026"_.
Four rows of suggestion chips, visible before first message: ### Supporting: Federal Reserve Survey of Consumer Finances 2022
**Row 1 — Portfolio (always shown):** Public data. Age-group wealth percentiles (25th, median, 75th, 90th) from the Fed's most
recent SCF. Hard-coded in `agent/tools/wealth_visualizer.py`.
- 📈 My portfolio performance **Usage:** Powers the Wealth Gap Visualizer. Cited in agent responses as
- ⚠️ Any concentration risk? _"Federal Reserve SCF 2022"_.
- 💰 Estimate my taxes
**Row 2 — Property Tracking (when `enableRealEstate=true`):** ---
- 🏠 Add my home to track equity ## The CRUD Operations (Explicit)
- 📊 Show my total net worth
- 💰 What are my equity options?
**Row 3 — Life Decisions (when `enableRealEstate=true`):** | Operation | Function | What It Does |
| ---------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
| **CREATE** | `add_property(address, purchase_price, current_value, mortgage_balance)` | Inserts new property into SQLite, calculates equity, returns property dict with ID |
| **READ** | `get_properties()` / `list_properties()` | Selects all active properties, returns with equity, appreciation, and summary totals |
| **UPDATE** | `update_property(id, current_value=..., mortgage_balance=...)` | Updates specified fields, recalculates equity and appreciation_pct |
| **DELETE** | `remove_property(id)` | Sets `is_active=0` (soft delete), property no longer appears in active list but data preserved |
- 💰 Can my portfolio buy a house? **Bonus:** `get_total_net_worth(portfolio_value)` aggregates equity across all active
- ✈️ I have a job offer — is it worth it? properties + adds investment portfolio → returns complete financial picture.
- 🌍 How long until I'm stable if I move?
**Row 4 — Strategy (when `enableRealEstate=true`):** ---
- 📊 Am I ahead or behind financially? ## The Impact
- 👶 Can I afford to have kids?
- 🏘️ What if I buy a house every 2 years?
--- The app solves a real problem. Most people with both investments and real estate have no
single place to see the complete picture or run scenarios on their own numbers.
## Tool Architecture A user adds their home (bought $400k, worth $480k, mortgage $310k) and immediately sees
$170k equity tracked alongside their $94k investment portfolio — **total net worth $264k
in one view.**
``` They then ask: _"What if I buy a home every 2 years for the next 10 years and rent the
wealth_bridge.py previous one?"_
├── calculate_down_payment_power(portfolio_value, cities)
│ → 7 Austin markets (ACTRIS) or any cities (Teleport)
│ → can_afford_full / conservative / safe + monthly payment
│ → rent vs buy comparison + break-even years
├── calculate_job_offer_affordability(salaries, cities)
│ → COL-adjusted purchasing power for any two cities worldwide
│ → state income tax comparison
│ → verdict + breakeven salary needed
└── get_portfolio_real_estate_summary()
→ reads live Ghostfolio portfolio + runs down payment calc
property_tracker.py
├── add_property(address, prices, mortgage)
├── get_properties() / list_properties()
├── update_property(id, new_values)
├── remove_property(id) ← soft delete
└── get_total_net_worth(portfolio_value)
real_estate.py (Austin — real ACTRIS MLS data)
├── search_listings(query, filters)
├── get_neighborhood_snapshot(location)
├── compare_neighborhoods(city_a, city_b)
└── get_listing_details(listing_id)
teleport_api.py (global — 200+ cities)
├── search_city_slug(city_name) ← resolves to Teleport slug
└── get_city_housing_data(city_name)
→ live Teleport API → normalized schema → fallback if down
relocation_runway.py
└── calculate_relocation_runway(salaries, cities, portfolio_value)
→ months to 3mo/6mo emergency fund + down payment
→ compare stay vs move milestones
wealth_visualizer.py
└── analyze_wealth_position(portfolio, age, income, ...)
→ Fed Reserve percentile + retirement projection
→ what-if: save more / retire earlier
life_decision_advisor.py
└── analyze_life_decision(decision_type, user_context)
→ orchestrates wealth_bridge + runway + visualizer
→ returns verdict + tradeoffs + next steps
family_planner.py
└── plan_family_finances(city, income, ...)
→ childcare costs for 25+ cities (US + global)
→ income impact + alternatives + international comparison
```
--- The agent asks what appreciation and rent assumptions they want to use — because we do not
guess at numbers for markets we cannot verify. The user says "moderate — 4% appreciation."
The agent runs the projection using their actual portfolio balance, their income, and their
assumptions, and returns a year-by-year picture of what their net worth could look like at
retirement.
## Evals & Verification This is a conversation people pay financial advisors **hundreds of dollars per hour** to
have. This app does it in 30 seconds — honestly, with the user's own numbers, and with
- **100 fast-passing tests (deterministic, no network)** clear disclaimers about what is a projection vs. a prediction.
- Tests by feature:
- 60 portfolio tests (holdings, performance, tax, compliance)
- 13 property tracker tests (full CRUD cycle, equity, net worth)
- 7 real estate strategy simulator tests (user assumptions, presets, disclaimer)
- 4 property onboarding tests (add, list, net worth, graceful empty)
- 6 wealth gap visualizer tests (Fed Reserve benchmarks)
- 4 equity unlock advisor tests (3-option analysis)
- 6 family financial planner tests (global childcare data)
- Additional async integration tests (wealth bridge, relocation runway,
life decision advisor) that require network access
- LangSmith tracing active at smith.langchain.com
- `/real-estate/log` observability endpoint
- Structured error codes on all tool failures (`REAL_ESTATE_PROVIDER_UNAVAILABLE`,
`PROPERTY_TRACKER_NOT_FOUND`, `PROPERTY_TRACKER_INVALID_INPUT`, etc.)
- All tools registered in LangGraph with conversation history maintained
- Feature flag: `ENABLE_REAL_ESTATE=true` activates all real estate + wealth bridge features
--- ---
## New Files Added in This Submission ## Eval & Verification
| File | Purpose | - **182 tests** (100% pass rate) covering portfolio logic, CRUD flows, strategy simulation,
| ------------------------------------------- | ----------------------------------------------------------------- | edge cases, adversarial inputs, and multi-step chains
| `agent/tools/teleport_api.py` | Global city COL + housing data (200+ cities) | - **3 verification systems:** confidence scoring, source attribution (citation enforcement),
| `agent/tools/wealth_bridge.py` | Down payment power + job offer COL calculator | and domain constraint check (no guaranteed-return language)
| `agent/tools/relocation_runway.py` | Month-by-month stability timeline for any relocation | - **LangSmith tracing** active — every request traced at `smith.langchain.com`
| `agent/tools/wealth_visualizer.py` | Fed Reserve wealth benchmarks + retirement projection | - All tool failures return structured error codes (e.g., `PROPERTY_TRACKER_NOT_FOUND`)
| `agent/tools/life_decision_advisor.py` | Orchestrates tools into complete life decision verdict | - Conversation history maintained across all turns via `AgentState.messages`
| `agent/tools/family_planner.py` | Financial impact of children for 25+ cities worldwide |
| `agent/tools/realestate_strategy.py` | Multi-property buy-and-rent strategy simulator (user assumptions) |
| `agent/evals/test_wealth_bridge.py` | Integration tests for wealth bridge features |
| `agent/evals/test_relocation_runway.py` | Integration tests for relocation runway calculator |
| `agent/evals/test_wealth_visualizer.py` | 6 tests for wealth gap visualizer |
| `agent/evals/test_life_decision_advisor.py` | Integration tests for life decision advisor |
| `agent/evals/test_equity_advisor.py` | 4 tests for equity unlock advisor |
| `agent/evals/test_family_planner.py` | 6 tests for family financial planner |
| `agent/evals/test_realestate_strategy.py` | 7 tests for strategy simulator (user assumptions, presets) |
| `agent/evals/test_property_onboarding.py` | 4 tests for property onboarding flow |
| `agent/data/` | SQLite database directory for property persistence |
| `BOUNTY.md` | This file |
## Modified Files
| File | Change |
| ---------------------------------------- | --------------------------------------------------------------- |
| `agent/tools/real_estate.py` | Expose real ACTRIS data_source in responses + TX footer |
| `agent/tools/property_tracker.py` | Full SQLite CRUD + analyze_equity_options function |
| `agent/graph.py` | Strategy simulator routing + assumption extraction + onboarding |
| `apps/client/.../ai-chat.component.html` | Personal tracking chips replacing market data chips |
| `apps/client/.../ai-chat.component.scss` | Amber gold (Row 3) + purple/violet (Row 4) chip styling |

Loading…
Cancel
Save