Skip to content

MCP Logic Chain

The MCP Logic Chain is a propreitary feature of the Hi platform that allows your agents to access and use MCP servers in an extremely efficient manner. It mimics real world human thought processes, allowing your agents to feel more natural and engaging. This feature is currently in beta, constantly evolving and improving.

Logic Chain Lifecycle

Phase 1: Evaluation

When a user interacts with your agent, their message is sent to a the agent's processing node. This processing node initializes the context of the current conversation, character personality, and any other relevant information such as embedded knowledge, memories, etc. If an MCP server is integrated with your agent, the configured tools and resources are injected as available actions.

Below is a diagram showing the evaluation process:

MCP Chain Evaluation Diagram
View

If the agent determines that it does need to gather more context, and has an MCP integration to do so, it will start the MCP Logic Chain. This is a parallel process that allows the agent to access different MCP servers and gather the necessary information to form a complete response.

Phase 2: Context Gathering

Once the MCP Logic Chain is started, the agent dictates which MCP tools to call. It can call one or multiple tools at the same time, depending on the user's request. If it's a resource query, the resource is gathered and injected into the context of the conversation. If it's a tool query, the tool call is injected into the context and the result is injected as once completed.

MCP Chain Runtime Diagram

Phase 3: Quality Response Generation

After the MCP Logic Chain is complete, the steps the agent went through are injected as inner thoughts in context. This allows the agent to use the MCP tool responses to form a complete and high-quality response to the user. They will respond in the same way they would normally, using their full personality and memories, allowing for quick and natural responses.