cd /news/artificial-intelligence/goldcrest-conversational-state-to-mo… · home › topics › artificial-intelligence › article
[ARTICLE · art-172088] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Goldcrest: Conversational State to Monte Carlo Parameters

A developer built Goldcrest, a household financial planning tool that replaces spreadsheet forms with a chat interface, where an LLM extracts income, expenses, assets and timeline assumptions and passes them to a deterministic Monte Carlo engine. The architecture keeps the model away from arithmetic: it extracts structured fields, a validation layer enforces type, range and consistency constraints, and a server-side parameter store pseudonymizes data before it reaches the LLM. A two-pass extraction approach asks follow-up questions only for low-confidence fields, and conflicting inputs across turns are flagged for the user to resolve.

recommendation

Split LLM extraction from deterministic computation: validate extracted parameters against explicit constraints and use a two-pass confidence check to ask follow-ups only for low-confidence fields.

more in playbook: Designing agent systems
by read5 min views4 publishedNov 18, 2026

Goldcrest is a household financial planning tool that replaces spreadsheet forms with a conversational interface. You answer short questions in a chat. The agent extracts income, expenses, asset values, and timeline assumptions, then feeds them into a Monte Carlo simulation that projects your financial trajectory across thousands of market paths.

The interesting plumbing is the boundary between the LLM-driven conversation layer and the deterministic financial engine. The agent must maintain dialogue state across multiple turns, validate inputs, resolve ambiguity, and serialize a complete parameter set without letting the LLM touch arithmetic or generate advice.

The system splits into three layers:

The agent never performs calculations. It extracts values and categories from user responses, writes them to the parameter store, and hands off to the engine. The engine produces every number in the projection.

User input (natural language)
    ↓
LLM extracts structured fields
    ↓
Validation layer (type checks, range constraints, consistency rules)
    ↓
Parameter store (server-side, pseudonymized for LLM calls)
    ↓
Monte Carlo engine (deterministic, no LLM involvement)
    ↓
Year-by-year projections + probability distributions

The LLM sees pseudonymized data when it needs context for follow-up questions. Actual dollar amounts and identifiable details stay on the server. The model receives tokens like <income_source_1> or <expense_category_2> instead of "salary from Acme Corp" or "mortgage payment."

The agent tracks which parameters it has collected and which are still missing. A typical rent-vs-buy scenario requires:

The agent maintains a checklist. After each user response, it updates the parameter store and decides whether to ask a clarifying question, move to the next category, or declare the parameter set complete.

When a user says "I make around 80k," the agent must resolve:

The system uses a two-pass approach. First pass: extract the stated value and write it to the parameter store with a confidence flag. Second pass: ask targeted follow-up questions only for low-confidence fields. This avoids the "20 questions" problem where every input triggers a cascade of clarifications.

If the user provides conflicting information across turns (e.g., "I spend $3k a month" followed later by "my rent is $2k and other expenses are $1.5k"), the agent flags the inconsistency and asks which figure to trust.

The parameter store enforces constraints before allowing a simulation run:

The validation layer runs after each parameter update. If a constraint fails, the agent asks a corrective question rather than proceeding with invalid inputs.

Parameter Constraint Failure Behavior
Annual income > 0, < $10M Reject, ask for correction
Monthly expenses > 0, < income + savings drawdown Warn, allow override
Down payment 0-100% of home price Reject if outside range
Mortgage rate 0.1%-20% Reject, flag as likely error
Asset allocation Sum to 100% ± 0.01% Reject, show current total
Retirement age 50-80 Warn if < 60 or > 75

The system allows overrides for warnings but hard-blocks on constraint violations that would break the simulation.

Once the parameter set passes validation, the system serializes it into a JSON structure:

{
  "income_streams": [
    {"source": "salary", "amount": 80000, "frequency": "annual", "growth_rate": 0.03}
  ],
  "expenses": [
    {"category": "housing", "amount": 2000, "frequency": "monthly", "inflation_adjust": true},
    {"category": "discretionary", "amount": 1500, "frequency": "monthly", "inflation_adjust": true}
  ],
  "assets": [
    {"type": "checking", "balance": 15000},
    {"type": "retirement", "balance": 120000, "allocation": {"stocks": 0.7, "bonds": 0.3}}
  ],
  "scenarios": [
    {"name": "rent", "housing_cost": 2000, "housing_type": "rent"},
    {"name": "buy", "housing_cost": 2500, "housing_type": "own", "home_price": 500000, "down_payment": 100000, "mortgage_rate": 0.065, "term_years": 30}
  ],
  "timeline": {"current_age": 32, "retirement_age": 65, "life_expectancy": 90},
  "simulation_params": {"iterations": 10000, "inflation_mean": 0.025, "market_return_mean": 0.07, "market_volatility": 0.15}
}

The Monte Carlo engine reads this JSON, runs 10,000 iterations with randomized market returns and inflation rates, and produces:

The engine writes results back to the parameter store. The frontend fetches them and renders charts.

The system pseudonymizes data before sending context to the LLM. The LLM never sees:

Instead, it receives abstract tokens and category labels. When the LLM generates a follow-up question, the server substitutes real values back in before displaying to the user.

This limits exposure if the LLM provider logs requests or if a prompt injection attack tries to exfiltrate data. The worst an attacker can extract is the structure of the conversation, not the financial details.

The agent uses a strict output schema. Every LLM response must be valid JSON with predefined fields:

{
  "next_question": "string",
  "extracted_values": {"field_name": "value"},
  "confidence": "high | medium | low",
  "needs_clarification": ["field_name"]
}

If the LLM returns anything outside this schema, the system rejects it and retries with a stricter prompt. This prevents the LLM from injecting arbitrary text or attempting to execute commands.

Incomplete parameter sets: If the user abandons the conversation halfway through, the parameter store is incomplete. The system blocks simulation runs until all required fields are populated. The agent can resume from the last saved state.

Garbage inputs: If the user provides nonsensical values ("I make negative $50k a year"), the validation layer catches it. But if they provide plausible but wrong values ("I spend $500 a month" when they actually spend $5000), the simulation runs with bad data. The system relies on the user to review and correct extracted values before finalizing.

LLM hallucination: The LLM might misinterpret a response and extract the wrong value. The system shows every extracted parameter to the user for confirmation. The user can edit any field before the simulation runs.

Market assumption drift: The Monte Carlo engine uses historical return and volatility distributions. If future market behavior diverges significantly, projections will be wrong. This is a modeling limitation, not a plumbing failure.

Use Goldcrest's pattern when:

Avoid this pattern when:

The key insight is treating the LLM as a data extraction tool, not a reasoning engine. The agent asks questions and parses answers. The deterministic engine does the math. This keeps the system auditable and prevents the LLM from generating financial advice or performing calculations it will get wrong.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @goldcrest 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/goldcrest-conversati…] indexed:0 read:5min 2026-11-18 · —