Case Management
Persona
Role: Software developer at a litigation firm managing 150+ active cases across multiple practice areas.
Attorneys track case details in personal notes, documents are scattered across network drives, and hearing dates are managed through individual calendar systems. The firm has no centralized view of its caseload, document deadlines, or upcoming court dates. Paralegals spend hours each week compiling status reports by polling individual attorneys.
Business Problem
Without a unified case management system, critical court deadlines are at risk of being missed, document versions conflict when multiple attorneys work on the same case, and client status inquiries require manual research. The firm needs a single platform where cases are tracked from filing through resolution, documents are organized and version-controlled per case, and hearing schedules are visible to the entire team. This scenario builds a case management workflow that provides firm-wide visibility into case status, documents, and court appearances.
Four-Step Application
This scenario works best as a four-step, human-in-the-loop application. The existing object model already gives this scenario a strong delivery backbone through Case, CaseDocument, and Hearing.
- Mission metric focus: faster matter turnaround, stronger risk control, and higher knowledge reuse.
- Human + AI pattern: Each step combines structured workflow data with chat assistance, background generation, document understanding, and accessible interaction patterns when they improve the experience.
Step 1. Capture demand and context
- Goal: Make it easy for the user to start the Case Management journey with complete, trusted context.
- Required data: Case context such as title, type, client, and status.
- AI support: Use chat to guide intake, generate clearer prompts, create accessible summaries, and assist with voice or vision-led capture when a form alone is not the best experience. EAI can support structured intake, chat workflows, and document-centred capture today; richer native multimodal capture may still need workflow extensions or connected services.
- Business impact: Improve completion rate, reduce first-touch effort, and raise customer or staff confidence in the UX from the very first interaction.
- EAI delivery: Model the intake as tenant-isolated object types and resources, then use actions, chat workflows, and document indexing or classification to keep the initial record complete and usable.
Step 2. Prepare the decision
- Goal: Turn the captured context into the next best action for Case Management without forcing the human reviewer to assemble the case manually.
- Required data: Case state and history; CaseDocument fields such as title, type, fileUrl, and confidential.
- AI support: Run background summarisation, extraction, classification, recommendation drafting, and answer generation so a reviewer sees a prepared case instead of raw fragments. EAI delivers the structured records and AI workflow hooks for this today; specialised scoring engines, external rules, or advanced reasoning controls may still need integration work.
- Business impact: Reduce cycle time, improve quality and consistency, and protect the mission-critical metric before the case moves into execution.
- EAI delivery: Link records across the scenario, persist decision state as resources, and use workflow actions plus chat assistance to keep humans in control while AI prepares the work.
Step 3. Execute and collaborate
- Goal: Coordinate the actual work, handoffs, approvals, and user updates needed to deliver the service or outcome.
- Required data: CaseDocument execution state; Hearing fields such as date, court, judge, and outcome.
- AI support: Draft replies, produce work packets, monitor exceptions in the background, and surface the next action for each operator. EAI can orchestrate tenant-isolated records, actions, chats, and document workflows today; deeper system-to-system automation may require additional connectors or workflow capability.
- Business impact: Increase operator productivity, reduce rework across handoffs, and improve service consistency across the application journey.
- EAI delivery: Use linked object types, actions, resource updates, and workflow-triggered AI assistance so the team can execute in one model instead of splitting work across disconnected tools.
Step 4. Resolve, explain, and improve
- Goal: Close the loop with a clear outcome, an understandable explanation, and feedback that improves the next case.
- Required data: final status, outcome, audit history, and follow-up signals across Case, CaseDocument, and Hearing.
- AI support: Generate outcome summaries, customer-friendly answers, compliance-ready notes, management insights, and accessible follow-up content. EAI can store outcome records and support answer generation today, while richer proactive agents, advanced analytics, or channel-specific accessibility features may need additional product capability.
- Business impact: Increase trust, quality, and measurable business value through faster matter turnaround, stronger risk control, and higher knowledge reuse.
- EAI delivery: Keep the full audit trail in structured resources, use AI workflows to explain outcomes, and feed the resulting signals into future product, service, and operational improvement work.
EAI Platform Support By Step
EAI provides the safe service boundary for Case Management through Object Types, tenant-scoped resources, document processing, chat workflows, and CLI verification. For this scenario, the main records are Case, CaseDocument, and Hearing.
| Process step | What EAI provides | Calling pattern |
|---|---|---|
| Step 1. Capture demand and context | Tenant-scoped intake resources for Case context such as title, type, client, and status. Object Type validation, starter forms, optional document intake, and chat-guided capture keep the first record complete. | Define fields in src/eai.config/object-types.ts, run eai types validate and eai types seed, create initial Case records with useResources('Case') or eai resources create Case, and keep browser calls behind /api/eai/.... |
| Step 2. Prepare the decision | Linked resource queries over Case state and history; CaseDocument fields such as title, type, fileUrl, and confidential. Search, schema checks, document classification or RAG indexing, and chat summaries turn raw context into a prepared decision. | Use useResources('Case') list/query/search patterns, verify shape with eai resources schema, use useDocuments().upload/classify/ragIndex, eai docs upload, eai docs classify, and eai docs index where supporting material exists, and send decision-support prompts through useChat(workflowId, 'chat') or eai chat send. |
| Step 3. Execute and collaborate | Resource updates and actions for CaseDocument execution state; Hearing fields such as date, court, judge, and outcome. Status changes, assignments, notes, generated work packets, and chat support keep humans in control during execution. | Model actions in the Object Type code, call client.resources.executeAction(type, id, action) or the app hook equivalent, update records through the app service layer, and verify with eai resources get/list/query. |
| Step 4. Resolve, explain, and improve | Outcome resources for final status, outcome, audit history, and follow-up signals across Case, CaseDocument, and Hearing. Audit-friendly links, indexed final documents, reporting snapshots, and answer generation make the result explainable and reusable. | Persist outcomes as resources, index final material with eai docs index or useDocuments().ragIndex, send explanation prompts with useChat or eai chat stream, and use eai resources aggregate/search for reporting checks. |
Prompt, Code, And Service Pattern Mapping
The Object Type code example on this page is the implementation contract for the EAI platform services. eai-gofer should read that code as the source of truth for which resource, document, and chat calls belong in the app.
Use this prompt shape when asking eai-gofer or another coding agent to implement the scenario:
Use the EAI App Template. Model Case Management with Object Types for Case, CaseDocument, Hearing. Use useResources for records and actions, useDocuments for uploads/classification/RAG where documents appear, useChat for workflow assistance, and verify with eai types/resources/docs/chat commands. Use eai publicapi only when no named command covers the required platform call.
| Scenario artifact | How it maps to EAI service calls |
|---|---|
| Four-step process | Step 1 becomes resource creation, Step 2 becomes resource query/search plus optional document or chat preparation, Step 3 becomes resource update/action calls, and Step 4 becomes outcome persistence plus explanation/reporting calls. |
| Object Type definitions | eai types validate, eai types seed, and eai resources schema make the model available and checkable before UI work starts. |
| Properties and indexes | Fields become useResources payloads, filters, list views, and eai resources create/list/query/search checks. Indexed fields should support lookup and triage, not duplicate canonical records. |
| Links between Object Types | Relationships become linked-resource UI, timeline context, and audit trails that app code loads through resource queries rather than separate bespoke stores. |
| Actions and status fields | Workflow buttons and operator transitions call resource action/update helpers, then verify state with eai resources get/list/query. |
| Document and chat prompts | Prompts should call the platform documents and chat patterns: useDocuments().upload/classify/ragIndex, eai docs upload, eai docs classify, and eai docs index for documents, and useChat, eai chat send, or eai chat stream for conversational assistance. |
Object Types
| Name | Key Properties | Links | Actions |
|---|---|---|---|
| Case | title (text), type (select: civil, criminal, corporate, family, ip), client (text), status (select: active, pending, closed, on-hold), filingDate (date) | one-to-many → CaseDocument, one-to-many → Hearing | closeCase |
| CaseDocument | title (text), type (select: pleading, motion, brief, correspondence, evidence), fileUrl (text), confidential (boolean), uploadedDate (date) | many-to-one → Case | -- |
| Hearing | date (date), court (text), judge (text), outcome (text), type (select: motion, trial, settlement, status-conference) | many-to-one → Case | -- |
CLI Workflow
-
Scaffold the project
eai init case-management -
Authenticate and pull environment
eai logineai env pull --include-secretsIf you are an external developer, see [Configuration](/docs/configuration) for login and local environment setup. -
Define your Object Types
Create the Case, CaseDocument, and Hearing types in
src/eai.config/object-types.ts(see code example below). -
Validate the type definitions
eai types validateTenant: case-management✔ Case — 5 props, 2 links, 1 action✔ CaseDocument — 5 props, 1 link, 0 actions✔ Hearing — 5 props, 1 link, 0 actions✔ All Object Types are valid -
Seed types to the platform
eai types seed -
Create sample resources
eai resources create Case --data '{"title": "Smith v. Acme Industries", "type": "civil", "client": "Robert Smith", "status": "active", "filingDate": "2025-03-20"}' -
Start local development
eai dev
Code Example
// src/eai.config/object-types.ts
export const objectTypes = {
'case-management': [
{
name: 'Case',
displayName: 'Case',
description: 'A legal case tracked by the firm',
properties: [
{ name: 'title', type: 'text' as const, required: true, indexed: true },
{ name: 'type', type: 'select' as const, required: true, options: [
{ label: 'Civil', value: 'civil' },
{ label: 'Criminal', value: 'criminal' },
{ label: 'Corporate', value: 'corporate' },
{ label: 'Family', value: 'family' },
{ label: 'IP', value: 'ip' },
]},
{ name: 'client', type: 'text' as const, required: true, indexed: true },
{ name: 'status', type: 'select' as const, required: true, defaultValue: 'active', options: [
{ label: 'Active', value: 'active' },
{ label: 'Pending', value: 'pending' },
{ label: 'Closed', value: 'closed' },
{ label: 'On Hold', value: 'on-hold' },
]},
{ name: 'filingDate', type: 'date' as const, required: true, indexed: true },
],
linkTypes: [
{ name: 'documents', targetObjectType: 'CaseDocument', cardinality: 'one-to-many' as const },
{ name: 'hearings', targetObjectType: 'Hearing', cardinality: 'one-to-many' as const },
],
actions: [
{
name: 'closeCase',
displayName: 'Close Case',
description: 'Mark a case as closed after resolution',
requiredRole: 'tenant-staff',
validationRules: { requiredStatus: 'active' },
sideEffects: [
{ type: 'set_field', field: 'status', value: 'closed' },
],
},
],
status: 'published' as const,
},
{
name: 'CaseDocument',
displayName: 'Case Document',
description: 'A document filed or received in connection with a case',
properties: [
{ name: 'title', type: 'text' as const, required: true, indexed: true },
{ name: 'type', type: 'select' as const, required: true, options: [
{ label: 'Pleading', value: 'pleading' },
{ label: 'Motion', value: 'motion' },
{ label: 'Brief', value: 'brief' },
{ label: 'Correspondence', value: 'correspondence' },
{ label: 'Evidence', value: 'evidence' },
]},
{ name: 'fileUrl', type: 'text' as const, required: true },
{ name: 'confidential', type: 'boolean' as const, required: true, defaultValue: false },
{ name: 'uploadedDate', type: 'date' as const, required: true, indexed: true },
],
linkTypes: [
{ name: 'case', targetObjectType: 'Case', cardinality: 'many-to-one' as const },
],
actions: [],
status: 'published' as const,
},
{
name: 'Hearing',
displayName: 'Hearing',
description: 'A court hearing or appearance scheduled for a case',
properties: [
{ name: 'date', type: 'date' as const, required: true, indexed: true },
{ name: 'court', type: 'text' as const, required: true },
{ name: 'judge', type: 'text' as const, required: false },
{ name: 'outcome', type: 'text' as const, required: false },
{ name: 'type', type: 'select' as const, required: true, options: [
{ label: 'Motion', value: 'motion' },
{ label: 'Trial', value: 'trial' },
{ label: 'Settlement', value: 'settlement' },
{ label: 'Status Conference', value: 'status-conference' },
]},
],
linkTypes: [
{ name: 'case', targetObjectType: 'Case', cardinality: 'many-to-one' as const },
],
actions: [],
status: 'published' as const,
},
],
};
Key Takeaways
- Firm-wide visibility: All active cases, their documents, and upcoming hearings are accessible from a single platform, eliminating the need for manual status report compilation.
- Document organization: Case documents are categorized by type and linked to their case, with confidentiality flags controlling access to sensitive materials.
- Court calendar integration: Hearing records with court, judge, and type data provide the firm with a complete view of upcoming court obligations across all cases.
- Case lifecycle tracking: The structured status flow from active through to closed ensures every case is accounted for and properly resolved.