Skip to content
trendoviz

AI Tools & Products · Launch

Google Adds Mid-Conversation Instructions to Gemini API

Developers can now update rules and tools mid-session without invalidating the prompt cache.

Published
  • 2 min read
  • 1 source
  • Stated by the source itself

Summary

Google has released a preview feature for the Gemini API that allows developers to update system instructions or tools during a conversation while preserving the prompt cache. This update targets long-running agents that need to adapt to new rules and permissions across many turns.

Key facts

  • Feature: Mid-conversation system instruction and tool updates via the Interactions API
  • Availability: Currently in preview
  • Target Users: Developers building long-running agents
  • Platform: Google Gemini API
  • Mechanism: Uses a new 'system_input' step that preserves the prompt cache
  • Tool Updates: Supported via 'added_tools' and 'removed_tools' parameters
  • Auditing: Retrieved interactions show system_input steps in the trace

Details

Previously, updating system instructions or changing tools between conversation turns would invalidate the prompt cache. This forced the model to reprocess the entire conversation history, increasing both latency and cost. To work around this, developers could either send instructions as user messages, which carried less weight, or rewrite the system instruction, which broke the cache.

The new Interactions API introduces the 'system_input' step. This step can be sent at any turn and carries the same authority as the top-level system instruction. It takes precedence over user messages, and conflicting instructions follow the most recent rule. All preceding tokens remain identical and can reuse the prompt cache.

Tool updates are also supported. Since changing the top-level tools list breaks the cache, developers are advised to keep the same list on every turn and use 'added_tools' and 'removed_tools' to modify which functions the model can call. The feature is currently limited to function tools and does not support MCP server tools.

Why it matters

This update enables the creation of more robust and dynamic AI agents. For developers, it provides a more efficient way to manage complex conversations, such as support agents or troubleshooting bots, where permissions, rules, and available tools can change mid-session without incurring the performance penalties of cache invalidation. It allows agents to adapt to new constraints and permissions in real-time.

What's next

The feature is currently in preview. Developers can try it using the Interactions API. The sources do not mention a specific release date or a full rollout schedule.

Sources

Original source: Google AI blog

Industry ·

Alibaba releases Qwen4-35B-A3B, a cheaper open model

Alibaba's Qwen4-35B-A3B model, with 35 B parameters but only 3 B active, supports image input, handles up to 1 M tokens, and costs $0.55 per task—about six times cheaper than its predecessor.

1 source

Found an error? Report it.