Author: admin

  • Where A2A Fits in a Business Integration Architecture

    Agent-to-agent communication is most useful when one agent owns a capability that another team or system should not have to rebuild. A travel agent might ask a pricing agent for a quote. A support agent might ask a billing agent to check a disputed charge. Each agent can keep its own tools and rules while exchanging a well-defined task and result.

    Start with ownership

    Ask what the second agent knows that the first one does not, and why it should remain a separate service. If the answer is only “we can make an HTTP call,” a normal API may be simpler. A2A becomes more interesting when the remote capability has its own lifecycle, permissions, availability, and way of completing work.

    Keep the hand-off specific

    A useful task says what is being requested, for which tenant, with what deadline and constraints. The response should distinguish a completed result from a refusal, a request for more information, and work that is still running. Do not send an entire conversation when a few relevant facts and a traceable task ID will do.

    Do not outsource responsibility

    The requesting agent still has to check whether the result is relevant and whether it may use it. The receiving agent still has to enforce its own permissions. Neither should treat the other’s text as proof that a high-impact action is safe. Keep approvals, secrets, idempotency, and audit records at the service boundary where the side effect occurs.

    Use it where the boundary helps

    A2A can make a multi-team architecture clearer when agents have distinct ownership and real workflows. It can also add latency, failure modes, and confusing debugging to a small application. Begin with one valuable hand-off, define the task contract, test timeouts and duplicate messages, and keep an ordinary API available when the problem does not need agent autonomy.

  • Retry, Timeout and Recovery Patterns for Agents

    When an agent call times out, the natural reaction is to try again. Sometimes that is exactly right. A network packet may have been lost and the provider may never have seen it. Sometimes the provider completed the action and only the response was lost. Retrying blindly is how one customer gets three emails or one payment gets attempted twice.

    Classify the failure first

    A temporary network error, rate limit, or provider overload may be worth retrying. A permission failure, invalid record, or rejected business rule usually is not. A timeout sits in the uncomfortable middle: you do not know whether the request happened. Treat it as an uncertain outcome and use the provider request ID or an idempotency key to find out before acting again.

    Back off instead of banging on the door

    Use exponential backoff with jitter and a maximum attempt count. Set a deadline for the whole task, not just each individual call. Keep the retry policy near the tool or workflow that understands the operation; a generic retry wrapper cannot know whether sending a message is safe to repeat.

    Give up usefully

    When the limit is reached, move the job to a visible failed or needs-review state. Tell the person what is known, what is uncertain, and whether they can safely try again. Preserve the request ID, previous responses, and attempt history so an operator does not recreate the same side effect while investigating.

    Recovery is part of the feature. Test a provider that succeeds after your client times out, a worker that crashes after a write, a queue that delivers twice, and a user who clicks retry twice. A good recovery design makes the safe action the easy action.

  • AI Agent Task Queues and Long-Running Workflows

    Some agent tasks finish before the user has time to blink. Others wait for a provider, a document, a human approval, or a long-running import. Keeping the browser request open for all of them is a recipe for timeouts and duplicate work. A queue gives the job somewhere to live after the initial request has ended.

    Give the job a real identity

    Create a task ID and record what was requested, who requested it, which tenant it belongs to, and what state it is in. A useful state model might include received, queued, working, waiting, completed, failed, and cancelled. The names matter less than making transitions explicit and visible.

    Expect the worker to disappear

    Workers crash, providers slow down, and networks lie about whether a request succeeded. Make each step restartable. Store progress and use idempotency keys around side effects so a worker can safely resume instead of starting the whole job again. Keep a maximum runtime and an attempt count so one bad task cannot consume the queue forever.

    Let a person intervene without guessing

    When a task is waiting for approval or missing information, show the reason, the evidence already gathered, and the action that will happen next. Give operators pause, retry, cancel, and replay controls with appropriate permissions. Users should see an honest status rather than a spinner that quietly becomes a support ticket.

    Measure the queue as part of the product

    Watch age, throughput, retries, dead-letter volume, approval wait time, and tasks that never reach a terminal state. A queue is not just infrastructure. It is the memory and hand-off point that lets an agent do useful work without pretending every job is instantaneous.

  • A Practical Integration Test Plan for AI Agents

    An agent can pass a prompt test and still fail in production. The model may answer correctly in isolation, then choose the wrong tool, receive stale data, retry a successful write, or get stuck when a person is unavailable. Integration tests need to follow the whole journey rather than stopping at the generated text.

    Test a real slice of work

    Choose one representative workflow and give it realistic inputs. Include the normal request, incomplete information, an ambiguous request, a request that should be refused, and a case that needs approval. Test with more than one tenant and role so a lucky happy path does not hide an authorization problem.

    Watch the boundaries

    Check what enters context, which sources are retrieved, which tool is selected, and whether its arguments are valid. Confirm that the server—not the model—decides whether the actor may read or change the record. Inspect the side effect itself: the exact fields changed, the destination, the idempotency key, and the audit entry.

    Make failure ordinary

    Simulate a slow provider, a duplicate event, a malformed tool result, a stale record, a full queue, and a model that returns a valid shape with an invalid value. Decide which failures may be retried, which need a person, and which should stop the workflow. A test that only checks for a 200 response is not checking enough.

    Keep a small regression set

    Save the cases that once failed, along with the expected safety boundary and outcome. Run them after changing a prompt, tool schema, model, retriever, or policy. The goal is not to prove that the agent never makes a mistake. It is to make important mistakes visible before customers find them.

  • Avoiding Overpowered Tools in an Agent Integration

    When an integration demo is moving quickly, a single tool that accepts a URL, a query, or a large JSON object feels convenient. The agent can call it for almost anything. That convenience is exactly why the tool becomes difficult to secure. A model that is confused, manipulated, or simply overconfident now has a very large action surface.

    Describe the job, not the whole system

    Prefer create_support_draft over call_any_api. Prefer find_open_orders_for_customer over a raw database query. A narrow tool gives the application a chance to validate the fields, destination, tenant, and allowed state transition before anything happens.

    Good tool design also helps the agent. A clear name, small input, predictable result, and useful error message leave less room for the model to guess. If a tool can return twenty unrelated kinds of data, the agent has to infer the meaning and the permission boundary every time.

    Keep the dangerous choices outside the model

    Resolve tenant identity and credentials on the server. Allowlist outbound destinations. Set limits for records, amounts, payload size, and batch operations. Separate reading, drafting, sending, approving, and deleting into different capabilities. A prompt telling the model to use a tool responsibly is helpful guidance, but it is not an access-control system.

    Test the failure path

    Try malformed arguments, an unexpected URL, a record from another tenant, a revoked permission, a timeout, and a repeated request. The safe result is not always an error page; sometimes it is a clear request for more information or a hand-off to a person. The smaller the tool, the easier it is to know what the agent was allowed to do and what needs to be fixed.

  • Connecting an Agent to a CRM Safely

    A CRM integration can make an agent genuinely useful. It can gather the account history before a call, spot an unanswered enquiry, or prepare the next sensible follow-up. It can also create a very expensive mess if it updates the wrong account or sends a confident message based on an old note. The safe design starts before anyone turns on the connector.

    Give the agent a narrow job

    “Manage the CRM” is far too broad. “Find new enquiries assigned to this team, summarise them, and draft a reply” is a job a person can understand and a system can protect. Start with read access and a draft. Add a write only when you know which records, fields, destinations, and state transitions are required.

    Keep the user and tenant identity attached to every request. The agent should not be able to invent an account ID or switch organisations because a note told it to. The CRM or your server must check ownership, role, record state, and field permissions before returning data or accepting a change.

    Put a person in front of the costly step

    A draft is different from a sent message. A suggested lead score is different from changing the pipeline stage. A proposed follow-up is different from contacting a customer. Show the evidence and proposed fields, then ask for approval when the action is external, high-value, or difficult to reverse.

    Make mistakes recoverable

    Use idempotency keys so a retry does not create two activities. Keep an audit record of the old and new values, the user who approved the action, and the agent task that proposed it. Test stale records, duplicate webhooks, missing contacts, rate limits, and a CRM outage before connecting the workflow to a real sales team.

  • AI Agent Incident Response: What to Do When an Agent Misbehaves

    When an AI agent misbehaves, the first priority is to limit impact and preserve evidence. A calm incident process is more useful than trying to make the agent explain itself while it is still able to call tools or reach users.

    Contain the active path

    Pause the risky workflow, revoke or narrow affected credentials, disable a tool, reduce audience exposure, or route requests to a human. Choose the smallest safe control that stops further harm. If the issue involves personal data, external messages, money, or irreversible actions, use the incident severity rule already agreed with the service owner.

    Preserve a useful record

    Record the time window, users or workflows affected, model and prompt versions, retrieved sources, tool calls, approvals, outputs, configuration changes, and actions taken. Protect the record because it may contain sensitive content. Do not overwrite the evidence while attempting a quick fix.

    Recover and learn

    Confirm that the immediate risk is closed, replay representative cases in a safe environment, and compare the result with the last known-good version. Classify the cause: source change, prompt injection, permission failure, tool error, model change, routing bug, monitoring gap, or human process failure. Add a regression case and an owner before restoring the workflow.

    • Publish a clear human fallback for affected users.
    • Keep rollback and credential-revocation steps tested.
    • Separate customer communication from technical speculation.
    • Review whether the incident reveals a missing approval or test.

    The agent safety boundaries guide helps prevent severe actions, while the workflow testing guide helps turn the incident into a durable check.

  • RAG Evaluation Datasets for Business Questions

    A RAG evaluation dataset is a curated set of questions, expected evidence, acceptable answers, and known failure cases. It gives a team something stable to test when sources, chunking, retrieval, prompts, models, or permissions change.

    Start from real business questions

    Collect representative requests from the workflow, including common questions, difficult wording, misspellings, ambiguous cases, and questions the system should refuse. Remove unnecessary personal information and record the business context needed to judge the answer fairly.

    Store evidence, not only answers

    For each case, identify the authoritative source, relevant passage, required qualifiers, and unacceptable claims. An answer can sound plausible while using the wrong document or missing a restriction. Evaluate retrieval relevance and citation quality separately from generated wording.

    Test permissions and change

    Include cases where two users should see different sources, where a document is stale, and where sources conflict. Run the set after changes to indexing, metadata, access rules, retrieval settings, prompts, or models. The data readiness guide helps improve the source collection, and the metrics guide helps report results.

    • Version the dataset and its expected evidence.
    • Keep safety and refusal cases alongside routine cases.
    • Review failures by root cause, not only by score.
    • Preserve a small holdout set for meaningful comparisons.

    A useful dataset is deliberately imperfect and regularly refreshed. It should represent the questions the business receives, not only the questions that make a demo look good.

  • AI Agent Registries and Capability Discovery

    An agent registry is a directory of agents and the capabilities they advertise. It can help a system find a specialist, but discovery is not proof of trust, quality, authority, or availability. A registry needs the same care as any other integration directory.

    Describe capability precisely

    Record the task types, input and output formats, supported languages, operating hours, limits, dependencies, and expected failure modes. Link to an agent card or capability document that can be versioned. Avoid vague labels such as “general assistant” when a narrower contract would make routing safer.

    Separate discovery from authorisation

    Finding an agent does not grant it access to data or tools. Verify identity, issuer, endpoint, certificate or signature, audience, and permitted actions before sending business context. Keep tenant, user, and purpose boundaries in the authorisation layer rather than trusting registry metadata.

    Keep the directory current

    Give entries an owner, expiry or refresh signal, health status, supported protocol version, and retirement process. Test advertised capabilities with representative requests and remove entries that are unreachable, misleading, or no longer maintained. Agent cards explain the public capability surface; the MCP and A2A architecture guide shows where discovery fits in a broader system.

    • Prefer signed or authenticated metadata where the risk justifies it.
    • Cache discovery briefly and revalidate before sensitive work.
    • Fail closed when identity or capability data is ambiguous.
    • Log the selected agent and the reason it was selected.

    Registries are most useful when they reduce routing guesswork without becoming an unreviewed marketplace. Keep selection observable, policy-controlled, and easy to override.

  • MCP and A2A Together: A Reference Architecture

    MCP and A2A solve different coordination problems. MCP gives an agent a structured way to use tools, resources, and prompts. A2A helps agents communicate about work. A useful architecture can use both, but it should keep their responsibilities distinct.

    Keep local tool access behind MCP

    Use MCP-style interfaces when an agent needs controlled access to a database, search service, CRM, calculator, file store, or other capability. Each tool should have a narrow schema, explicit permissions, validation, useful errors, and logs. The tool schema guide covers the contract an agent needs in order to call a tool predictably.

    Use A2A for delegated work

    Use agent-to-agent communication when another agent owns a distinct task, context, or capability. The calling agent should send a bounded request and receive a status, result, question, or refusal. The receiving agent should not inherit authority merely because another agent asked it to act.

    Join them at an explicit boundary

    A coordinator can use MCP to inspect approved tools and A2A to delegate a task to a specialist. Keep identity, trust, approval, data minimisation, and audit records at the boundary. The A2A task guide explains the lifecycle, while the MCP security guide covers tool-side risks.

    • Authenticate each agent and tool independently.
    • Pass only the context required for the delegated task.
    • Require approval for consequential actions.
    • Trace the original request through every hop.

    The architecture is strongest when either side can be replaced without changing the business rules. Protocols carry messages and capabilities; the service still owns the policy.

  • A2A Tasks, Messages and Artifacts in Plain Language

    A2A describes how one agent can discover and communicate with another agent. The basic objects are easier to understand when they are treated as parts of a business task: a request, the messages exchanged while it is handled, and the artefacts produced along the way.

    Tasks describe the work

    A task represents a unit of work with an identity, state, input and expected result. It may be waiting, working, completed, failed, or interrupted. A clear task boundary makes it possible to retry, resume, inspect ownership, and explain what happened when an agent cannot finish.

    Messages carry the conversation

    Messages communicate instructions, progress, questions, results, and errors within the task. They should identify the intended role and preserve enough context for the receiving agent to act without guessing. Keep policy, identity, permissions, and business rules outside untrusted message text.

    Artifacts are the useful outputs

    An artifact is a produced object such as a report, structured record, file, draft, or decision request. Give it a type, owner, version, and access boundary. A link to agent cards and capability discovery explains how a partner advertises what it can do, while A2A and MCP separates agent collaboration from tool access.

    • Define who may create, update, approve, and close a task.
    • Make retries and duplicate delivery safe.
    • Expose progress without leaking private context.
    • Record the final artifact and the evidence behind it.

    For production use, design the task lifecycle before choosing a protocol. The protocol can carry the exchange, but the business workflow still needs ownership, observability, timeouts, and a human route for exceptions.

  • AI Agent Evaluation Metrics That Matter to Businesses

    AI agent metrics are useful when they help a team decide what to improve, pause, or scale. A single success rate hides too much: an agent can complete many easy requests while failing badly on the cases that matter most.

    Measure the outcome first

    Start with the workflow result rather than model trivia. Track task completion, useful resolution, time to resolution, rework, escalation quality, and the cost of reaching a satisfactory outcome. If the agent supports revenue or service delivery, connect those measures to the business process without claiming that every outcome was caused by the agent.

    Add quality and safety measures

    Review correctness, relevance, completeness, citation or source use, refusal behaviour, and the severity of errors. For tool-using systems, measure correct tool selection, argument validity, approval compliance, retries, and recovery. Keep separate thresholds for sensitive data, external communications, financial actions, and irreversible changes.

    Make the numbers actionable

    Define an owner, a review period, a target or warning threshold, and the response when a measure moves. Segment results by intent, audience, language, source set, model route, and escalation path. The pilot criteria guide helps turn metrics into a decision rule, while the drift guide covers changes after launch.

    • Keep a representative evaluation set beside live metrics.
    • Report severe failures separately from averages.
    • Measure user corrections and repeat contacts.
    • Review cost and latency alongside quality.

    Good evaluation metrics create a shared operating language. They do not make an agent safe by themselves; they make weak assumptions visible early enough to change the design.

  • Choosing the Right LLM for Your Chatbot: GPT vs Claude vs Gemini

    Choosing a large language model for a chatbot is less about picking a universal winner and more about matching a model to the job. GPT, Claude, and Gemini can all produce strong results, but they differ in context handling, tool use, latency, cost, and deployment options.
    Start with the task
    Define what the chatbot must do before comparing model names. A support assistant that retrieves policy documents has different requirements from a creative writing helper or an agent that calls business APIs.
    What information must the model use, and how current must it be?
    Does it need structured output or tool calling?
    How much latency can users tolerate?
    What data may be sent to a hosted provider?
    How will quality, cost, and failure modes be measured?
    GPT, Claude, and Gemini in context
    GPT models are often a good general-purpose choice when an application needs broad capability, reliable structured output, and a mature tool-calling ecosystem. Claude models are frequently attractive for long-form analysis, careful writing, and workflows that benefit from a large working context. Gemini models can be useful when an application benefits from multimodal inputs or close integration with Google services.
    These are practical tendencies, not permanent rankings. Model versions change, and a smaller or newer model may outperform a larger one on a particular prompt, language, or domain.
    Compare the capabilities that matter
    Criterion
    What to test
    Answer quality
    Accuracy, relevance, completeness, and refusal behaviour on representative questions
    Context handling
    Performance with long conversations and retrieved passages
    Tool use
    Correct function selection, arguments, retries, and confirmation steps
    Reliability
    Consistency across repeated runs and resistance to prompt injection
    Operations
    Latency, rate limits, observability, data controls, and total cost
    A practical evaluation process
    Build a test set from real or carefully anonymised conversations.
    Score factuality, helpfulness, tone, citation quality, and safe escalation.
    Measure token use, response time, tool errors, and fallback frequency.
    Test with adversarial and ambiguous requests, not only ideal prompts.
    Run the same test after model or prompt changes.
    For retrieval-based chatbots, evaluate the model together with retrieval. A strong model cannot compensate for missing, stale, or poorly ranked source material. The companion guide on embedding models in RAG is a useful starting point.
    Conclusion
    Choose the model that performs reliably on your own workload under your privacy, latency, and budget constraints. Keep the application architecture flexible enough to test alternatives, and treat evaluation as an ongoing engineering practice rather than a one-time popularity contest.