Source-linked AI summary

STEM Agent: A Self-Adapting, Tool-Enabled, Extensible Architecture for Multi-Protocol AI Agent Systems

Alfred Shen, Aaron Shen

arXiv:2603.22359v1cs.AI

TL;DR

Existing agent frameworks often commit to single protocols, fixed tool strategies, and static user models. STEM Agent combines a differentiable agent core with five protocols, MCP-mediated capabilities, adaptive user and behavior modeling, memory, and skill acquisition; its 413-test suite passes in 2.92 s, while the authors report no end-to-end benchmark evaluation and identify adaptation, protocol maturity, and scalability boundaries.

  • Problem

    Current agent frameworks commit early to a single interaction protocol, fixed tool integration, and static user models, motivating architectures that are protocol-pluralistic by design.

  • Method

    STEM Agent composes a five-layer architecture with a differentiable agent core, five protocol handlers, MCP-native tools, a Caller Profiler, self-tunable parameters, memory, and skills acquisition.

  • Results

    413 tests across 37 files passed at 100% in 2.92 s, covering protocol compliance and cross-component integration across the architecture’s five layers.

  • Takeaways & Limitations

    Protocol plurality, behavioral self-adaptation, and emergent skill acquisition can coexist when external capabilities are mediated by MCP and user modeling is decoupled from domain logic.

  • Takeaways & Limitations

    The evaluation lacks end-to-end task-completion benchmarks and user studies; UCP and AP2 also lack external adoption and formal threat modeling.

Abstract

from arXiv · show

Current AI agent frameworks commit early to a single interaction protocol, a fixed tool integration strategy, and static user models, limiting their deployment across diverse interaction paradigms. To address these constraints, we introduce STEM Agent (Self-adapting, Tool-enabled, Extensible, Multi-agent), a modular architecture inspired by biological pluripotency in which an undifferentiated agent core differentiates into specialized protocol handlers, tool bindings, and memory subsystems that compose into a fully functioning AI system. The framework unifies five interoperability protocols (A2A, AG-UI, A2UI, UCP, and AP2) behind a single gateway, introduces a Caller Profiler that continuously learns user preferences across more than twenty behavioral dimensions, externalizes all domain capabilities through the Model Context Protocol (MCP), and implements a biologically inspired skills acquisition system in which recurring interaction patterns crystallize into reusable agent skills through a maturation lifecycle analogous to cell differentiation. Complementing these capabilities, the memory system incorporates consolidation mechanisms, including episodic pruning, semantic deduplication, and pattern extraction, designed for sub-linear growth under sustained interaction. A comprehensive 413-test suite validates protocol handler behavior and component integration across all five architectural layers, completing in under three seconds.

1. Introduction

STEM Agent addresses architectural lock-in by composing an undifferentiated agent core with multiple protocol handlers, tool bindings, memory types, and adaptive subsystems. Its contributions include unified multi-protocol access, caller modeling, MCP-native capabilities, self-tuning behavior, commerce protocols, and biologically inspired skill acquisition.

  • STEM Agent differentiates an undifferentiated core into specialized protocol handlers, tool bindings, and memory types that compose into business workflows.
  • Architectural lock-in fixes agents to one interaction protocol, one tool strategy, and static user models, limiting interoperability, adaptation, and composition.
  • Five protocols—A2A, AG-UI, A2UI, UCP, and AP2—operate behind a unified gateway; UCP and AP2 are novel protocols proposed in the paper.
  • The Caller Profiler continuously learns preferences across 4 categories and 20+ dimensions using exponential moving averages, enabling per-user behavioral adaptation without manual configuration.
  • All external domain capabilities are acquired at runtime through MCP, while meta-reasoning rules remain in code; ten behavior parameters adapt to tasks and caller profiles.
  • UCP and AP2 support checkout sessions, mandate-based payments, and audit trails, while recurring interaction patterns crystallize into reusable skills that mature or undergo apoptosis after persistent failure.

2. Related Work

Related work describes fragmented agent frameworks and communication standards, alongside open challenges in adaptive reasoning, MCP tool quality, memory, and continual adaptation. STEM Agent responds by combining adaptive strategies, five protocols, MCP-mediated capabilities, and a four-type memory system.

  • Multi-agent frameworks: Most surveyed multi-agent frameworks commit to a single communication protocol and lack per-user adaptation; MAFBench reports 100× latency differences and 30% accuracy gaps across frameworks.
  • Agent communication protocols: Prior protocol work identifies MCP and A2A as complementary and highlights schema translation and lifecycle management as integration pain points; prior systems implement at most two protocols.
  • Agentic reasoning and adaptive compute: Adaptive-compute research links dynamic reasoning depth to efficiency gains without quality loss, and STEM Agent selects among four reasoning strategies based on task characteristics.
  • Architecture: Table 1 presents STEM Agent’s five-layer architecture, with protocol handlers and tool bindings differentiating the agent core while memory provides persistent state for future adaptation.
  • MCP tools and benchmarks: MCP research reports real-world tool-use scores below 44%, more than 4,000 available servers, and quality issues in 97.1% of tool descriptions.
  • Agent memory and self-adaptation: Memory and self-adaptation research identifies continuous adaptation as an open challenge, while STEM Agent operationalizes these ideas through four memory types, a Caller Profiler, and self-tunable behavior parameters.

