Skip to content

Commit 0689a75

Browse files
Merge pull request #1 from jwest951227/dev
doc: Readme
2 parents 8099482 + 4a6bdef commit 0689a75

File tree

2 files changed

+74
-194
lines changed

2 files changed

+74
-194
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "daydreams",
2+
"name": "solana_ai_multimodal-agent",
33
"version": "0.0.0",
44
"scripts": {
55
"goal": "bun run examples/example-goal.ts",

readme.md

Lines changed: 73 additions & 193 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,104 @@
1-
![Daydreams](./banner.png)
2-
3-
# Daydreams - for Defai, games and more
4-
5-
Daydreams is a generative agent library for executing anything onchain. It is chain agnostic and can be used to perform onchain tasks - including play any onchain game - by simply injecting context. Base, Solana, Ethereum, Starknet, etc.
6-
7-
It is designed to be as lite as possible while remaining powerful and flexible.
8-
9-
## Table of Contents
10-
11-
- [Quick Start](#quick-start)
12-
- [Examples](#examples)
13-
- [Basic Example](#basic-example)
14-
- [Goal-Based Example](#goal-based-example)
15-
- [Twitter Bot Example](#twitter-bot-example)
16-
- [API Example](#api-example)
17-
- [How It Works](#how-it-works)
18-
- [Context](#context)
19-
- [Actions](#actions)
20-
- [Goals](#goals)
21-
- [Monitor Progress](#monitor-progress)
22-
- [Architecture](#architecture)
23-
- [Core Concepts](#core-concepts)
24-
- [Protocol Design](#protocol-design)
25-
- [Development](#development)
26-
- [Roadmap](#roadmap)
27-
- [Contributors](#contributors)
1+
# Solana AI Multimodal Agent
2+
3+
The Solana AI Multimodal Agent is a powerful generative library designed for seamless on-chain execution. It is chain-agnostic, allowing users to perform tasks across multiple blockchains, including Solana, Ethereum, and Starknet. By simply injecting context, users can effortlessly interact with various on-chain applications, including games.
284

295
## Quick Start
306

31-
Prerequisites:
7+
### Requirements
328

33-
- Node.js 16+
9+
- Node.js 16.0+
3410
- pnpm
3511
- Bun
3612
- Docker Desktop
3713

38-
```bash
39-
# Install dependencies
40-
pnpm install
14+
### Installation
15+
16+
1. **Install Dependencies**:
17+
```bash
18+
pnpm install
19+
```
20+
2. **Configure Environment Variables**:
21+
```bash
22+
cp .env.example .env
23+
```
24+
3. **Start Docker Services**:
25+
```bash
26+
./docker.sh
27+
```
28+
29+
Alternatively, simplify with a Makefile:
30+
31+
```makefile
32+
# Makefile
33+
install:
34+
pnpm install
35+
36+
copy-env:
37+
cp .env.example .env
38+
39+
start-docker:
40+
./docker.sh
41+
```
4142

42-
# Copy environment variables
43-
cp .env.example .env
43+
Run the commands using Make:
4444

45-
# Start Docker services (ChromaDB)
46-
sh ./docker.sh
45+
```bash
46+
make install copy-env start-docker
4747
```
4848

4949
## Examples
5050

51-
The project includes several example implementations demonstrating different use cases:
51+
The project includes professional examples for various use cases:
5252

5353
### Basic Example
5454

55-
A simple CLI agent that can execute tasks using Chain of Thought:
55+
A simple CLI agent using Chain of Thought:
5656

5757
```bash
58-
# Run basic example
59-
bun task
58+
bun run basic
6059
```
6160

6261
### Goal-Based Example
6362

6463
Demonstrates hierarchical goal planning and execution:
6564

6665
```bash
67-
# Run goal-based example
68-
bun goal
66+
bun run goals
6967
```
7068

7169
### Twitter Bot Example
7270

73-
A Twitter bot that can monitor mentions and generate autonomous thoughts:
71+
A bot that autonomously monitors mentions and generates responses:
7472

7573
```bash
76-
# Run Twitter bot example
77-
bun twitter
74+
bun run twitter
7875
```
7976

80-
### API Example
77+
### API Integration Example
8178

82-
Shows how to integrate with external APIs:
79+
Illustrates integration with external APIs:
8380

8481
```bash
85-
# Run API example
86-
bun api
82+
bun run api
8783
```
8884

89-
## Concepts
90-
91-
Daydreams is built around the following concepts:
85+
## Concepts Overview
9286

93-
- Orchestrator
94-
- Handlers
95-
- Goals
96-
- Memory
97-
- Chain of Thought
87+
**Core Concepts** include:
9888

9989
### Orchestrator
10090

101-
The Orchestrator is the central component that manages the flow of data through the system. It is responsible for:
102-
103-
- Registering handlers
104-
- Routing data through the system
105-
- Scheduling recurring tasks
106-
- Maintaining the autonomous flow
107-
- Calling the Chain of Thought
91+
- **Data Flow**: Manages and routes data efficiently.
92+
- **Task Scheduling**: Oversees recurring tasks to maintain workflow.
93+
- **Chain of Thought**: Invokes reasoning for task execution.
10894

10995
### Handlers
11096

111-
Handlers are the building blocks of the system. They are responsible for processing data and producing outputs. They are registered with the Orchestrator and are chained together in an autonomous flow.
97+
Handlers process data and generate outputs. They are categorized as:
11298

113-
Register handlers for inputs, outputs, and actions using `registerIOHandler`. Each handler has a role, description, schema, and handler function:
114-
115-
- **Input Handlers**: Process incoming data (e.g., user messages, API webhooks)
116-
- **Action Handlers**: Execute operations and return results (e.g., API calls, database queries)
117-
- **Output Handlers**: Produce side effects (e.g., sending messages, updating UI)
99+
- **Input Handlers**: Manage incoming data (e.g., user messages).
100+
- **Action Handlers**: Perform operations and return results (e.g., API calls).
101+
- **Output Handlers**: Produce side effects (e.g., sending notifications).
118102

119103
```typescript
120104
// Register an action handler
@@ -128,59 +112,31 @@ orchestrator.registerIOHandler({
128112
body: z.union([z.string(), z.record(z.any())]).optional(),
129113
}),
130114
handler: async (payload) => {
131-
// Handler implementation
132115
const response = await fetch(/* ... */);
133116
return response;
134117
},
135118
});
136-
137-
// Register an input handler
138-
orchestrator.registerIOHandler({
139-
name: "user_chat",
140-
role: "input",
141-
schema: z.object({
142-
content: z.string(),
143-
userId: z.string().optional(),
144-
}),
145-
handler: async (payload) => {
146-
return payload;
147-
},
148-
});
149-
150-
// Register an output handler
151-
orchestrator.registerIOHandler({
152-
name: "ui_chat_reply",
153-
role: "output",
154-
schema: z.object({
155-
userId: z.string().optional(),
156-
message: z.string(),
157-
}),
158-
handler: async (payload) => {
159-
console.log(`Reply to user ${payload.userId}: ${payload.message}`);
160-
},
161-
});
162119
```
163120

164121
### Goals
165122

166-
The agent uses Chain of Thought processing to:
123+
The agent utilizes Chain of Thought to:
167124

168-
- Plan strategies for achieving goals
169-
- Break down complex goals into subgoals
170-
- Execute actions to accomplish goals
171-
- Learn from experiences and store knowledge
125+
- Formulate strategies for goals.
126+
- Decompose complex objectives into actionable subgoals.
127+
- Learn from outcomes to improve future actions.
172128

173-
### Monitor Progress
129+
### Monitoring Progress
174130

175-
Subscribe to events to track the agent's thinking and actions:
131+
Track the agent’s actions by subscribing to events:
176132

177133
```typescript
178134
dreams.on("think:start", ({ query }) => {
179-
console.log("🧠 Starting to think about:", query);
135+
console.log("🧠 Thinking about:", query);
180136
});
181137

182138
dreams.on("action:complete", ({ action, result }) => {
183-
console.log("✅ Action complete:", {
139+
console.log("✅ Action completed:", {
184140
type: action.type,
185141
result,
186142
});
@@ -189,32 +145,14 @@ dreams.on("action:complete", ({ action, result }) => {
189145

190146
### Protocol Design
191147

192-
The system consists of several key components:
193-
194-
1. **Context Layers**
195-
196-
- Game/Application State
197-
- Historical Data
198-
- Execution Context
148+
The system's architecture includes:
199149

200-
2. **Chain of Thought Kernel**
150+
1. **Context Layers**: Game/Application State, Historical Data, Execution Context.
151+
2. **Chain of Thought Kernel**: Reasoning Engine, Memory Integration, Action Planning.
152+
3. **Vector Database**: Experience Storage, Knowledge Retrieval, Similarity Search.
153+
4. **Swarm Rooms**: Multi-Agent Collaboration and Knowledge Sharing.
201154

202-
- Reasoning Engine
203-
- Memory Integration
204-
- Action Planning
205-
206-
3. **Vector Database**
207-
208-
- Experience Storage
209-
- Knowledge Retrieval
210-
- Similarity Search
211-
212-
4. **Swarm Rooms**
213-
- Multi-Agent Collaboration
214-
- Knowledge Sharing
215-
- Federated Learning
216-
217-
### System Flow
155+
### System Flow Diagram
218156

219157
```mermaid
220158
graph TD
@@ -255,67 +193,9 @@ graph TD
255193
style Memory System fill:#abf,stroke:#333,stroke-width:2px
256194
```
257195

258-
The system works through several coordinated components:
259-
260-
1. **Orchestrator**: The central coordinator that:
261-
262-
- Manages input/output/action handlers
263-
- Routes data through the system
264-
- Schedules recurring tasks
265-
- Maintains the autonomous flow
266-
267-
2. **Chain of Thought (CoT)**: The reasoning engine that:
268-
269-
- Processes complex queries asked - it can be called directly like in the examples or through the orchestrator
270-
- Makes decisions based on goals
271-
- Determines required actions
272-
- Learns from outcomes
273-
274-
3. **Memory System**:
275-
276-
- Vector Memory stores experiences and knowledge
277-
- Room Manager organizes conversations and contexts
278-
- Enables retrieval of relevant past experiences
279-
280-
4. **Goal System**:
281-
- Breaks down complex objectives
282-
- Manages dependencies between goals
283-
- Tracks progress and completion
284-
- Adapts strategies based on outcomes
285-
286-
This architecture allows for:
287-
288-
- Flexible composition of handlers
289-
- Autonomous decision-making
290-
- Contextual memory and learning
291-
- Goal-oriented behavior
292-
293-
Each component can be used independently or composed together for more complex behaviors. The system is designed to be extensible, allowing new handlers and components to be added as needed.
294-
295-
## Development
296-
297-
Design principles:
298-
299-
- **Lightweight**: Keep the codebase small and focused
300-
- **Composable**: Easy to combine functions and tools
301-
- **Extensible**: Simple to add new capabilities
302-
303-
## Roadmap
304-
305-
- [x] Chain of Thought
306-
- [ ] Context Layers
307-
- [ ] Graph memory system
308-
- [ ] Swarm Rooms
309-
- [ ] Create 'sleeves' abstract for dynamic context generation
310-
311-
> ⚠️ **Warning**: Daydreams is currently in pre-alpha stage, we are looking for feedback and collaboration.
312-
313-
## Contributors
314-
315-
<a href="https://github.com/daydreamsai/daydreams/graphs/contributors">
316-
<img src="https://contrib.rocks/image?repo=daydreamsai/daydreams" alt="Daydreams contributors" />
317-
</a>
318-
319-
## Star History
196+
### Key Features
320197

321-
[![Star History Chart](https://api.star-history.com/svg?repos=daydreamsai/daydreams&type=Date)](https://star-history.com/#daydreamsai/daydreams&Date)
198+
- Flexible handler composition.
199+
- Autonomous decision-making.
200+
- Contextual memory and learning.
201+
- Goal-oriented behavior.

0 commit comments

Comments
 (0)