File size: 923 Bytes
f3997d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
State definitions for the LangGraph multi-agent workflow.
"""
from typing import TypedDict, List, Dict, Optional, Annotated
import operator


class AgentState(TypedDict):
    """State for the multi-agent RAG system."""
    
    # User input
    query: str
    user_id: Optional[str]
    policy_ids: Optional[List[str]]  # NEW: Selected policy IDs
    
    # Chat history
    chat_history: Annotated[List[Dict], operator.add]
    
    # Routing decision
    agent_type: Optional[str]
    routing_reasoning: Optional[str]
    
    # Retrieved context (for RAG)
    context_chunks: Optional[List[Dict]]
    
    # Search results (for Search agent)
    search_results: Optional[List[Dict]]
    
    # Final response
    answer: Optional[str]
    sources: Optional[List]
    policy_names: Optional[List[str]]  # Policy document titles used in answer
    
    # Metadata
    metadata: Optional[Dict]
    error: Optional[str]