Skip to content

rickscode/DaisyChain-v0.1

Repository files navigation

DaisyChain v0.1

Minimal agent-to-agent communication protocol for the Daisy AI-native OS.

Quick Start

1. Install dependencies

pip install -r requirements.txt

2. Set your Groq API key

export GROQ_API_KEY=your_key_here

Get a free key at: https://console.groq.com/keys

3. Run the demo

Option A: All-in-one script

chmod +x run_demo.sh
./run_demo.sh

Option B: Manual (4 terminals)

Terminal 1 - Registry:

python registry.py

Terminal 2 - Coordinator:

python example_agents.py coordinator

Terminal 3 - Researcher:

python example_agents.py researcher

Terminal 4 - Coder:

python example_agents.py coder

Terminal 5 - Test:

python test_client.py

Architecture

┌─────────────────────────────────────────────────────┐
│                    REGISTRY                         │
│              (discovery only)                       │
│         ws://localhost:9000                         │
└─────────────────────────────────────────────────────┘
         ▲              ▲              ▲
         │              │              │
    ┌─────────┐    ┌─────────┐    ┌─────────┐
    │Coordinat│◄──►│Researcher│◄──►│  Coder  │
    │  :8001  │    │  :8002  │    │  :8003  │
    └─────────┘    └─────────┘    └─────────┘

Files

File Description
registry.py Discovery service - agents register here
agent.py Base class for creating agents
example_agents.py Three example agents: Coordinator, Researcher, Coder
test_client.py Send messages to test the network
run_demo.sh Start everything at once

Creating Your Own Agent

from agent import DaisyAgent

class MyAgent(DaisyAgent):
    def __init__(self):
        super().__init__(
            agent_id="my-agent",
            name="My Custom Agent",
            capabilities=["my_capability"],
            port=8010
        )
    
    async def handle_message(self, message: dict) -> dict:
        # Use self.think() to call the LLM
        result = self.think(f"Process this: {message['intent']}")
        return {"result": result}

# Run it
import asyncio
agent = MyAgent()
asyncio.run(agent.start())

Message Format

{
  "id": "uuid",
  "from": "agent-id",
  "to": "agent-id",
  "type": "request|response|error",
  "intent": "what you want done",
  "payload": {},
  "ts": 1706300000
}

What's Next (v0.2)

Based on what we learn from running v0.1:

  • Streaming responses
  • Conversation memory
  • Agent-to-agent negotiation
  • Security/auth
  • Message persistence

DaisyChain v0.1 - Simple enough to understand, minimal enough to run today

About

DaisyChain agent framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors