A2ALite SDK: Minimal TypeScript SDK for Agent-to-Agent Servers (inspired by Express/Hono)

Hey everyone,

I've recently wrapped up building A2ALite, a minimal and modular SDK built in TypeScript designed to make building A2A-compliant servers as straightforward as building web servers. It's inspired by familiar patterns from popular HTTP frameworks like Express and Hono, specifically tailored for agent-to-agent (A2A) communication.

One issue I frequently noticed when developing A2A servers was managing consistent taskIds and contextIds across asynchronous operations, artifact streams, and task states. This complexity often leads to repetitive and error-prone code.

A2ALite simplifies these challenges by automatically handling:

  • Task and context identifiers
  • Artifact streaming and queuing
  • Task lifecycle management and synchronization

Here's a quick example demonstrating how easy it is to stream artifacts:

class MyAgentExecutor implements IAgentExecutor {
  execute(context: AgentExecutionContext) {
    const messageText = MessageHandler(context.request.params.message).getText();

    return context.stream(async (stream) => {
      for (let i = 0; i < 5; i++) {
        await stream.writeArtifact({
          artifact: ArtifactHandler.fromText(`echo ${i}: ${messageText}`).getArtifact(),
        });
      }
      await stream.complete();
    });
  }

  cancel(task: Task): Promise<Task | JSONRPCError> {
    return taskNotCancelableError("Task is not cancelable");
  }
}

This built-in functionality helps eliminate boilerplate, reduces the chance of errors, and allows to focus entirely on agent's core logic.

I'd love your feedback, ideas, or suggestions! Check out the README for full docs, and the examples for some sample A2ALite Agent implementations.

Cheers.

Posted Jul 10, 2025, 12:36 AM UTC

60

Comments aren't archived yet

Comments for this period haven't been loaded into the archive yet.