3. Architecture

STEM Agent organizes a five-layer system around an undifferentiated Agent Core whose cognitive pipeline adapts requests, selects skills and strategies, executes plans, and learns from outcomes. Protocol handlers, memory, MCP integration, and framework packages support this pipeline.

  • Layered architecture: The five-layer architecture separates standard interfaces, protocol handlers, the Agent Core, memory, and tool integration.The Agent Core differentiates through protocol handlers and tool bindings, while memory provides persistent state for future adaptation.
  • Cognitive pipeline: The cognitive pipeline processes each request through eight phases: Perceive, Adapt, Skill Match, Reason, Plan, Execute, Learn, and Respond.Its input is a message and caller context; its output is a response and updated profile.
  • Cognitive pipeline: Perception classifies intent and complexity, adaptation loads caller profiles, and skill matching can bypass reasoning and planning with a committed or mature skill.Otherwise, task characteristics select ReAct, Reflexion, Internal Debate, or Chain-of-Thought before planning and execution.
  • Cognitive pipeline: Learning runs asynchronously to update caller profiles, record skill outcomes, and attempt crystallization from accumulated episode patterns.Execution orchestrates MCP tool calls with retries and a circuit breaker.
  • Implementation: The implementation is a TypeScript monorepo with six workspace packages and a pluggable Express.js gateway.The packages cover schemas, cognitive engines, protocol handling, MCP integration, memory stores, and caller utilities.

4. Multi-Protocol Interoperability

STEM Agent places five interaction protocols behind one gateway, combining agent communication, UI interaction, dynamic UI composition, commerce, and payments. Pluggable routers and shared middleware support extension and framework adaptation.

  • Protocol coverage: The unified gateway simultaneously supports A2A, AG-UI, A2UI, UCP, and AP2.A2A and AG-UI follow published specifications, while UCP and AP2 are proposed as novel protocols in this work.
  • Agent and user interaction: A2A provides JSON-RPC agent communication, while AG-UI streams cognitive pipeline events to frontends through Server-Sent Events.A2A supports task sending, streaming, retrieval, cancellation, and agent discovery; AG-UI exposes progress events such as reasoning and tool calls.
  • Agent and user interaction: A2UI composes dynamic interfaces from 16 component primitives using a flat adjacency-list model with child references by ID.This avoids a fixed widget hierarchy.
  • Commerce and payments: UCP manages idempotent checkout lifecycles, and AP2 implements intent, payment, and receipt phases with configurable approval and audit trails.UCP uses required idempotency headers and a cache to prevent duplicate session creation.
  • Gateway extensibility: Each handler exposes a createRouter() method, while shared middleware and four framework adapters simplify gateway integration and protocol extension.Adding a protocol requires implementing its handler and mounting its router.

5. Self-Adaptation and Learning

STEM Agent adapts behavior through caller profiling, task-parameter tuning, memory consolidation, and skills that crystallize from recurring interaction patterns. Profile updates balance responsiveness with stability, while skill maturity determines when reusable procedures can shortcut reasoning.

  • Adaptation: Self-adaptation operates through per-caller profile learning and per-task behavior-parameter tuning.Ten parameters, including reasoning depth, verbosity, tool preference, and memory retrieval breadth, are adjusted from profile and task inputs.
  • Caller profiling: The Caller Profiler models four categories spanning 20+ behavioral dimensions: philosophy, principles, style, and habits.Dimensions include risk tolerance, testing emphasis, formality, verbosity, technical depth, and temporal patterns.
  • Caller profiling: An EMA with learning rate α = 0.1 updates each profile dimension from the current interaction signal.The paper reports that α = 0.1 balances responsiveness and stability; α = 0.05 was sluggish, while α = 0.3 caused oscillation in preliminary testing.
  • Caller profiling: Profile confidence follows a rational saturation curve with κ = 10, reaching 0.5 after ten interactions and emphasizing current-message signals below five interactions.As confidence grows, learned preferences are blended with current signals according to confidence.
  • Memory: The four memory types store episodes, semantic triples, successful procedures, and per-caller context, with a Memory Manager consolidating episodic data into semantic and procedural memory.The manager provides a unified facade as interaction history grows.
  • Reasoning selection: Deterministic strategy rules map tool-requiring tasks to ReAct, complex tasks to Reflexion, analysis or creative requests to Internal Debate, and other tasks to Chain-of-Thought.The selection logic remains inside the agent core rather than being externalized through MCP.
  • Skills acquisition: Recurring patterns crystallize skills containing triggers, action sequences, and maturity metadata, progressing from progenitor to committed to mature states.Committed skills require kc=3 successful activations with success rate ≥0.6; mature skills require km=10 successful activations and receive matching priority.
  • Skills acquisition: Crystallization requires at least three episodes sharing an action key and topic keywords in at least 50% of episodes, while skills below 0.3 success after ten activations are removed.Users may also register or remove plugin skills manually.

