All Projects
ALPHA ADVISOR

ALPHA Advisor

A LangGraph multi-agent wealth-advisory copilot that plans, retrieves, grades, and cites — then pauses for a human before any client-facing word ships.

ALPHA Advisor object

In wealth advisory, a confident wrong answer isn't a hallucination — it's a compliance incident.

The Problem

Advisory copilots fail in two ways. They retrieve plausible-but-shallow context and miss the risk that actually matters, and they auto-generate client-facing language with no governance gate and no defensible trail. A vector store will happily surface the right-sounding paragraph while completely missing that a portfolio's true exposure is hidden three hops away across issuers and sectors. And when a regulator asks 'who approved this, and on what basis?', a black-box generation has no answer.

The Approach

I built a stateful LangGraph loop: plan, then retrieve across both a vector store and a knowledge graph, grade the retrieval and rewrite-and-retry if it's thin, pull live market context, run a compliance pass, and draft with citations. Before anything finalizes, the graph hits a LangGraph interrupt() — a real human-in-the-loop gate — and resumes only on an explicit Command(resume) decision. Every node writes to a tamper-evident, hash-chained audit log. The graph is stateless over a pluggable checkpointer (InMemory or Postgres), so any replica can resume any paused run.

Key Insight

The knowledge graph earned its place by finding what vectors couldn't: traversing client → holding → issuer → sector surfaced 78% multi-hop issuer concentration that semantic search never connected. The deeper lesson is that the human gate isn't a bottleneck to optimize away — it's the product. Making the interrupt durable, the audit hash-chained, and the providers swappable (mock | ollama | azure) is what turns a clever demo into something a compliance officer would actually sign off on.

78%
Hidden Concentration Found
3
Swappable Providers
HITL
Governance Gate
Audit
Tamper-Evident

How it works

The architecture behind the system.

Stateful LangGraph Loop

Plan → retrieve → grade → market tool → compliance → cited draft → human review → finalize. A grade node rewrites the query and retries when retrieval quality is too thin to draft from.

GraphRAG Concentration Risk

A networkx knowledge graph traverses client → holding → issuer → sector to surface multi-hop issuer concentration that pure vector retrieval structurally cannot see.

Human-in-the-Loop Governance

LangGraph interrupt() pauses the run before any client-facing output. The graph resumes only on an explicit Command(resume) decision via a dedicated /decision endpoint.

Tamper-Evident Audit Trail

Every node appends to a hash-chained audit log, so the full reasoning and approval path is reconstructable and any after-the-fact edit is detectable.

Provider-Portable & Resumable

Swap providers (mock | ollama | azure) with no graph changes. A stateless graph over a pluggable checkpointer (InMemory | Postgres) lets any replica resume any paused run.

Observable by Design

OpenTelemetry emits per-node spans across the whole loop, and task-based model routing sends each step to the right model — all streamed to the client over FastAPI SSE.

Built with

PythonLangGraphAzure OpenAInetworkx (GraphRAG)FastAPIServer-Sent EventsOpenTelemetryPostgres CheckpointerOllama

See the code

Full source code available. See exactly how it's built.

View on GitHub