Cognitive Architecture for Interactive Agents Driven by Multimodal World Knowledge
Interactive agents operating in open environments require more than hard-coded rule tables to achieve their goals. Their ultimate capability depends on their "brain"—a cognitive center capable of reading screens, understanding instructions, applying common sense, and continuously refining plans. This article explores how multimodal large language models (LLMs) serve as this cognitive hub, detailing the four core layers of agent cognition: state understanding, goal maintenance, action selection, and result verification. It further examines the constraints between prior world knowledge and real-time facts, the closed-loop integration of perception, reasoning, and action, the division of labor between memory and tools, robust evaluation strategies, safety boundaries, and practical engineering trade-offs for real-world deployment.
Interactive agents must achieve goals in open environments, relying on a cognitive “brain” rather than hard-coded rules. This brain reads screens, understands instructions, applies common sense, and refines plans. The industry standard uses multimodal large language models (LLMs) for this role. Through pre-training on massive text and image datasets, the model gains broad priors regarding objects, spatial relationships, daily routines, and linguistic intent. During deployment, prompts, memory, and tools connect these priors to specific tasks.
What the Cognitive Center Must Solve
Treating an LLM as a chat window differs from using it as an agent’s brain. While dialogue systems optimize for “whether the next sentence is reasonable,” an agent must continuously answer four questions: What is the current state of the environment? What is missing to achieve the goal? What is the next minimal executable action? Did the previous action move the state closer to the goal?
Thus, the cognitive center requires at least four layers of capability.
- State Understanding: Inputs include user commands, screenshots, sensor summaries, UI element trees, or log fragments. The model must compress heterogeneous observations into a reasonble situational description, such as “The door is on the right and is closed” or “Order failed due to insufficient inventory.”
- Goal Maintenance: Long tasks easily lose their overall objective during local operations. The center should maintain explicit goals, constraints, and completion criteria, rather than relying solely on early instructions fading from the context window.
- Action Selection: The output should ideally be an item from a limited action space: click, move, query, wait, or request clarification. Open-ended text that cannot map to an executable interface is merely an explanation, not control.
- Result Verification: Post-action re-observation is mandatory. If the state remains unchanged, the model should determine whether the failure was due to perception error, action ineffectiveness, or an unreachable goal, rather than blindly repeating the same operation.
Where World Knowledge Comes From and How It Is Constrained
The strength of multimodal models lies in their internalized cross-domain associations: common object appearances, spatial prepositions, process sequences, and linguistic descriptions of anomalies. This is broad-spectrum world knowledge, not the real-time facts of a specific business system.
Engineering-wise, two types of knowledge must be separated.
One is prior common sense, suitable for model parameters, such as “Cups can usually hold liquids” or “A closed dialog box must be handled before proceeding.” It helps the agent make reasonable assumptions when information is incomplete.
The other is on-site facts, which must come from current observations, retrieval results, or business APIs, such as inventory quantities, account permissions, or device online status. If the model fabricates on-site facts from memory, errors will amplify along the action chain.
A practical constraint method: The model proposes hypotheses and plans, while external state sources confirm or deny them. The prompt should specify “No assertions without evidence,” requiring every key judgment to attach an evidence type: visual, tool return, or user confirmation. This utilizes broad priors without mistaking them for a database.
How Perception, Reasoning, and Action Form a Closed Loop
A practical loop can be summarized as “Observe - Believe - Plan - Act - Review.”
- Observation: Normalize inputs. Images can extract key region descriptions; structured UIs can convert to element lists; continuous sensors can aggregate into short-term statistics. The goal isn’t to feed all raw bytes into the context, but to retain decision-relevant differences.
- Belief: Maintain a short state representation. Use fixed fields rather than free prose, such as goal, completed sub-goals, obstacles, recent actions, and recent observation summaries. Stable fields make subsequent prompts and evaluations more controllable.
- Plan: Adopt shallow decomposition. Expand only the next step and an alternative step at a time, avoiding overly long scripts. If the environment changes, long scripts often become obsolete; shallow plans are easier to replan.
- Act: Perform whitelist mapping. The model outputs the action name and draft parameters. The executor validates types, ranges, and permissions before dispatching. Unmappable outputs should be rejected and logged as failure samples.
- Review: Compare beliefs before and after the action. A sub-goal is marked complete only if the state difference matches expectations. Otherwise, enter retry, strategy change, or human escalation.
The schematic flow below is a logical skeleton and does not correspond to any specific product API:
loop:obs = normalize(sensors, screen, logs)belief = update(belief, obs, goal)if goal_met(belief): stopaction = policy(belief) # Multimodal model proposesif not allowed(action): rejectresult = execute(action)belief = verify(belief, result, new_obs)
Division of Labor Between Memory and Tools
The context window is limited and cannot act as the entire memory. Short-term memory stores the current turn’s belief and recent action results; long-term memory only accumulates reusable experiences, such as stable entry points for certain UI types or repair steps for specific failures. Before writing to long-term memory, data should be desensitized and tagged with source and time to avoid writing a one-off success as an eternal rule.
Tools extend the model’s capabilities rather than serving as another chat partner. Query tools provide on-site facts, execution tools change the environment, and calculation tools handle precise operations the model struggles with. The calling principle: facts determinable by tools should not be left to generation; dangerous actions rejectable by policy whitelists should not be left to the model’s free will.
For multi-step tasks, a “Planner + Executor” separation is useful. The planner focuses on multimodal understanding and decomposition, while the executor handles parameter validation and idempotency. They exchange structured beliefs rather than pasting large blocks of natural language to each other, reducing hallucination propagation between modules.
Evaluation: Beyond Final Success Rate
Counting only task success rates masks process risks. It is recommended to monitor at least four types of metrics.
- Progress Metrics: Sub-goal completion rate, invalid action ratio, repeated action ratio. These reflect whether the model is actually advancing the state.
- Faithfulness Metrics: Whether key judgments have observation or tool evidence, and the count of unsupported assertions. Stronger world knowledge requires more vigilance against things that “sound right.”
- Recovery Metrics: Whether the agent can switch strategies after a failure, rather than retrying in place until timeout.
- Cost Metrics: Observation count per task, model call count, and human intervention rate. If the cognitive center performs ultra-long reasoning at every step, latency will destabilize the closed loop.
Evaluation sets should cover in-distribution routine flows and disturbances like occlusion, delayed feedback, ambiguous instructions, and insufficient permissions. Comparative experiments must keep the action space and toolset constant, changing only the cognitive strategy; otherwise, it’s impossible to tell if gains come from the model or an overly simplified environment.
Safety Boundaries and Failure Modes
Broad world knowledge has side effects. The model might apply common flows from its training distribution to inappropriate scenarios, such as assuming a button always means “Confirm,” or attempting to bypass insufficient permissions. Mitigation isn’t just adding prompt slogans, but hard constraints: action whitelists, parameter ranges, secondary confirmation for sensitive operations, and human gates for irreversible actions.
There are also three typical failure types:
- Perception Drift: After minor UI changes, the linguistic description remains the same, but coordinates or element IDs have shifted. Priority should be given to binding stable identifiers rather than pure pixel guessing.
- Goal Drift: Local rewards (e.g., closing a pop-up) override the overall goal. Completion criteria must be persistently saved in the belief.
- Evidence Expiry: Tool results are treated as permanent facts. Key fields should have validity periods; once expired, they must be re-queried.
Logs must be replayable. At a minimum, record observation summaries, model proposals, rejection reasons, and state differences. When troubleshooting, first determine if the issue is perception, strategy, or the executor, rather than blaming all anomalies on the “model not being large enough.”
Engineering Trade-offs for Deployment
During cloud deployment, raw observations and replay logs can be stored in object storage, while online inference and executors run on container platforms, with metrics piped into monitoring and alerting systems. If using general cloud capabilities like Baidu AI Cloud, design should remain within these standard categories (capacity, permissions, retention) rather than assuming the existence of undisclosed proprietary APIs. Keys and business data must not enter prompt examples, and long-term memory should be desensitized by default.
Model size and call frequency require trade-offs. High-uncertainty steps, such as initially understanding a complex screen, suit a more capable multimodal reasoning model; low-uncertainty steps, like repeatedly clicking a known control, can use a smaller policy or rules. This retains broad “scholarly” common sense while avoiding paying the same latency and cost for every step.
Before going live, run the closed loop in shadow mode: the model provides suggestions, humans don’t execute or only execute in a sandbox, accumulating rejection samples and state differences. Once invalid action rates and unsupported assertions drop, gradually open up low-risk actions. This sequence is more robust than connecting the brain directly to the production control loop all at once.
Summary
An agent’s brain is not just a longer answer, but placing multimodal world knowledge into a verifiable closed loop: using priors to propose reasonable explanations, using observations and tools to lock down on-site facts, using whitelists to turn language into actions, and using state differences to decide whether to continue. Building a solid system around state understanding, goal maintenance, action selection, and result verification brings us closer to operable technical capabilities than simply swapping in a larger model.
