Multimodal AI Agents: Visual Primitives and Tool Calling in Practice
This article examines why multimodal agents often fail at tasks such as counting objects or planning paths, and breaks the problem down into a perception gap and a referring gap. It compares two technical approaches—visual primitives and thinking with images—then covers agent configuration, evaluation and reproducibility, and layered architecture recommendations for production, including structured output, fallback channels, cost control, and observability.
1. Why Multimodal Agents “See but Cannot Explain”
Recent discussions around experimental multimodal models have drawn broad attention from the developer community. The focus is not on benchmark scores but on a more fundamental question: when a model is asked to count the people in a group photo or plan a feasible path through a maze, why does its performance fall noticeably short of the examples in the official paper?
To understand this, multimodal capability needs to be split into two layers. The first is perception: whether the model can convert pixels into recognizable semantic units. The second is reference: whether the model can point to specific objects in an image stably and unambiguously during reasoning. The industry usually calls a defect in the first layer a perception gap, and a defect in the second layer a referring gap. The former shows up as insufficient resolution, loss of detail, and OCR or counting errors. The latter is more subtle: the model “sees clearly,” but when it describes objects in natural language during chain-of-thought reasoning, it introduces noise, intermediate conclusions drift, and the final answer collapses.
A typical example is dense counting. If the model can only output natural-language references such as “the person on the left” or “the person in the red shirt in the middle,” the probability of reference conflicts and omissions rises quickly as the number of objects grows. In complex path planning, the model has to repeatedly refer to coordinates and regions, and the ambiguity of natural language gets amplified step by step. This is the root cause of why many multimodal agents perform well in demos but remain unstable in real scenarios.
2. Two Technical Approaches: Visual Primitives and Thinking with Images
Two representative lines of thinking have emerged around these problems.
The first is the visual primitives approach. Its core idea is to introduce structured, unambiguous pointers into continuous visual space—geometric objects such as points, bounding boxes, and polygons—so the model can reference these primitives directly during reasoning instead of relying on natural-language descriptions. The benefit is a significant reduction in referential ambiguity: counting tasks can light up target points one by one, localization tasks can return precise boundaries, and planning tasks can express a path as an ordered sequence of points. In engineering terms, such solutions usually need to reserve special tokens for geometric structures at the tokenization and serialization level, so the model can generate and parse structured output.
The second is the thinking-with-images approach. It does not force the introduction of new geometric tokens. Instead, it has the model repeatedly call visual tools across multiple reasoning turns—cropping, zooming, annotating, and re-reading the image—turning “looking at the image” into an iterative sequence of actions. Its advantage is generality and high compatibility with existing toolchains: the model can gradually approach the correct answer through multiple sampling rounds without changing the underlying representation. The cost is more tool calls and higher latency, plus greater demands on the orchestration layer of the agent.
The two approaches are not mutually exclusive. A pragmatic judgment is that structured primitives are better suited to tasks with clear geometric semantics, such as counting, localization, and form or layout understanding, while thinking with images is better suited to open-ended exploration and tasks that require multi-step verification. Real systems often need to choose dynamically between the two. This also explains why the same model family can show capability differences across different entry points and different outer frameworks—the difference usually comes from whether the outer orchestration actually enables the corresponding visual processing strategy.
3. Agent Configuration: From “It Runs” to “It Reproduces”
The first obstacle many teams hit when reproducing experiments is not model capability but runtime configuration. Common problems include command-line arguments that do not match the documentation, inconsistent configuration file formats, and outdated dependency versions that keep new features from taking effect.
It is worth standardizing the configuration process to avoid the awkward situation where something runs in the documentation but not locally:
# 1. Update the agent runtime to the latest stable versionnpm update -g @your-agent-cli# 2. Start in web mode to make intermediate steps easier to observeyour-agent-cli --profile web# 3. Explicitly specify the model and vision strategy in the config# config.json{"model": "vision-experimental","vision": {"strategy": "auto", // auto | primitive | think_with_images"max_tool_calls": 8,"image_detail": "high"}}
Three practices are recommended at the configuration level. First, make the vision strategy an explicit switch rather than an implicit default, which makes A/B comparison easier. Second, set an upper limit on tool calls to prevent reasoning from diverging and costs from spiraling. Third, pin dependency versions and put them under version control so experiment results stay reproducible. If you use a cloud environment, you can freeze the runtime with a container platform, store datasets and intermediate artifacts in object storage, and track call chains and failure rates with logging and monitoring with alerting.
4. Evaluation and Reproduction: Do Not Let Demos Drive Decisions
Demo videos and paper examples are usually curated and should not be used directly as a basis for selection. A more reliable approach is to build your own evaluation set covering the following dimensions:
- Perception: small object recognition, dense counting, text and table extraction;
- Reference: multi-object localization, attribute binding, relation judgment;
- Planning: maze and grid navigation, multi-step action sequences;
- Robustness: occlusion, low light, compression artifacts, rotation, and scaling.
Three points matter during evaluation. First, separate “model capability” from “outer framework capability”—score differences for the same model under different orchestration can exceed differences between models. Second, record intermediate steps rather than only the final answer, so you can tell whether an error comes from perception, reference, or reasoning. Third, watch stability metrics, such as the consistency rate across repeated runs on the same input, which is especially critical for production systems.
5. Engineering Recommendations for Production
For production environments, a layered architecture is recommended: visual encoding and parsing at the bottom, primitive generation and tool-call orchestration in the middle, and business logic and result validation on top. Key design points include:
- Prefer structured output. For counting and localization tasks, require the model to output point, box, or polygon structures, then run deterministic validation in code to avoid natural-language ambiguity.
- Dual-channel fallback. When the structured channel fails, fall back to the thinking-with-images channel and improve recall through multiple rounds of cropping and resampling.
- Cost and latency governance. Apply adaptive resolution to images, limit ineffective tool calls, and reserve high-cost strategies for hard samples.
- Observability. Fully log inputs, intermediate images, tool arguments, and final outputs to support regression analysis and problem localization.
6. Conclusion
The competitive focus for multimodal agents is shifting from “can it recognize” to “can it refer and reason stably.” Visual primitives and thinking with images represent two engineering philosophies—structured and general-purpose—and understanding the boundary between them is more valuable than chasing a single model metric. For developers, the real moat lies in a reproducible evaluation system, clear configuration management, and a robust layered architecture. Building these capabilities on mature infrastructure such as Baidu AI Cloud, combined with containerized deployment, object storage, and full-chain monitoring, turns experimental multimodal capability into a deliverable, operable business system.
