We Kept Rebuilding Our AI Agent. Here's What Survived - Fuad Ali, Arize AI

20:063 min readAI Engineer10/27/2026Computing/Software · Internet Technology

Key Takeaway

Building production AI agents requires moving complex planning, memory management, and execution control into deterministic harness code rather than relying entirely on frontier models or heavy agent frameworks.

Highlights

  • The in-product AI agent Alex uses custom harness code rather than a commercial agent framework to maintain full control over the loop, plans, stopping rules, and memory.

  • A single markdown file capped at 8,000 characters per user successfully replaced complex architectures like vector retrieval and temporal knowledge graphs for long-term memory.

  • Moving a to-do list tool into the harness code eliminated wasted LLM iterations where the agent spent most of its time checking off list items.

  • Truncating large JSON tool results within the response and allowing the agent to fetch specific data using JQ code prevents context window exhaustion.

  • Shifting from ten specialized sub-agents to a single agent that loads skills and tools on-demand simplified the architecture and improved performance.

Timeline

  1. Evolution and Architecture of Alex

    The development team spent two years refining Alex from a simple router over skills into a robust production agent. By keeping the execution loop, planning mechanism, and stop rules within custom harness code rather than prepackaged frameworks, the engineering team retained total control over agent behavior across different model providers.

    • Alex is the in-product AI agent inside the Arise AX platform that handles trace analysis, synthetic data creation, and multi-step task planning.
    • Early prototypes in late 2023 suffered from a 50 percent hallucination rate using early era models.
    • The architecture evolved from a basic skills router into a structured system powered by custom harness code without external agent frameworks.
  2. Core Design Decisions: Planning and Termination

    Initial attempts to let the agent manage to-do lists failed because the model became trapped in repetitive check-off cycles. The team transitioned the plan into the harness code, rendering current objectives alongside data inputs. Additionally, inconsistent termination behavior across different model providers necessitated an explicit finish gate enforced by the harness.

    • Allowing models to manage their own to-do lists resulted in wasted LLM calls spent updating lists rather than performing actual work.
    • Moving the plan into the harness code ensured the model received updated state context with each new call.
    • An explicit finish call enforced by the harness prevents infinite loops when models fail to terminate automatically.
  3. Managing Context Window and Long-Term Memory

    Large tool outputs, such as detailed agent traces, quickly overwhelm context windows if loaded directly. The system addresses this by truncating large results and letting the agent query specific data via code-like tools. For long-term memory, complex solutions like knowledge graphs were abandoned in favor of a straightforward, human-auditable markdown file managed by background scripts.

    • Treating massive tool results like external files instead of dumping raw JSON into the context window prevents context blowups.
    • A single markdown file capped at 8,000 characters per user outperformed vector stores and temporal knowledge graphs for long-term memory.
    • Background jobs update the user memory file after a session concludes, keeping the data auditable and safe.
  4. Simplifying Specialists and Selecting Models

    Maintaining ten separate specialist sub-agents created unnecessary complexity as model capabilities improved. The team streamlined the platform into a single agent capable of dynamically loading required skills. Rather than chasing every new frontier model, engineering efforts focus on optimizing harness code and utilizing smaller single-call models for isolated tasks.

    • The system consolidated ten page-specific specialist sub-agents into a single unified agent that loads necessary skills on demand.
    • The newest frontier model is not always the default choice, favoring fast and reliable models paired with strong harness logic.
    • Narrow tasks like filter generation bypass the agent loop entirely in favor of single model calls.
  5. Testing, Evaluation, and Permanent Best Practices

    Because agent bugs rarely appear as traditional software errors, the team relies on automated tools like Signal to flag anomalous behaviors such as redundant retry loops. Production sessions continuously expand the regression test suite. Six core practices, including executing math inside code rather than raw text and maintaining golden datasets in CI, survived every major architectural iteration.

    • Live production sessions automatically feed into regression datasets to serve as living test fixtures.
    • Agent bugs manifest as qualitative issues like repetitive tool loops rather than explicit syntax errors.
    • Core principles that survived all architectural rebuilds include trace monitoring, math execution via code, and CI regression datasets.

Description

Arize's in-product agent Alex went from a 2023 prototype that was "50% hallucination" to a single agent with planning, memory and on-demand skills, all built with custom harness code instead of a framework. AI PM Fuad Ali covers each decision: moving the plan into the harness, making "finish" an explicit gate, treating large tool results like files, why one 8,000-character memory file per user beat vector stores and knowledge graphs, merging 10 specialists into one agent, and using production sessions as tests. Chapters: 0:00 Intro 0:53 Agents all the way down 2:56 What Alex does 4:15 Timeline: 2023 to 2026 6:19 Who owns the plan? 8:33 What ends a turn? 9:44 Memory: treat big results like files 12:10 One small file beat a knowledge graph 13:33 Specialists vs. one agent 14:13 The newest model isn't always best 15:28 Production sessions as tests 17:46 What still needs a human 18:31 What survived every rebuild Fuad Ali https://arize.com Join us in SF for the second annual AIE CODE summit: https://aie.codes our last flagship summit of 2026. Applications live now!

Write about this video