Skip to main content
Using Mind Layer

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.

Create Agent5mKnowledge Base5mImport Portfolio5mSet Goals5mBuild Chat10mRead State5m= 35 min total

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.

1

Create the Agent

5 min

Define 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.

setup.ts
1import { Sonzai } from "@sonzai-labs/agents";
2
3const client = new Sonzai(); // uses SONZAI_API_KEY env var
4
5// Create a fintech advisor — idempotent, safe to re-run
6// 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 cite
15 data before making recommendations. You remember every
16 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});
30
31console.log(agent.agentId); // "atlas-fintech"
2

Load the Knowledge Base

5 min

Give 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.

knowledge.ts
1// Load financial product data into the Knowledge Base
2await 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});
36
37// Search the knowledge base
38const 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

3 links

Acme Bond Shield

bond_fund

2 links

Acme Life Protect

term_life

1 links

S&P 500 Index

market_data

5 links

12

Products

8

Relations

34

Facts

3

Import User Portfolio

5 min

Load 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.

portfolio.ts
1// Import the user's portfolio into the Inventory System
2await 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});
39
40// Query portfolio value
41const portfolio = await client.agents.inventory.query("atlas-fintech", "user-sarah", {
42 mode: "list",
43 itemType: "stock",
44 aggregations: ["total_value"],
45});
S

Sarah Chen

Moderate Risk · 47 sessions

Total Portfolio

$190,841

+38.2% all time

AAPL150 shares

$29,775

+39.5%

MSFT80 shares

$34,016

+49.2%

VOO200 shares

$102,550

+34.9%

Cash

$24,500

4

Set Financial Goals

5 min

Goals 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.

goals.ts
1// Create personalized financial goals for this user
2await 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});
10
11await 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});
18
19// Read all goals — Atlas will proactively work toward these
20const goals = await client.agents.getGoals("atlas-fintech", {
21 userId: "user-sarah",
22});
23
24console.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// ]
30
31// Update goal progress after a trade
32await 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

Reduce tech concentration < 60%high
35%

In Progress

Build 6-month emergency fundmedium
68%

On Track

Protect client capitalhigh
100%

Active

5

Build the Chat Experience

10 min

Atlas 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.

chat.ts
1// Chat — Atlas has full context: portfolio, goals, products, memory
2const 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});
8
9console.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 savings
15// Your tech concentration is at 70% — I'd recommend we look at
16// diversifying, which aligns with the goal we set last week."
17
18// Stream follow-up conversation
19for 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}
27
28// Read what Atlas remembers about Sarah
29const memories = await client.agents.memory.search("atlas-fintech", {
30 query: "risk tolerance investment preferences",
31 userId: "user-sarah",
32});
33
34// See the full relationship map
35const constellation = await client.agents.getConstellation("atlas-fintech", {
36 userId: "user-sarah",
37});

Live Session Preview

S

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)

A
S

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)

A
6

Read Agent State

5 min

See 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.

state.ts
1// Read Atlas's relationship with Sarah
2const relationships = await client.agents.getRelationships("atlas-fintech", {
3 userId: "user-sarah",
4});
5// { trust_level: 0.85, rapport: "high", interactions: 47, ... }
6
7// Check Atlas's current mood after a volatile market day
8const mood = await client.agents.getMood("atlas-fintech", {
9 userId: "user-sarah",
10});
11// { primary: "concerned", intensity: 0.6, trigger: "market_volatility" }
12
13// Atlas's diary — what it's been thinking about
14const diary = await client.agents.getDiary("atlas-fintech", {
15 userId: "user-sarah",
16});
17
18// Read back facts the agent has extracted from conversations
19const 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

Moderate risk tolerance
Prefers dividend-paying stocks
Wants to retire by age 55
Uncomfortable with crypto

Time to Market

From zero to fintech agent.

1
Create Agent
5 min5m elapsed
2
Knowledge Base
5 min10m elapsed
3
Import Portfolio
5 min15m elapsed
4
Set Goals
5 min20m elapsed
5
Build Chat
10 min30m elapsed
6
Read State
5 min35m elapsed
35 minutesto a production-ready 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.

Enterprise

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.

2
Free consultation30-min call with founders
3
Receive your proposalAccess at proposals.sonz.ai
100% free consultationCustom proposal within 48hNo commitment required