Skip to main content

Agentic Patterns

ICE provides a persistent substrate for autonomous agents, resolving state management overhead in long-running multi-step workflows.

1. Tool-Calling Persistence

ICE maintains the continuity of tool_calls and tool_results across extended reasoning chains.

  • Native Compatibility: Supports standard tool-calling schemas for OpenAI, Anthropic, and Google Gemini.
  • Asynchronous State Management: Automatically archives historical tool interactions to the Semantic Ledger while pinning the most recent results to the active context window.
  • JSON Pinning: Ensures critical tool payloads remain available in the prompt prefix across turns — agents do not need to re-request results they already received.

2. Model Context Protocol (MCP) Integration

ICE is designed as a primary substrate for MCP servers.

  • Context Overflow Prevention: Large MCP tool outputs (repository structures, database schemas, etc.) are ingested directly into the session ledger, making them available for retrieval across subsequent turns without exceeding the model's physical context limit.
  • Persistent Reasoning: Allows agents to access numerous tools and vast datasets without exceeding physical token limits.

3. Implementation Specification

Tool Result Injection

When an application executes a tool locally, the result is returned to the ICE endpoint. ICE verifies the payload against the schema and updates the session state.

# Injection of tool execution results into the Persistent Context
response = ice.chat.completions.create(
model="gpt-4",
session_id="agent_task_001",
messages=[
{"role": "assistant", "content": None, "tool_calls": [call_metadata]},
{"role": "tool", "tool_call_id": "call_123", "content": "{\"status\": \"success\"}"}
]
)

4. Operational Guardrails

  • Protocol Detection: ICE identifies JSON/XML tool call patterns and ensures raw payloads are returned to the client for execution.
  • Transparent Switching: Automatic detection of tool-calling intent across different LLM providers, ensuring consistent cross-provider agentic behavior.
  • Output Budgeting: Dynamic allocation of tokens for agentic reasoning turns (ICE_DYNAMIC_OUTPUT_BUDGET).

See API Reference for the full request format including tool call message structure.