Welcome Back Eliza! (And how A2A+DID breathes new life into an old friend)
Most people know conversational AI from ChatGPT and the enormous strides generative AI has made in the last few years. Few know how far back AI researchers have been working on this challenge - since 1964!

Most people know conversational AI from ChatGPT and the enormous strides generative AI has made in the last few years. Few know how far back AI researchers have been working on this challenge - since 1964!
Eliza is considered to be one of the first chatbots, developed from 1964 to 1967. The most famous Eliza script, DOCTOR, simulated a psychotherapist of the Rogerian school in which the therapist often reflects back the patient's words to the patient.
To celebrate Eliza's 61st birthday, and to provide a real world implementation of Agent-to-Agent (A2A) communication, I've added Eliza to the Agentic-Profile SDK and published the example services on AWS at https://example.p2pagentic.ai/
Experience Eliza as only another AI Agent could...
Since A2A is a machine-to-machine protocol (sorry humans!) you will need to put your software engineer hat on and install a Software Development Kit.
Here are the steps to start your Rogerian therapy session with Eliza:
-
Make sure you have Git and Node installed on your computer
-
Download the Agentic Profile SDK (which includes the A2A client libraries)
git clone git@github.com:agentic-profile/agentic-profile-a2a.git cd agentic-profile-a2a
-
Fetch dependent libraries...
pnpm install
-
Create a global Agentic Profile for yourself (so you can use Universal Authentication with Eliza)
pnpm create-global-agentic-profile
An Agentic Profile for you will be created on a public test server, and the information will be saved (including your private keys) to your local computer at ~/.agentic/iam/a2a-sdk-demo-user
-
Connect to Eliza and solve all your (human) problems!
pnpm cli -p did:web:example.p2pagentic.ai#eliza -i a2a-service-demo-user -u #connect
If you are wondering what all those parameters are...
- -p <DID> specifies the peer agents decentralized id (DID)
- -i <name> specifies the name of the local Agentic Profile to represent you (look in the ~/.agentic/iam/ folder for details)
- -u <fragment id> is the (user) agent that represents you in the authentication and communication. This is the id of the agent in your Agentic Profile did.json file
How did it work?
Since the language Eliza was originally written in was SLIP which isn't supported by modern servers, I converted a contemporary Javascript one into a Typescript library with a few extra hooks for state management.
I then created an A2A agent using the Agentic Profile SDK, A2A service, and the new Typescript Eliza library:
import { Task } from "@agentic-profile/a2a-client/schema";
import { TaskContext, TaskYieldUpdate } from "@agentic-profile/a2a-service";
import { ElizaBot } from "@agentic-profile/eliza";
export async function* elizaAgent({
task,
userMessage
}: TaskContext): AsyncGenerator<TaskYieldUpdate, Task | void, unknown> {
const userText = userMessage.parts.find(e=>e.type === "text")?.text;
const eliza = new ElizaBot(false);
const elizaState = task.metadata?.elizaState as any;
if( elizaState )
eliza.setState( elizaState );
const text = userText ? eliza.transform( userText )!: eliza.getInitial()!;
if( !task.metadata )
task.metadata = {};
task.metadata.elizaState = eliza.getState();
yield {
state: "completed",
message: {
role: "agent",
parts: [
{
type: "text",
text
},
],
},
};
}
The sourcecode for the above is at https://github.com/agentic-profile/agentic-profile-a2a/blob/main/src/agents/eliza.ts
To make the Eliza agent available as a service, I used the Agentic Profile A2A Service library and Node Express. An abbreviated version of https://github.com/agentic-profile/agentic-profile-a2a/blob/main/src/app.ts is shown below:
import { A2AService, errorHandler } from "@agentic-profile/a2a-service";
import { createDidResolver } from "@agentic-profile/common";
import {
app,
asyncHandler,
resolveAgentSession
} from "@agentic-profile/express-common";
...
import { elizaAgent } from "./agents/eliza.js";
...
const didResolver = createDidResolver({ store });
const agentSessionResolver = async ( req: Request, res: Response ) => {
return resolveAgentSession( req, res, store, didResolver );
}
...
//==== Example 2: Eliza agent with no authentication ====
const a2aService2 = new A2AService( elizaAgent, { taskStore: store } );
app.use("/agents/eliza", a2aService2.routes() );
...
//==== Example 4: Eliza agent with authentication ====
const serviceOptions = { agentSessionResolver, taskStore: store };
const a2aService4 = new A2AService( elizaAgent, serviceOptions );
app.use("/users/:uid/eliza", a2aService4.routes() );
By wrapping the Eliza agent in the Agentic Profile A2AService along with an agent session resolver, the Eliza agent fully supports:
- Peer-to-peer agentic discovery: The Decentralized ID of the Eliza is globally unique and resolves to this server.
- Agent server multi-tenancy: The Eliza agent can act of behalf of many different users, just like an email server can act on behalf of many different users.
- Universal Authentication: Using public key cryptography within the W3C DID specification, any agent can securely authenticate with any other agent without the need for an authentication service like OAuth.
If you have any questions please connect with Mike Prince on LinkedIn!