Build with Mind Layer SDK
Ship a Fintech Agent in Under an Hour
Load financial products into a knowledge base, import user portfolios into the inventory system, set goals, and chat — all with persistent memory across every session.
The Problem
Fintech Chatbots That Forget Everything
Most fintech chat experiences are stateless wrappers around LLMs. They can't access your portfolio, don't know your financial products, and forget every conversation. Building real financial intelligence from scratch takes months.
No Product Knowledge
The agent doesn't know your financial products, rates, or insurance offerings. Every response is generic advice that could come from anywhere.
No Portfolio Context
It can't see the user's holdings, balances, or transaction history. Asking 'how's my portfolio?' returns a blank stare.
No Persistent Goals
Financial planning requires tracking goals over weeks and months. Stateless agents can't follow through on diversification plans or savings targets.
Create the Agent
5 minDefine your financial advisor's personality.
One API call creates an agent with Big Five personality traits, speech patterns, and built-in goals. Atlas is configured to be methodical, data-driven, and cautious — exactly what you want in a financial advisor.
1import { Sonzai } from "@sonzai-labs/agents";23const client = new Sonzai(); // uses SONZAI_API_KEY env var45// Create a fintech advisor — idempotent, safe to re-run6// Omit agentId to auto-derive from name, or set explicitly:7const agent = await client.agents.create({8 name: "Atlas",9 agentId: "atlas-fintech",10 projectId: "proj_acme-wealth",11 gender: "neutral",12 bio: "Senior financial advisor specializing in portfolio management and market analysis.",13 personalityPrompt: `You are Atlas, a seasoned financial advisor.14 You speak with clarity and confidence. You always cite15 data before making recommendations. You remember every16 client's risk tolerance and investment goals.`,17 big5: {18 openness: 0.7,19 conscientiousness: 0.95,20 extraversion: 0.5,21 agreeableness: 0.8,22 neuroticism: 0.15,23 },24 toolCapabilities: { web_search: true, inventory: true },25 initialGoals: [26 { title: "Protect client capital", type: "persistent", priority: "high" },27 { title: "Identify growth opportunities", type: "persistent", priority: "medium" },28 ],29});3031console.log(agent.agentId); // "atlas-fintech"Load the Knowledge Base
5 minGive Atlas your financial products.
Insert your bank's mutual funds, bond products, insurance offerings, and market data into the knowledge base. Atlas can search and reference this data in conversations — with relationships between entities preserved.
1// Load financial product data into the Knowledge Base2await client.knowledge.insertFacts("proj_acme-wealth", {3 facts: [4 {5 entityType: "financial_product",6 name: "Acme Growth Fund",7 properties: {8 type: "mutual_fund", risk: "moderate",9 ytd_return: "12.4%", expense_ratio: "0.45%",10 min_investment: 5000, category: "large-cap growth",11 },12 },13 {14 entityType: "financial_product",15 name: "Acme Bond Shield",16 properties: {17 type: "bond_fund", risk: "low",18 ytd_return: "4.2%", expense_ratio: "0.20%",19 min_investment: 1000, category: "investment-grade bonds",20 },21 },22 {23 entityType: "insurance_product",24 name: "Acme Life Protect",25 properties: {26 type: "term_life", coverage: "$500,000",27 monthly_premium: "$45", term_years: 20,28 },29 },30 ],31 relationships: [32 { from: "Acme Growth Fund", to: "Acme Bond Shield", type: "complements" },33 ],34 source: "product-catalog-sync",35});3637// Search the knowledge base38const results = await client.knowledge.search("proj_acme-wealth", {39 query: "low risk investment options",40 limit: 5,41});Knowledge Base
Acme Growth Fund
mutual_fund
Acme Bond Shield
bond_fund
Acme Life Protect
term_life
S&P 500 Index
market_data
12
Products
8
Relations
34
Facts
Import User Portfolio
5 minLoad holdings into the inventory system.
The inventory system tracks per-user assets — stocks, ETFs, cash, and any other items your app needs. Batch import from your database, and the agent can query balances, calculate gains, and reference holdings in real time.
1// Import the user's portfolio into the Inventory System2await client.agents.inventory.batchImport("atlas-fintech", "user-sarah", {3 items: [4 {5 action: "add", itemType: "stock",6 description: "150 shares of AAPL",7 properties: {8 ticker: "AAPL", shares: 150,9 avg_cost: 142.30, current_price: 198.50,10 sector: "technology",11 },12 },13 {14 action: "add", itemType: "stock",15 description: "80 shares of MSFT",16 properties: {17 ticker: "MSFT", shares: 80,18 avg_cost: 285.00, current_price: 425.20,19 sector: "technology",20 },21 },22 {23 action: "add", itemType: "etf",24 description: "200 shares of VOO",25 properties: {26 ticker: "VOO", shares: 200,27 avg_cost: 380.00, current_price: 512.75,28 sector: "index",29 },30 },31 {32 action: "add", itemType: "cash",33 description: "Savings account balance",34 properties: { balance: 24500, account: "savings", currency: "USD" },35 },36 ],37 projectId: "proj_acme-wealth",38});3940// Query portfolio value41const portfolio = await client.agents.inventory.query("atlas-fintech", "user-sarah", {42 mode: "list",43 itemType: "stock",44 aggregations: ["total_value"],45});Sarah Chen
Moderate Risk · 47 sessions
Total Portfolio
$190,841
+38.2% all time
$29,775
+39.5%
$34,016
+49.2%
$102,550
+34.9%
$24,500
Set Financial Goals
5 minGoals that persist across every session.
Create financial goals tied to each user. Atlas will proactively reference these goals during conversations, track progress over time, and adjust recommendations to stay aligned with the user's financial plan.
1// Create personalized financial goals for this user2await client.agents.createGoal("atlas-fintech", {3 title: "Reduce tech sector concentration below 60%",4 description: "Sarah's portfolio is 70% tech. Recommend diversification over next 3 months.",5 userId: "user-sarah",6 type: "user_specific",7 priority: "high",8 relatedTraits: ["conscientiousness", "risk_awareness"],9});1011await client.agents.createGoal("atlas-fintech", {12 title: "Build emergency fund to 6 months expenses",13 description: "Current savings $24,500. Target $36,000 based on monthly expenses.",14 userId: "user-sarah",15 type: "user_specific",16 priority: "medium",17});1819// Read all goals — Atlas will proactively work toward these20const goals = await client.agents.getGoals("atlas-fintech", {21 userId: "user-sarah",22});2324console.log(goals);25// [26// { title: "Reduce tech sector concentration...", status: "active", priority: "high" },27// { title: "Build emergency fund...", status: "active", priority: "medium" },28// { title: "Protect client capital", status: "active", priority: "high" },29// ]3031// Update goal progress after a trade32await client.agents.updateGoal("atlas-fintech", goals[0].goalId, {33 userId: "user-sarah",34 description: "Tech exposure reduced to 65% after selling 30 AAPL shares. Continue.",35});Active Goals
In Progress
On Track
Active
Build the Chat Experience
10 minAtlas knows everything. Just ask.
When a user chats, Atlas automatically pulls from the knowledge base, inventory, goals, and memory. No RAG pipeline to build. No context assembly. It just works.
1// Chat — Atlas has full context: portfolio, goals, products, memory2const response = await client.agents.chat({3 agent: "atlas-fintech",4 messages: [{ role: "user", content: "What's my portfolio balance?" }],5 userId: "user-sarah",6 sessionId: "session-001",7});89console.log(response.content);10// "Your portfolio is currently valued at $167,041. Here's the breakdown:11// - AAPL: 150 shares × $198.50 = $29,775 (+39.5% gain)12// - MSFT: 80 shares × $425.20 = $34,016 (+49.2% gain)13// - VOO: 200 shares × $512.75 = $102,550 (+34.9% gain)14// - Cash: $24,500 in savings15// Your tech concentration is at 70% — I'd recommend we look at16// diversifying, which aligns with the goal we set last week."1718// Stream follow-up conversation19for await (const event of client.agents.chatStream({20 agent: "atlas-fintech",21 messages: [{ role: "user", content: "Should I sell some AAPL to buy bonds?" }],22 userId: "user-sarah",23 sessionId: "session-001",24})) {25 process.stdout.write(event.content ?? "");26}2728// Read what Atlas remembers about Sarah29const memories = await client.agents.memory.search("atlas-fintech", {30 query: "risk tolerance investment preferences",31 userId: "user-sarah",32});3334// See the full relationship map35const constellation = await client.agents.getConstellation("atlas-fintech", {36 userId: "user-sarah",37});Live Session Preview
What's my portfolio balance? And should I be worried about the tech concentration?
Your portfolio is at $167,041— up 38.2% overall. Here's the thing: you're at 70% tech exposure between AAPL and MSFT. We set that diversification goal last week, and I'd recommend moving 10% into Acme Bond Shield. It's low-risk with a 4.2% YTD return, and it complements your growth positions. Want me to model what that rebalance would look like?
Context: inventory (portfolio) · knowledge base (products) · goals (diversification) · memory (risk tolerance)
What about the life insurance I asked about last month?
Right — you mentioned wanting term life coverage when we discussed your retirement-by-55 plan. Acme Life Protect offers $500K coverage at $45/month for a 20-year term. Given your age and the emergency fund we're building, this fits well. I can walk you through the details whenever you're ready.
Context: memory (previous conversation) · knowledge base (insurance product) · goals (retirement plan)
Read Agent State
5 minSee what your agent knows, feels, and remembers.
Every interaction builds state. Read back relationships, mood, diary entries, and extracted facts to power dashboards, analytics, or compliance audits. The Mind Layer tracks it all automatically.
1// Read Atlas's relationship with Sarah2const relationships = await client.agents.getRelationships("atlas-fintech", {3 userId: "user-sarah",4});5// { trust_level: 0.85, rapport: "high", interactions: 47, ... }67// Check Atlas's current mood after a volatile market day8const mood = await client.agents.getMood("atlas-fintech", {9 userId: "user-sarah",10});11// { primary: "concerned", intensity: 0.6, trigger: "market_volatility" }1213// Atlas's diary — what it's been thinking about14const diary = await client.agents.getDiary("atlas-fintech", {15 userId: "user-sarah",16});1718// Read back facts the agent has extracted from conversations19const facts = await client.agents.memory.listFacts("atlas-fintech", {20 userId: "user-sarah",21 category: "financial_preferences",22});23// [24// "Sarah has a moderate risk tolerance",25// "Sarah prefers dividend-paying stocks",26// "Sarah wants to retire by 55",27// "Sarah is uncomfortable with crypto investments",28// ]Agent State
Relationship with Sarah
0.85
Trust
High
Rapport
47
Sessions
Current Mood
Cautiously Optimistic
Triggered by: recent market recovery
Remembered Preferences
Time to Market
From zero to fintech agent.
Knowledge base, portfolio tracking, financial goals, persistent memory, and intelligent chat — all running on your own frontend. No RAG pipelines. No vector databases. No months of infrastructure work.
What the Mind Layer Gives You
Everything a fintech agent needs. Built in.
Knowledge Base
Insert your financial products, market data, and documentation. The agent searches and references it automatically during conversations.
Inventory System
Track per-user portfolios, balances, and assets. Batch import holdings, query values, and the agent can reference them in every response.
Goal Tracking
Set financial goals that persist across sessions. The agent proactively works toward them, tracks progress, and adjusts recommendations accordingly.
Persistent Memory
Every conversation builds long-term memory. The agent remembers risk tolerance, preferences, and past advice across weeks and months.
Constellation
Visualize the knowledge graph connecting users, products, goals, and interactions. Perfect for compliance dashboards and relationship mapping.
Your Frontend, Your Data
Build any UI you want. The Mind Layer is a backend API — your data stays on your infrastructure, called from your own servers.
Want a custom Fintech AI Employee for your platform?
Tell us what you need. We'll pair you with our CTO and a dedicated engineering team, and deliver a custom proposal — at no cost.