6. Evaluation

The evaluation validates STEM Agent through a broad test suite spanning protocol compliance, component integration, memory, security, adapters, and gateway behavior. It also distinguishes architectural comparison from performance benchmarking.

  • Test Suite: 413 tests across 37 files achieved a 100% pass rate in 2.92 s.The suite uses Vitest.
  • Architectural Comparison: Table 4 compares frameworks across protocols, per-caller adaptation, memory types, emergent skills, and commerce protocols rather than reporting performance.UCP and AP2 are marked as novel protocols proposed in this work.
  • Test Coverage: Tests span all five architectural layers, including engines, protocol handlers, memory, MCP integration, security, adapters, and gateway end-to-end behavior.Protocol checks include A2A JSON-RPC compliance, AG-UI event sequences, UCP idempotency, and AP2 audit trails.
  • Protocol Compliance: Each protocol handler adds routing and serialization around the shared Agent Core pipeline rather than implementing a separate cognitive pipeline.Handler-specific additions include JSON-RPC parsing, SSE setup, component validation, checkout state, mandate validation, and audit writes.
  • Protocol Compliance: The framework implements three established protocols and two novel protocols, with integration tests validating event sequences, error handling, and idempotency.The established protocols are A2A v0.3.0, AG-UI, and MCP; UCP and AP2 are proposed in this work.

7. Limitations

The evaluation validates compliance through testing but does not establish end-to-end task performance, user-study outcomes, or several deployment properties.

  • Evaluation Scope: The study includes no end-to-end task-completion benchmarks or user studies.Its evaluation focuses on compliance testing rather than benchmarked task performance or user experience.
  • Adaptation: The EMA-based Caller Profiler may not capture non-stationary or multi-modal preference distributions.This constrains adaptation when caller preferences change over time or contain multiple modes.
  • Protocol Maturity: UCP and AP2 lack external adoption and formal threat modeling.These protocols therefore have a stated maturity and security-modeling boundary.
  • Scalability: In-memory profile and idempotency stores require distributed locking under high concurrency.The stated scalability boundary concerns concurrent deployments.

8. Conclusion and Future Work

STEM Agent concludes that protocol plurality, behavioral self-adaptation, and emergent skill acquisition can coexist through MCP-mediated capabilities and decoupled user modeling. Future work extends the architecture toward multi-agent orchestration, benchmarking, learned strategy selection, and broader interoperability.

  • Conclusion: Protocol plurality, behavioral self-adaptation, and emergent skill acquisition coexist through MCP-mediated capabilities and decoupled user modeling.The conclusion presents these properties as jointly supported by the architecture.
  • Conclusion: Recurring interaction patterns crystallize into reusable skills whose maturation and apoptosis are intended to ensure quality.The skill lifecycle progresses from progenitor to committed to mature, with persistent failures leading to apoptosis.
  • Future Work: Future work proposes STEM Platform for composing multiple STEM Agents through delegation, consensus, and pipeline collaboration.The proposed platform targets complex multi-agent projects.
  • Future Work: Planned extensions include benchmark evaluation, learned strategy selection through adaptive test-time compute, interoperability with ANP and AWCP, and embedding-based skill matching.These items are listed as future directions rather than completed evaluations.

Impact Statement

The architecture emphasizes transparency and user control while recognizing that commerce-enabled deployments require safety boundaries and context-appropriate guardrails.

  • Transparency and Control: Transparency is supported through audit logging and explainable adaptation, while user control includes GDPR forget-me support and configurable autonomy levels.These are stated design goals of the STEM Agent architecture.
  • Safety: Deployments handling financial transactions should implement appropriate safety guardrails for their context.The statement specifically highlights commerce protocols as requiring safety boundaries.
Loading 2603.22359v1…