Briefing
Pre-meeting brief from CRM + portfolio + activity + news. Locale-aware. Read-only. No approval.
Every prompt walks through input guardrails, OPA policy, scoped RAG retrieval, output guardrails, Langfuse traces, and — for any state mutation — explicit human approval. Five use cases ship today.
Modir’s AI orchestrator is a separate sidecar — Python, FastAPI, LangGraph, NeMo Guardrails, Langfuse — that takes a structured request, walks it through a graph, and returns a structured response. Five graphs ship today: briefing (pre-meeting brief), commentary (locale-aware portfolio narrative), nba (next-best-action ranked suggestions), triage (service-request classification), and suitability_draft (compliance review draft). Each is opinionated about its inputs, its tools, and its output schema.
Every node in every graph is wrapped: input guardrails redact PII (regex for SSN, IBAN, Iqama, NIN), reject jurisdictionally inappropriate prompts, and confirm the actor’s role; OPA’s ai_actions package gates any tool call that would mutate state; output guardrails check toxicity, hallucination heuristics, and locale conformance; Langfuse captures the full trace span with token counts and cost. LiteLLM is the single LLM gateway — it routes to Anthropic Claude or OpenAI by default, enforces per-tenant rate limits and budget caps in Redis, and lets sovereign tenants pin a private model endpoint instead.
The hardest case is the mutation case. When AI suggests “open a service request” or “draft a suitability narrative for compliance review,” the suggestion does not run as the AI’s identity. Instead, it produces an AIInteraction row with status='pending_approval', and an aiInteractionWorkflow waits for a human approval signal. On approval, the actual mutation runs as an ordinary API call from the approving user’s identity — the audit log shows the human, with metadata.aiInteractionId linking back to the AI source. The regulator sees what a regulator should see: a human signed it, a human is responsible.
RAG is per-tenant. Embeddings live in pgvector, scoped by tenant_id at index time. At retrieval time, every chunk is checked against OPA data_access with the requester’s relationships from OpenFGA. A chunk the requester cannot read in the database, they cannot read in the AI either. There is no privilege escalation through retrieval.
Pre-meeting brief from CRM + portfolio + activity + news. Locale-aware. Read-only. No approval.
Drafts portfolio commentary in the user's locale. Read-only output; advisor edits before sending.
Ranked suggestions with cited reasons. Suggestion only — execution is always advisor-initiated.
Classifies inbound service requests. Auto-assignment requires approval; classification is informational.
Drafts a suitability narrative for compliance. Always approval-gated; compliance officer signs.
Add a graph: define inputs, tools, OPA policies, and the output schema; ship it through the same pipeline.
Maria’s portfolio is up 4.2% YTD. Quarterly review tomorrow. She raised concerns last quarter about tech concentration; AAPL is now 9.4% of the book — within tolerance but worth flagging. Cash position is $142k from a recent dividend; she usually re-invests within 14 days.
حقّقت محفظة سارة عائدًا قدره ٤٫٢٪ منذ بداية العام. مراجعة ربع سنوية غدًا. أبدت قلقًا في الربع الماضي بشأن التركّز في القطاع التقني؛ بلغت أرامكو ٩٫٤٪ من المحفظة—ضمن الحدود لكن يستحق الإشارة.
پرتفوی آرش از ابتدای سال ۴٫۲٪ بازده داشته است. جلسه بازنگری فصلی فردا. در فصل گذشته نگرانیهایی درباره تمرکز در صنایع فلزات داشتند؛ سهم فولاد اکنون ۹٫۴٪ از پرتفوی است.
Per-tenant daily ($) and monthly token caps live in Redis. LiteLLM consults them on every request. When a cap is hit, AI requests degrade gracefully — cached briefings continue to serve, new generation pauses, and the next day resumes. The cost per advisor stays predictable; “AI bill surprise” stops being a thing.
Every AI interaction writes to the chain. Approver and approved action are linked.
Featureai_actions.rego is the gate. Compliance officers edit it like any other policy.
FeatureAI output is locale-conformant; output guardrails reject mismatches before they reach the user.
We will run it through Modir's lifecycle, show you the OPA decisions, the Langfuse trace, and the approval flow. Two hours.