SwitchboardAI is an intelligent intent routing system developed based on LangGraph and Ollama. It acts like a highly efficient switchboard, automatically identifying whether a user's input is an "emotional need" or a "logical inquiry," and accurately connecting the conversation to the most appropriate agent for processing.
demo.mp4
-
Intelligent Intent Routing: Utilizes Pydantic structured output to accurately determine the user's intent.
-
Dual Agent Architecture:
-
Emotional Agent: Focuses on emotional support and empathetic responses, suitable for psychological counseling or emotional expression.
-
Logical Agent: Focuses on fact analysis and information retrieval, with web search capabilities.
-
Multi-engine Dynamic Search: Integrates with the Tavily and DuckDuckGo search tools, automatically triggering when the Logic Agent needs external information.
-
State Cycle Management: Uses LangGraph to maintain session state, supporting information aggregation and reprocessing after tool calls.
The system workflow is shown in the diagram below:
-
Classifier: Receives input and classifies it as
emotionalorlogical. -
Emotional Path: Guides to a healing dialogue; ends upon completion.
-
Logical Path: Guides to factual answers. If a search is detected, a Tool Node is invoked to retrieve the results, which are then summarized by the logical agent.