Skip to content

Architecture Overview

FundAdmin AI is structured as three independent tiers that can be used together or separately.

FundAdmin AI Component Architecture

Three-Tier Architecture

T1 — Skills + CLI (MIT)
  skills/          62 Claude Code sub-skills
  agents/          5 LPA review agents
  fund/            /fund orchestrator
  mcp-vault-server/ MCP server + REST API

T2 — Obsidian Vault Template (MIT)
  fund-admin-vault/ FileClasses, dashboards, kanban boards

T3 — Commercial Webapp
  apps/web         Next.js 16 dashboard (port 3000)
  apps/worker      Background worker (no dedicated port)
  apps/ws          WebSocket sidecar (port 3002)
  packages/shared  Drizzle schema + shared types

Skill Routing (T1)

fund/SKILL.md is the orchestrator. It receives /fund <command> and routes to one of 62 sub-skills in skills/fund-*/SKILL.md. Each sub-skill is a standalone markdown file that instructs Claude how to perform a specific task.

5-Agent LPA Review Pipeline

/fund review-lpa launches five parallel agents via the Anthropic SDK directly (apps/web/src/lib/review-pipeline.ts). The CLI path no longer depends on the claude CLI binary.

5-Agent LPA Review Architecture

AgentRoleWeight
agents/fund-terms.mdTerm extraction & categorisation20%
agents/fund-risks.mdRisk scoring (1–10 per provision)25%
agents/fund-compliance.mdRegulatory compliance checks20%
agents/fund-obligations.mdObligations & timeline mapping15%
agents/fund-recommendations.mdNegotiation recommendations20%

The PDF is sent once with cache_control: ephemeral so all five agent calls share the cached prefix, significantly reducing API cost.

Port Assignments

ServicePort
Next.js webapp3000
MCP vault server REST API3001 (configurable via MCP_VAULT_API_PORT)
WebSocket sidecar3002

Data Flow

FundAdmin AI Data Flow

Obsidian Inbox (~/FundAdmin-AI-Vault/Inbox/)
    ↓ mcp-vault-server/watcher.js classifies PDFs
    ↓ apps/worker/src/inbox-watcher.ts (30s tick)
    ↓ /api/review/trigger
    ↓ apps/web/src/lib/review-pipeline.ts (Anthropic SDK)
    ↓ vault_write_review → Obsidian vault (.md + .json sidecar)
    ↓ Post-review hooks (wire, capital, compliance, investor, obligation, performance, reconcile, skill-chains)

Key Source Files

FilePurpose
apps/web/src/lib/review-pipeline.tsAnthropic SDK LPA review pipeline
apps/web/src/lib/reviews.tsRead review markdown from vault
apps/web/src/lib/vault.tsObsidian vault access
apps/worker/src/inbox-watcher.ts30s tick inbox scanner
mcp-vault-server/index.jsMCP server + REST API (port 3001)
mcp-vault-server/vault.jsFilesystem operations
mcp-vault-server/watcher.jsFile change watcher + classifier
packages/shared/src/schema.tsDrizzle database schema

T1 (skills + CLI) and T2 (vault template) are MIT licensed.