From Usable to Reliable: Configuration Practices for AI Agents
This article explains why general-purpose AI agents often degrade from impressive demos into simple Q&A bots in real production environments, and how to fix the underlying engineering gaps. It covers five core capability engines—identity and memory, perception and retrieval, multimodal output, cost and efficiency, and ecosystem navigation—along with a seven-step rollout plan, quantifiable acceptance criteria, and common anti-patterns. The goal is to help teams build agents that stay stable and useful in real business scenarios rather than remaining one-off demo surprises.
1. Background: Why “Works Out of the Box” Is Often an Illusion
Many teams share the same disappointment after adopting a general-purpose AI Agent: the demo looks impressive, but once it enters real business workflows, it degrades into a “chatbot with a UI.” The typical symptoms fall into four categories:
- Context fragmentation: Key information is not preserved across sessions, so users have to repeat their background, terminology, and preferences every time.
- Limited perception: The agent cannot reliably access external web pages or structured data, and it fails when facing pagination, login states, or dynamically rendered content.
- Narrow output formats: It can only produce plain text, with no support for voice interaction or image-based output.
- Uncontrolled cost: Repeated long-context replay and redundant tool calls drive up both token consumption and response latency.
It is important to emphasize that most of these issues are not caused by insufficient model capability, but by missing engineering links. An agent is a system composed of a model, context management, tool invocation, permissions, and auditing. If any link is missing, overall performance falls back to the weakest one. The right approach is therefore not to switch to a stronger model, but to complete the engineering chain.
2. Five Core Capability Engines: Building the Foundation
1. Identity and Memory Engine: Who It Is and What It Remembers
The identity layer determines output stability. In practice, a layered role definition is recommended: the global layer defines values and boundaries (no fabricating facts, no unauthorized actions), the role layer defines the position, input/output contracts, and delivery format, and the task layer states only the current objective. Role files should remain readable plain text to support version control and review.
The memory layer is best split into three parts:
- Short-term memory: The current session window, responsible for reference resolution and task continuity.
- Working memory: Structured task state (goals, constraints, completed steps, pending confirmations).
- Long-term memory: Cross-session preferences and facts, which must carry source, timestamp, and confidence, and support updates and expiration.
An illustrative memory entry structure (pseudocode, showing field design only):
MemoryItem {id, scope(global|role|task),content, source, confidence, created_at, expire_at}
There are three key engineering constraints: deduplicate and resolve conflicts before writing; rank by a mix of relevance and freshness during retrieval; and mask and tier-access sensitive fields. Being forgettable matters more than being memorable—long-term memory without an expiration mechanism will keep polluting the context.
2. Perception and Retrieval Engine: How Wide Its View of the World Is
External information access should be designed in layers, rather than pushing every problem onto a single scraping action:
- Single-page reading: Main content extraction and structured field parsing.
- Batch collection: Task queuing with controlled concurrency and retries, plus incremental updates and deduplication.
- Dynamic rendering scenarios: Use an isolated browser runtime with clear timeout and resource limits.
- Compliant access: Respect site terms and rate limits, access only publicly available content, and never bypass authentication or access controls.
Engineering must build in three gates: a domain and content allowlist, rate and concurrency limits, and a failure fallback path (clearly report missing data when retrieval fails instead of fabricating it). The “retrieve–cite–generate” loop should be connected end to end, requiring outputs to carry sources and timestamps for human review.
3. Multimodal Output Engine: Whether It Can Listen, Speak, and Draw
Multimodality is not about stacking capabilities, but about choosing the most economical channel for each task. The voice side typically includes recognition and synthesis, where accuracy in noisy environments and end-to-end latency matter. The image side needs a clear boundary between generation and understanding, and generated results should carry parameter records for reproducibility. The engineering recommendation is to encapsulate modality capabilities behind a unified capability interface, so upper-layer tasks only declare input and output types while the scheduling layer decides the implementation. This makes replacement and gradual rollout easier.
4. Cost and Efficiency Engine: Where the Money Goes
The core of cost governance is reducing ineffective context. Practical measures include:
- Layered context compression and summarization, keeping only conclusions and decisions from history.
- Truncating and structuring tool return values to avoid feeding back entire pages of text.
- Routing strategy: simple tasks go to smaller models or rules, while complex tasks are escalated.
- Cache reuse: identical retrievals and identical prompts hit the cache.
- Full-chain instrumentation: track input, output, and tool-call consumption per session to locate abnormal amplification points.
Note that actual savings depend heavily on task shape and implementation quality; no fixed number should be treated as a universal promise. Build your own baseline and run A/B comparisons, letting data speak.
5. Ecosystem and Navigation Engine: Where Capabilities Come From
Catalog role templates, tool adapters, knowledge bases, and evaluation sets into a searchable capability map, annotated with applicable scenarios, prerequisites, and risk levels. When new members join, checking the catalog first significantly reduces duplicated work.
3. Phased Rollout: Seven Steps to Complete the Chain
- Define boundaries: List what the agent “must do, may skip, and must never do.”
- Write the identity: Establish global and role-level plain-text definitions under version control.
- Add memory: Start with short-term and working memory, then gradually roll out long-term memory and expiration policies.
- Connect retrieval: Begin with single-page reading, then expand to batch and dynamic scenarios while adding allowlists and rate limiting.
- Complete output: Add voice and image capabilities as business needs require, behind a unified capability interface.
- Tune cost: Establish a consumption baseline, then enable compression, truncation, routing, and caching one by one.
- Close the evaluation loop: Build a fixed evaluation set covering accuracy, citation traceability, latency, and cost, and run regression checks on every change.
4. Acceptance Criteria and Common Anti-Patterns
Acceptance should use quantifiable thresholds, such as cross-session retention rate of key information, proportion of verifiable citations, task completion rate, average consumption per task, and timeout rate. There are four common anti-patterns: role definitions written as marketing copy (missing input/output contracts), long-term memory without an expiration mechanism, generating output anyway when retrieval fails, and optimizing prompts without instrumenting the pipeline.
If you want to use managed capabilities such as memory storage, task queues, logging and monitoring alerts, or containerized runtimes (for example, the object storage, message queue, container platform, logging, and monitoring and alerting product categories offered by Baidu AI Cloud), treat them as a replaceable infrastructure layer connected through standard interfaces, avoiding tight coupling with business logic.
5. Conclusion
The experience gap of general-purpose agents is essentially a gap in engineering completeness. Completing identity, memory, perception, output, cost, and ecosystem in priority order, and establishing an evaluation and observability loop, is what allows an agent to run stably in real business over the long term, rather than remaining a one-off surprise in the demo stage.
