v1.0 · April 2026
Jugalbandi Architecture
Wealth management has a context problem, not a technology problem. The RM has portfolio data. The client has a life. Neither side sees the other. This is the architecture that connects them.
The Intelligence Graph
A living, per-client model that combines three signal types no other system connects
Every wealth platform has hard data. Positions, NAVs, transactions. That's table stakes. The Intelligence Graph is what happens when you add the two signal types no custodian provides: what the client does on their dashboard, and what the RM knows about the client's life.
- Positions across CAMS, KFintech, NSDL, CDSL
- NAV, units, avg buy price, XIRR per holding
- Transaction history, SIP schedules, dividends
- FD details, NPS balance, bank statements via AA
- Checked pharma holdings 6x between 2–5 AM
- Didn't open app for 11 days after a 4% drawdown
- Searched 'SGB maturity' three times in one week
- Exported portfolio PDF the day after a market fall
- "Daughter's wedding March 2026 — needs ₹2Cr liquid"
- "Doesn't trust structured products since 2008"
- "Responds well to data-backed reassurance, not optimism"
- "Patriarch makes all decisions. Son is a formality."
The second briefing reads like a senior colleague's note. It is produced entirely by the system, from signals the RM never had to think about collecting. That is the only design goal of the Intelligence Graph.
Data Pipeline
How custodian data flows into the graph — four integrations, one schema, zero floats
Custodian Integrations
| Custodian | Integration | Auth | Data Retrieved | Sync |
|---|---|---|---|---|
| CAMS (MF) | API + CAS Parser | OAuth 2.0 + PAN verification | Holdings, transactions, SIP details, dividends | Daily 6 AM IST |
| KFintech (MF) | API + CAS Parser | OAuth 2.0 + PAN verification | Holdings, transactions, SIP details | Daily 6 AM IST |
| NSDL (Demat) | CDAS API | Digital signature + 2FA | Equity holdings, corporate actions, IPO allotments | Real-time webhook |
| CDSL (Demat) | easi/easiest API | 2FA + OTP | Equity holdings, transactions | Real-time webhook |
| Account Aggregator | AA API (ReBIT spec) | Consent artifact (FI-based) | Bank statements, FDs, insurance, NPS | On consent, then scheduled |
Ingestion Pipeline
Market Data Feeds
| Source | Data | Frequency | Protocol |
|---|---|---|---|
| NSE (via Data Vendor) | Real-time equity prices, indices | Every 1s during market hours | WebSocket |
| AMFI NAV API | Mutual fund NAVs | Daily EOD (9 PM IST) | REST (amfiindia.com) |
| RBI Reference Rates | Currency rates, SGB prices | Daily | REST |
| BSE | Bond prices, debt instruments | Every 15s | REST API |
| CRISIL / ICRA | Credit ratings, bond yields | On change | Webhook |
The AI Layer
Not a chatbot. Not RAG. Full context window reasoning on the Intelligence Graph.
The AI layer reads the entire Intelligence Graph for a client — all three signal types, full history, RM notes, goals — and produces context. Not instructions. Not chat responses. Context that makes the RM's natural judgment produce the right action.
Models & Roles
| Model | Role in the thesis | Input | Latency |
|---|---|---|---|
| Claude Opus 3 | Deep synthesis — morning briefings, meeting prep, Council Mode (5-perspective analysis) | Full client Intelligence Graph | <8s |
| Claude Sonnet 3.5 | Context synthesis — pattern matching, action generation, weekly digests | Signal array + RM notes + holdings | <3s |
| Claude Haiku 3.5 | Real-time classification — every client action classified as it happens | Individual signal event | <500ms |
| text-embedding-3-small | RM note similarity search — “when did we last discuss this?” | Note text | <200ms |
Signal Detection 8 functions
| Function | What it detects | Model | Trigger |
|---|---|---|---|
classifySignal() | Type, severity, pattern match from raw telemetry | Haiku | Every client action |
detectAnxietyCluster() | Repeated holding checks in short windows — signals stress before the client calls | Sonnet | Hourly batch |
detectLoginAnomaly() | 2 AM logins, unusual devices, location changes | Rule-based | Every login |
classifySearchIntent() | What the client is worried about from their search query | Haiku | Every search |
detectGoalDrift() | Transactions that move away from the investment mandate | Rule-based + Haiku | Every transaction |
aggregateSignals() | Cluster all signals per client into a priority score | Sonnet | 6 AM daily |
detectExportPattern() | Unusual PDF exports — often precedes RM switch discussions | Haiku | Every export |
scoreEngagement() | 30-day trend — rising engagement vs risk of churn | Rule-based | Daily |
Context Synthesis 10 functions
| Function | What it produces | Model | Trigger |
|---|---|---|---|
generateMorningBrief() | Prioritized briefing for all clients — who needs a call today and why | Opus | 6 AM daily |
generateClientContext() | Full Intelligence Graph synthesis for one client on demand | Sonnet | On demand |
generateMeetingPrep() | Agenda, talking points, personality profile, risk flags — 2h before meeting | Opus | Calendar trigger |
synthesizeCouncilMode() | 5 parallel perspectives (Portfolio, Behavioral, Tax, Risk, Relationship) + synthesis | Opus | On demand |
matchHistoricalPattern() | “Last time this happened (Sept 2024)” — the sentence that changes RM behavior | Sonnet + Vector | With every synthesis |
generateActionItems() | Specific actions with owner, priority, deadline — never generic advice | Sonnet | With every synthesis |
generateThinkingChain() | Full transparency: which signals went in, what patterns were matched, why | Sonnet | With every synthesis |
scoreConfidence() | Confidence % on every synthesis output — RM sees the uncertainty | Rule-based | With every synthesis |
generateWeeklyDigest() | 7-day summary for RM — what changed, what to watch | Sonnet | Weekly |
summarizeForClient() | Strip RM-only context, produce client-safe version of the same analysis | Haiku | On demand |
Financial Calculations 12 functions
| Function | What it calculates | Implementation |
|---|---|---|
calculateXIRR() | Annualized return on irregular cashflows, SIP-aware | Newton-Raphson (in-house) |
calculatePortfolioXIRR() | Weighted XIRR across all holdings, multi-custodian unified | In-house |
calculateLTCG() | Long-term capital gains with Budget 2025-26 rules and grandfathering | In-house |
calculateSTCG() | Short-term capital gains at 20% rate | In-house |
calculateDebtTax() | Debt fund tax at slab rate, no indexation post-2023 | In-house |
simulateTaxHarvest() | Sell + rebuy vs hold: net tax savings with all costs factored | In-house + Haiku |
projectGoal() | Goal projection with probability distribution — 10,000 Monte Carlo runs | Monte Carlo (in-house) |
calculateAttribution() | Why did the portfolio return X? Brinson-Fachler decomposition. | In-house |
reconcileMultiCustodian() | Same ISIN across custodians — unify, flag conflicts, surface errors | Rule-based + Haiku |
calculateDayChange() | Today's P&L across all holdings in paisa | In-house |
formatIndianCurrency() | BIGINT paisa → “₹12,84,700” — Indian locale, lakh/crore grouping | Pure function |
calculateRebalance() | Trades to reach target allocation with tax impact and tracking error | Constraint optimization |
Supporting Functions 17 functions
trackPageView()trackHoldingCheck()trackSearchQuery()trackExportRequest()encryptMessage()decryptMessage()formatMessageForDisplay()detectFinancialFigures()generateDocumentSummary()trackMessageSentiment()enforceRLS()hashPAN()auditLog()validateSession()checkFATCA()validateInvestmentMandate()detectAMLPattern()The Dual Interface
Same Intelligence Graph. Two instruments. Each responds to the other's cues.
These are not two products. The client's behavior on their dashboard is intent data the RM never gets. The RM's context about the client is what makes the dashboard feel personally built. One graph. Two interfaces. A flywheel.
- Unified portfolio view across all custodians
- Attribution: why did my portfolio return X%?
- Tax impact simulation before rebalancing
- Document vault with full audit trail
- Encrypted messaging (WhatsApp-feel, not support ticket)
Graph
- Morning briefing: synthesized overnight changes across all clients
- Priority queue: ranked by signal urgency, not alphabetical
- Client deep-dive: full Intelligence Graph for meeting prep
- Post-meeting notes: feed directly back into the graph
- Council Mode: 5-perspective analysis for complex situations
From Client Action to RM Briefing
Morning Briefing Generation
Monorepo Structure
Security Architecture
UHNI clients demand this. Six layers from network edge to AI safety.
- Vercel Edge Network — global DDoS protection, 300+ PoPs
- HTTPS everywhere with HSTS preload header
- Rate limiting: 100 req/min per client, 500 req/min per RM
- Geo-restricted to India (configurable per deployment)
- Client: Magic link (email) — no passwords for UHNI. Google OAuth secondary.
- RM: SAML SSO via firm identity provider + OTP fallback
- Session: Supabase Auth (JWT, 1hr expiry, automatic refresh)
- Invite-only: no self-registration — clients onboarded by their RM
- Row Level Security (RLS) on ALL 13 tables — no exceptions
- Client role: sees own data only (client_id = auth.uid())
- RM role: sees assigned clients only (rm_id = auth.uid())
- RM Admin role: sees team clients (team matching)
- No cross-tenant data leakage possible at database level
- PAN: SHA-256 hashed with per-client salt — never stored raw
- Messages: AES-256-GCM end-to-end encryption — server cannot read
- Documents: encrypted at rest (AES-256) via Supabase Storage
- Account numbers: one-way hashed — displayed as masked (****1234)
- All money: BIGINT paisa — no floating point errors, ever
- Append-only audit log: every action recorded, no UPDATE or DELETE
- IP address + user agent + timestamp on every log entry
- RBI data residency: all data in India-region Supabase instance
- DPDP Act 2023: consent management, data minimization, right to erasure
- SEBI advisory: investment mandate validation on every transaction
- No PII in LLM prompts: client names anonymized before sending to Claude
- No financial advice in AI output: context and analysis only, never 'buy' or 'sell'
- Confidence scoring on all AI outputs: RM sees the % and contributing factors
- Human-in-the-loop: RM reviews and approves all AI-generated action items
- Thinking chain: full transparency on how every briefing was generated
Database Schema
13 tables. Every one with RLS. All money in paisa. The novel tables are highlighted.
The three Intelligence Graph tables — behavioral_signals, rm_context_notes, and context_snapshots — are what make this system different. Every other wealth platform has the first six tables. Only Jugalbandi has the last three.
Intelligence Graph Tables the novel ones
Core Tables every platform has these
Communication & Audit Tables
Key Relationships
clients.rm_id → relationship_managers.rm_idcustodian_accounts.client_id → clients.client_idholdings.account_id → custodian_accounts.account_idtransactions.holding_id → holdings.holding_idbehavioral_signals.client_id → clients.client_idrm_context_notes.rm_id → relationship_managers.rm_idcontext_snapshots.client_id → clients.client_idclient_goals.client_id → clients.client_idThe Flywheel
Why this gets better with every client interaction
The Intelligence Graph is not static. Every interaction enriches it. Better data produces better context. Better context produces better RM behavior. Better RM behavior produces better client experience. Better client experience produces more engagement. More engagement produces more behavioral signals. The loop accelerates.
Avg AUM ~50Cr per client. Each RM manages ~4,250Cr instead of ~2,000Cr. Revenue per RM more than doubles. Client NPS stays flat or improves.