Skip to content

Commit 7c6c3e3

Browse files
authored
Merge pull request #3 from nikomatsakis/introduce-eliza
Introduce "elizacp"
2 parents f65c861 + fd6890b commit 7c6c3e3

File tree

8 files changed

+778
-1
lines changed

8 files changed

+778
-1
lines changed

Cargo.lock

Lines changed: 104 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ members = [
33
"src/sacp-proxy",
44
"src/sacp-conductor",
55
"src/sacp",
6+
"src/elizacp",
67
]
78
resolver = "2"
89

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This repository contains three core crates:
2626
- **[`sacp`](./src/sacp/)** - Core protocol types and traits for building clients and agents
2727
- **[`sacp-proxy`](./src/sacp-proxy/)** - Framework for building proxy components
2828
- **[`sacp-conductor`](./src/sacp-conductor/)** - Binary that orchestrates proxy chains
29+
- **[`elizacp`](./src/elizacp/)** - Example ACP agent implementing the classic Eliza chatbot (useful for testing)
2930

3031
## Documentation
3132

src/elizacp/Cargo.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[package]
2+
name = "elizacp"
3+
version = "0.1.0"
4+
edition = "2024"
5+
description = "Classic Eliza chatbot as an ACP agent for testing"
6+
license = "MIT OR Apache-2.0"
7+
repository = "https://github.com/agent-client-protocol/symposium-acp"
8+
keywords = ["acp", "agent", "eliza", "testing"]
9+
categories = ["development-tools"]
10+
authors = ["Niko Matsakis <[email protected]>"]
11+
readme = "README.md"
12+
13+
[[bin]]
14+
name = "elizacp"
15+
path = "src/main.rs"
16+
17+
[dependencies]
18+
sacp = { version = "0.1.0", path = "../sacp" }
19+
agent-client-protocol-schema.workspace = true
20+
anyhow.workspace = true
21+
clap.workspace = true
22+
futures.workspace = true
23+
rand = "0.8"
24+
regex = "1.10"
25+
serde.workspace = true
26+
serde_json.workspace = true
27+
tokio.workspace = true
28+
tokio-util.workspace = true
29+
tracing.workspace = true
30+
tracing-subscriber.workspace = true
31+
uuid.workspace = true
32+
33+
[dev-dependencies]
34+
expect-test.workspace = true

src/elizacp/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# elizacp
2+
3+
A classic Eliza chatbot implemented as an ACP (Agent-Client Protocol) agent.
4+
5+
## Overview
6+
7+
Elizacp provides a simple, predictable agent implementation that's useful for:
8+
9+
- **Testing ACP clients** - Lightweight agent with deterministic pattern-based responses
10+
- **Protocol development** - Verify ACP implementations without heavy AI infrastructure
11+
- **Learning ACP** - Clean example of implementing the Agent-Client Protocol
12+
13+
## Features
14+
15+
- **Classic Eliza patterns** - Pattern matching and reflection-based responses
16+
- **Full ACP support** - Session management, initialization, and prompt handling
17+
- **Per-session state** - Each session maintains its own Eliza instance
18+
- **Extensible patterns** - Easy to add new response patterns (including future tool use triggers)
19+
20+
## Usage
21+
22+
### Running the agent
23+
24+
```bash
25+
# Build and run
26+
cargo run -p elizacp
27+
28+
# With debug logging
29+
cargo run -p elizacp -- --debug
30+
```
31+
32+
The agent communicates over stdin/stdout using JSON-RPC, following the ACP specification.
33+
34+
### Testing with an ACP client
35+
36+
Elizacp responds to:
37+
38+
1. **Initialize requests** - Returns capabilities
39+
2. **New/Load session requests** - Creates session state
40+
3. **Prompt requests** - Responds with Eliza-style conversational replies
41+
42+
Example conversation:
43+
```
44+
User: Hello
45+
Eliza: Hello. How are you feeling today?
46+
47+
User: I am sad
48+
Eliza: Do you often feel sad?
49+
50+
User: I feel worried about my father
51+
Eliza: Tell me more about your family.
52+
```
53+
54+
## Implementation
55+
56+
- `eliza.rs` - Pattern matching engine with classic Eliza responses
57+
- `main.rs` - ACP agent implementation over stdio
58+
59+
## Architecture
60+
61+
The agent maintains a `HashMap<SessionId, Eliza>` to track per-session state. Each session gets its own Eliza instance with independent conversation state.
62+
63+
## Future Extensions
64+
65+
The pattern database structure is designed to support:
66+
- Tool use triggers (e.g., "what's the weather" → tool call)
67+
- Custom response patterns
68+
- Conversation history tracking
69+
- Multi-turn context awareness

0 commit comments

Comments
 (0)