Memory is derived context, not truth.
Applicant facts, approved decisions and source versions live in the case database. Agent memory may hold consultant preferences or reviewed lessons, but it must carry tenant, case, source, sensitivity, approval and supersession metadata.
Eight retrieval namespaces
Tenant and case filters are applied before retrieval. Similarity ranking never expands the authorization boundary.
Twelve strongest workflow and memory references
LangGraph
Typed graph state flows through nodes/edges. Checkpoints persist threads; interrupts pause and later resume with human input.
- Use
- Branching draft/ask/approve/validate flows.
- Missing
- Authorization, case semantics and business audit.
Temporal
Deterministic workflow code replays from event history; activities perform side effects; signals and timers resume long waits.
- Use
- Reliable multi-day waits and failure recovery.
- Burden
- Service operations and deterministic worker discipline.
Restate
Journal-backed service handlers, virtual objects, durable promises and timers survive process failure.
- Use
- Stateful callbacks and exactly-once-style coordination.
- Risk
- Licence metadata and integration burden.
Trigger.dev
Deployed tasks use run IDs, retries, queues, concurrency controls and programmable human waitpoints.
- Use
- Fast TS long-task delivery.
- Missing
- Case/evidence semantics and RLS.
Inngest
Event-triggered functions split work into durable steps with retries, sleeps and cancellation.
- Use
- Lightweight integration workflow.
- Risk
- Licence and hosted-data boundaries.
Mem0
Processes messages into candidate memories, deduplicates/updates them and retrieves them later.
- Use
- Consultant preferences and reviewed lessons.
- Prohibited
- Authoritative applicant facts.
Zep
Stores conversation and structured context for later retrieval and assembly.
- Use
- De-identified context experiments.
- Missing
- Fact approval and regulatory authority.
Qdrant
Vectors plus payload metadata support filtered similarity search across tenant, case, namespace and edition.
- Use
- Derived chunk index after exact filtering.
- Boundary
- Never canonical document/evidence storage.
OpenFGA
Zanzibar-style relationship tuples answer whether an actor may perform an action on a case or artifact.
- Use
- Complex consultant/client/reviewer sharing.
- Trigger
- Only when RLS becomes intractable.
Open Policy Agent
Rego evaluates structured input and returns policy decisions separately from enforcement.
- Use
- Category, expiry, transition and submission gates.
- Trigger
- Large versioned rule catalogue.
Langfuse
Receives traces for model, retrieval and agent calls; versions prompts/datasets and compares runs.
- Use
- Which prompt/model/source produced a draft.
- Boundary
- Not the legal/business audit.
Promptfoo
Declarative tests run prompts/providers against assertions, metrics and red-team cases locally or in CI.
- Use
- Missing-fact, non-invention, category and injection tests.
- Fit
- First optional AI addition.
Closest combinations
| Composition | Best for | Decision |
|---|---|---|
| Supabase + LangGraph + Langfuse | Case data plus graph interrupts and traces | Balanced pilot after baseline |
| Supabase + Temporal + Langfuse | High-assurance durable execution | Later-scale option |
| Supabase + Trigger.dev + Promptfoo | Fast TypeScript pilot and regression | Alternative delivery path |
| LangGraph + OpenFGA + Qdrant + Promptfoo | Retrieval-heavy agent system | Still missing canonical case DB |
What remains custom
Case aggregate, source/edition manifests, claim/evidence lineage, consultant/client gap ownership, approval/declaration records, regulatory validators, append-only business audit, PII lifecycle, tenant-isolation tests and successful/incomplete fixtures.
Read the minimum-repo decision