Multi-Agent Processing Logic

  1. Request Initiation: The user sends a request to the orchestrator.

  2. Classifier: The system leverages an LLM to analyze the user's request, agent descriptions, and the conversation history of all agents to determine the current user ID and session ID. This comprehensive view enables the classifier to understand the ongoing interactions and context among all agents. The classifier identifies the most suitable agent for the following scenarios:

    1. New Queries Requiring a Specific Agent: For example, “I want to book a flight” or “What’s the base rate for a 20-year loan?”

    2. Follow-Ups from Previous Interactions: The user might provide brief responses, such as “Tell me more,” “Say it again,” or simply “12.” In these cases, the LLM identifies the agent that last responded and routes the follow-up appropriately.

  3. Agent Selection: The classifier selects the most appropriate agent and responds with the selected agent's name.

  4. Request Routing: The user’s input is routed to the chosen agent.

  5. Agent Processing: The selected agent processes the request. It automatically retrieves the conversation history associated with the current user ID and session ID. This ensures that each agent maintains its own context without needing access to other agents’ conversation histories.

  6. Response Generation: The agent generates a response, which can be sent in a standard response format or as a stream, depending on the agent's capabilities and initialization settings.

  7. Conversation Storage: The orchestrator automatically saves the user’s input and the agent’s response to storage associated with the specific user ID and session ID. This step is critical for maintaining context and enabling coherent multi-turn conversations.

  8. Response Delivery: The orchestrator delivers the agent’s response back to the user.

This workflow ensures that each request is handled by the most appropriate agent while maintaining the overall context of the conversation. The classifier has a global view of all agent interactions, whereas individual agents can only access their own conversation histories. This architecture enables intelligent routing and context-aware responses while preserving separation between agents’ functionalities.

Last updated