- Purpose: Central orchestrator for all agent activities
- Responsibilities:
- Mode switching (Research/Case)
- Context management
- State synchronization
- Message routing
- Purpose: Handles legal research and document analysis
- Capabilities:
- Document search and analysis
- Citation extraction
- Legal precedent matching
- Contract drafting assistance
- Source verification
- Purpose: Manages case-specific operations
- Capabilities:
- Case context tracking
- Document organization
- Timeline management
- Client information handling
- Case-specific contract drafting
- Short-term: Current conversation context
- Long-term: Previous cases and research
- Vector Store: Semantic search capabilities
- Document Store: File management
sequenceDiagram
User->>Agent Controller: Research Query
Agent Controller->>Research Agent: Process Query
Research Agent->>Vector Store: Search Documents
Vector Store-->>Research Agent: Relevant Results
Research Agent->>Memory System: Update Context
Research Agent-->>Agent Controller: Formatted Response
Agent Controller-->>User: Display Results
sequenceDiagram
User->>Agent Controller: Case Query
Agent Controller->>Case Agent: Process Query
Case Agent->>Memory System: Load Case Context
Case Agent->>Vector Store: Search Case Documents
Vector Store-->>Case Agent: Case-Specific Results
Case Agent->>Memory System: Update Case State
Case Agent-->>Agent Controller: Formatted Response
Agent Controller-->>User: Display Results
- Current mode (Research/Case)
- User preferences
- Authentication state
- Active case/research context
- Chat history
- Document cache
- UI state
- Form data
- Case records
- Document metadata
- User settings
- Search history
-
VectorDB (Redis):
- Document embeddings
- Semantic search
- Context storage
-
Backend (Supabase):
- User management
- Document storage
- Case management
- Activity logging
- Text Generation: Response creation
- Document Analysis: Content extraction
- Classification: Query routing
- Embedding: Semantic search
- Automatic retry for transient failures
- Graceful degradation
- State rollback capabilities
- User feedback mechanisms
- Network failures
- Model errors
- Rate limiting
- Data validation
- Response caching
- Document caching
- Embedding caching
- Context memoization
- Request batching
- Lazy loading
- Progressive enhancement
- Resource pooling
- End-to-end encryption
- Secure storage
- Access control
- Audit logging
- Content filtering
- Rate limiting
- Input validation
- Output sanitization