kirikir13 commited on
Commit
90f7def
ยท
verified ยท
1 Parent(s): 77a06d0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -376
README.md CHANGED
@@ -1,371 +1,46 @@
1
- # ๐ŸŒŸ DReamMachine: Dream A LiL(LLM) Dream
2
-
3
- **Multi-Agent LLM Orchestration System for Breakthrough Innovation Discovery via Guided Hallucination**
4
-
5
  ---
6
-
7
- ## ๐ŸŽฏ What is DReamMachine?
8
-
9
- DReamMachine is an experimental AI system that uses "controlled hallucination" to discover breakthrough innovations. By orchestrating multiple specialized LLMs through a simulated 100-year creative journey, the system explores ideas from initial discovery through real-world challenges to mass adoption and legacy.
10
-
11
- ### The Core Concept
12
-
13
- Instead of asking LLMs to solve known problems, DReamMachine encourages them to **dream** - to hallucinate creative solutions in a guided, structured way. Multiple AI agents work together:
14
-
15
- - **Dreamers** generate wild, creative ideas
16
- - **Analysts** evaluate feasibility and extract technical details
17
- - **Curators** score and select the most promising concepts
18
- - **The System** advances successful ideas through life stages
19
-
20
- Ideas that score high on both originality AND feasibility progress through four 25-year life stages, facing different challenges and evolving along the way.
21
-
22
  ---
23
 
24
- ## ๐Ÿ—๏ธ Architecture
25
-
26
- ### The 7-Step Dream Cycle
27
-
28
- Each "dream round" executes these steps:
29
 
30
- 1. **A.1 Setup** - Initialize life stage prompt and constraints
31
- 2. **A.2 Dream & Generate** - 3 creative LLMs generate ideas simultaneously
32
- 3. **A.3 Log & Narrate** - Writer/Logger/Narrator refine outputs into coherent narratives
33
- 4. **A.4 Deep Think & Verify** - Analytical LLM evaluates scientific feasibility
34
- 5. **A.5 Curate & Grade** - Evaluation LLM scores across multiple dimensions
35
- 6. **A.6 Data Storage** - Archive complete session to HuggingFace Dataset
36
- 7. **A.7 Reforge Loop** - Decide: advance to next stage or start new idea?
37
 
38
- ### Life Stages (Simulated 100-Year Lifespan)
39
 
40
- | Stage | Age Range | Focus | Challenge |
41
- |-------|-----------|-------|-----------|
42
- | **Init** | 1-25 | Foundational Discovery | Bold creativity, breakthrough thinking |
43
- | **Mid** | 26-50 | Commercialization & Crisis | Real-world market/resource/technical challenges |
44
- | **Late** | 51-75 | Mass Adoption & Ethics | Societal impact, unintended consequences |
45
- | **Final** | 76-100 | Legacy & Vision | Long-term civilizational impact, next generation |
46
-
47
- ### Agent Roles
48
-
49
- | Role | Model Type | Temperature | Purpose |
50
- |------|------------|-------------|---------|
51
- | **Dreamers (3x)** | Creative/Large (Mixtral, Llama 3) | 0.85-0.9 | Generate radical ideas |
52
- | **Writer** | Medium (Mistral 7B) | 0.6 | Create compelling narratives |
53
- | **Logger** | Medium (Mistral 7B) | 0.4 | Extract technical specifications |
54
- | **Narrator** | Creative (Nous-Hermes) | 0.5 | Present ideas engagingly |
55
- | **Deep Thinker** | Large/Analytical (Llama 3 70B) | 0.3 | Evaluate feasibility |
56
- | **Curator** | Large/Analytical (Llama 3 70B) | 0.2 | Score and decide advancement |
57
-
58
- ---
59
-
60
- ## ๐Ÿš€ Quick Start
61
-
62
- ### Prerequisites
63
-
64
- - Python 3.9+
65
- - HuggingFace account with API token
66
- - (Optional) HuggingFace Spaces Pro account for Zero GPU
67
-
68
- ### Local Installation
69
-
70
- 1. **Clone the repository**
71
- ```bash
72
- git clone <your-repo-url>
73
- cd DReamMachine
74
- ```
75
-
76
- 2. **Install dependencies**
77
- ```bash
78
- pip install -r requirements.txt
79
- ```
80
-
81
- 3. **Configure environment**
82
- ```bash
83
- cp .env.example .env
84
- # Edit .env and add your HF_TOKEN
85
- ```
86
-
87
- 4. **Run the Gradio interface**
88
- ```bash
89
- python app.py
90
- ```
91
-
92
- 5. **Access the interface**
93
- Open your browser to: `http://localhost:7860`
94
-
95
- ### HuggingFace Spaces Deployment
96
-
97
- 1. **Create a new Space**
98
- - Go to https://huggingface.co/spaces
99
- - Click "Create new Space"
100
- - Choose "Gradio" as the SDK
101
- - Select "Private" if you want to keep it confidential
102
-
103
- 2. **Upload files**
104
- - Upload all Python files, config.yaml, requirements.txt, and README.md
105
- - Or connect your GitHub repository
106
-
107
- 3. **Set environment variables**
108
- - Go to Settings โ†’ Repository secrets
109
- - Add `HF_TOKEN` with your HuggingFace API token
110
-
111
- 4. **Enable Zero GPU (Pro users)**
112
- - Go to Settings โ†’ Hardware
113
- - Select "Zero GPU" option
114
-
115
- 5. **The Space will automatically start!**
116
-
117
- ---
118
-
119
- ## ๐Ÿ“– Usage Guide
120
-
121
- ### Running a Single Dream Round
122
-
123
- 1. Open the "Single Dream Round" tab
124
- 2. Select a life stage (start with `init_1_25`)
125
- 3. Click "๐Ÿš€ Run Dream Round"
126
- 4. Wait for completion (typically 2-5 minutes)
127
- 5. Review results:
128
- - **Session Summary**: Scores and next action
129
- - **Narrative Pitch**: The refined idea
130
- - **Technical Components**: What's needed to build it
131
- - **Feasibility Report**: Scientific evaluation
132
- - **Curator Scorecard**: Detailed scoring
133
-
134
- ### Running Batch Mode
135
-
136
- 1. Open the "Batch Mode" tab
137
- 2. Set number of rounds (1-50)
138
- 3. Set sleep interval between rounds
139
- 4. Click "๐Ÿš€ Run Batch Mode"
140
- 5. View aggregate statistics and session IDs
141
-
142
- ### Viewing Session History
143
-
144
- 1. Open the "Session History" tab
145
- 2. Click "๐Ÿ”„ Refresh History"
146
- 3. Browse all past sessions with scores and timestamps
147
-
148
- ---
149
-
150
- ## โš™๏ธ Configuration
151
-
152
- ### Model Selection
153
-
154
- Edit `config.yaml` to customize models:
155
-
156
- ```yaml
157
- models:
158
- dreamers:
159
- - model_id: "mistralai/Mixtral-8x7B-Instruct-v0.1"
160
- temperature: 0.9
161
- max_tokens: 1000
162
- # ... more models
163
- ```
164
-
165
- ### Constraints
166
-
167
- Customize the constraints that guide dreaming:
168
-
169
- ```yaml
170
- constraints:
171
- physics: "Must use current or near-future physics (within 50 years)"
172
- ethics: "Must solve a global humanitarian problem"
173
- feasibility: "Must be achievable with existing materials"
174
- scope: "Must impact at least 1 million people"
175
- ```
176
-
177
- ### Scoring Thresholds
178
-
179
- Adjust when ideas advance to the next stage:
180
-
181
- ```yaml
182
- orchestration:
183
- auto_advance_threshold:
184
- feasibility_min: 7 # 1-10 scale
185
- originality_min: 5 # 1-10 scale
186
- ```
187
-
188
- ### Prompt Detail Level
189
-
190
- Choose how detailed prompts are:
191
-
192
- ```yaml
193
- prompt_detail_level: "full" # Options: "simple", "moderate", "full"
194
- ```
195
-
196
- ---
197
-
198
- ## ๐Ÿ“Š Output & Logging
199
-
200
- ### Local JSON Logs
201
-
202
- All sessions are saved to `./logs/` directory:
203
- - Individual session files: `session_YYYYMMDD_HHMMSS_N.json`
204
- - Chunked archives: `chunk_YYYYMMDD_HHMMSS.json` (every 100 sessions)
205
-
206
- ### HuggingFace Dataset
207
-
208
- Sessions are automatically logged to a private HuggingFace Dataset:
209
- - Dataset name: `{username}/dreammachine-logs`
210
- - Format: Structured dataset with columns for all outputs
211
- - Access: Private by default (configurable)
212
-
213
- ### Sample Session Data Structure
214
-
215
- ```json
216
- {
217
- "session_id": "session_20250114_123045_0",
218
- "timestamp": "2025-01-14T12:30:45",
219
- "life_stage": "init_1_25",
220
- "dream_outputs": ["dream1", "dream2", "dream3"],
221
- "pitch_narrative": "The Solar Fiber Blanket...",
222
- "technical_components": "1. Photovoltaic nano-fibers...",
223
- "feasibility_report": "Scientific Validity: 8 - ...",
224
- "curator_scorecard": {
225
- "originality": 9,
226
- "feasibility": 8,
227
- "global_impact": 9,
228
- "narrative_coherence": 8,
229
- "reforge_flag": true
230
- },
231
- "next_action": {
232
- "type": "advance",
233
- "next_stage": "mid_26_50"
234
- }
235
- }
236
- ```
237
-
238
- ---
239
-
240
- ## ๐Ÿงช Advanced Usage
241
-
242
- ### Running from CLI
243
-
244
- You can create a CLI script to run DReamMachine:
245
-
246
- ```python
247
- # run_dream.py
248
- import os
249
- from orchestrator import DreamOrchestrator
250
-
251
- # Initialize
252
- orchestrator = DreamOrchestrator(
253
- config_path="config.yaml",
254
- hf_token=os.getenv('HF_TOKEN')
255
- )
256
-
257
- # Run single round
258
- result = orchestrator.run_dream_round()
259
-
260
- # Or run batch
261
- results = orchestrator.run_batch_mode(num_rounds=10, sleep_between=30)
262
-
263
- # Or run scheduled mode (for HF Spaces)
264
- orchestrator.run_scheduled_mode() # Runs until max_runtime
265
- ```
266
-
267
- ### Programmatic Access
268
-
269
- ```python
270
- from llm_agent import LLMAgent
271
- from prompt_manager import PromptManager
272
- from data_logger import DataLogger
273
-
274
- # Initialize components individually
275
- agent = LLMAgent(config_path="config.yaml")
276
- prompts = PromptManager(config_path="config.yaml")
277
- logger = DataLogger(config_path="config.yaml")
278
-
279
- # Run custom workflows
280
- prompt = prompts.get_life_stage_prompt('init_1_25')
281
- dreams = agent.run_parallel_dreamers(prompt)
282
- # ... process as needed
283
- ```
284
-
285
- ---
286
-
287
- ## ๐ŸŽจ Customization
288
-
289
- ### Adding New Life Stages
290
-
291
- Edit `prompt_manager.py` to add new stages:
292
-
293
- ```python
294
- def _get_custom_phase_prompt(self, previous_context):
295
- return """
296
- # Your custom life stage prompt here
297
- """
298
- ```
299
-
300
- ### Changing Scoring Criteria
301
-
302
- Modify the curator prompt in `prompt_manager.py`:
303
-
304
- ```python
305
- def get_curator_prompt(self, narrative, feasibility_report):
306
- # Add custom scoring dimensions
307
- # Modify JSON schema
308
- ```
309
-
310
- ### Using Different Models
311
-
312
- Update `config.yaml` with any HuggingFace model:
313
-
314
- ```yaml
315
- models:
316
- dreamers:
317
- - model_id: "your-org/your-model"
318
- temperature: 0.8
319
- max_tokens: 1500
320
- ```
321
-
322
- ---
323
-
324
- ## ๐Ÿ› ๏ธ Troubleshooting
325
-
326
- ### Common Issues
327
-
328
- **"HF_TOKEN not found"**
329
- - Set the `HF_TOKEN` environment variable
330
- - Or add it to `.env` file
331
- - Or pass it directly: `DreamOrchestrator(hf_token="your-token")`
332
-
333
- **"Model timeout or rate limit"**
334
- - HuggingFace Inference API has rate limits
335
- - Increase `sleep_between` in batch mode
336
- - Consider using smaller models
337
- - Upgrade to HF Pro for higher limits
338
-
339
- **"JSON parsing error in curator"**
340
- - The curator sometimes returns malformed JSON
341
- - System will use default scores and continue
342
- - Check logs for raw output
343
- - Consider adjusting curator temperature
344
-
345
- **"Dataset creation failed"**
346
- - Ensure HF_TOKEN has write permissions
347
- - Check dataset name doesn't already exist
348
- - Set `save_to_hf_dataset: false` to disable
349
 
350
  ---
351
 
352
  ## ๐Ÿ“ Project Structure
353
 
354
- ```
355
  DReamMachine/
356
- โ”œโ”€โ”€ app.py # Gradio interface (HuggingFace Spaces entry point)
357
- โ”œโ”€โ”€ orchestrator.py # Main orchestration engine (7-step cycle)
358
- โ”œโ”€โ”€ llm_agent.py # HuggingFace API interaction layer
359
- โ”œโ”€โ”€ prompt_manager.py # Prompt templates and life stages
360
- โ”œโ”€โ”€ data_logger.py # Logging to JSON and HF Dataset
361
- โ”œโ”€โ”€ config.yaml # Configuration (models, settings, constraints)
362
- โ”œโ”€โ”€ requirements.txt # Python dependencies
363
- โ”œโ”€โ”€ .env.example # Environment variable template
364
- โ”œโ”€โ”€ .gitignore # Git ignore rules
365
- โ”œโ”€โ”€ LICENSE # MIT License
366
- โ”œโ”€โ”€ README.md # This file
367
- โ””โ”€โ”€ logs/ # Local JSON logs (created at runtime)
368
- ```
 
369
 
370
  ---
371
 
@@ -391,24 +66,6 @@ DReamMachine/
391
 
392
  ---
393
 
394
- ## ๐Ÿ“ License
395
-
396
- MIT License - see [LICENSE](LICENSE) file
397
-
398
- ---
399
-
400
- ## ๐Ÿ™ Credits
401
-
402
- **Created by**: Dave Roby / DRStudios
403
-
404
- **Concept Inspired by**: Conversations with Gemini 2.5 Flash about controlled hallucination, multi-agent systems, and guided creativity
405
-
406
- **Built with**: Claude Sonnet 4.5 via Claude Code
407
-
408
- **Original Vision**: The idea of making LLMs "dream" came from wanting to discover innovations that don't exist yet but COULD exist - by guiding creative hallucination through simulated lifespans with multiple specialized agents.
409
-
410
- ---
411
-
412
  ## ๐Ÿ”ฎ Future Enhancements
413
 
414
  - [ ] Add visualization dashboard for session analytics
@@ -427,8 +84,8 @@ MIT License - see [LICENSE](LICENSE) file
427
 
428
  For questions, suggestions, or collaboration:
429
  - Open an issue on GitHub
430
- - Contact: Dave Roby / DRStudios
431
 
432
  ---
433
 
434
- **"Dream a little dream... let the LLMs imagine the future."** ๐ŸŒŸ
 
 
 
 
 
1
  ---
2
+ title: DReamMachine
3
+ emoji: ๐Ÿš€
4
+ colorFrom: purple
5
+ colorTo: yellow
6
+ sdk: gradio
7
+ sdk_version: "4.16.0"
8
+ app_file: app.py
9
+ pinned: false
10
+ # thumbnail: (your image URL here, optional)
11
+ short_description: "Multi-Agent LLM Dream Machine & Idea Orchestrator"
 
 
 
 
 
 
12
  ---
13
 
14
+ # DReamMachine
 
 
 
 
15
 
16
+ A private, modular research framework for automating creative, uncensored invention cycles using the latest open AI models.
 
 
 
 
 
 
17
 
18
+ ## ๐Ÿ‘ค Credits
19
 
20
+ - Architect/Designer: Dave Roby / DRStudios
21
+ - Worksheet/Buildsheet Author: Gemini Flash
22
+ - Core Collaborator: Claude (model agent)
23
+ - Technical Assistant & Workflow Coordinator: Comet AI Assistant (Perplexity)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  ---
26
 
27
  ## ๐Ÿ“ Project Structure
28
 
 
29
  DReamMachine/
30
+ โ”œโ”€โ”€ app.py # Gradio interface (HuggingFace Spaces entry point)
31
+ โ”œโ”€โ”€ orchestrator.py # Main orchestration engine (7-step cycle)
32
+ โ”œโ”€โ”€ llm_agent.py # HuggingFace API interaction layer
33
+ โ”œโ”€โ”€ prompt_manager.py # Prompt templates and life stages
34
+ โ”œโ”€โ”€ data_logger.py # Logging to JSON and HF Dataset
35
+ โ”œโ”€โ”€ config.yaml # Configuration (models, settings, constraints)
36
+ โ”œโ”€โ”€ requirements.txt # Python dependencies
37
+ โ”œโ”€โ”€ .env.example # Environment variable template
38
+ โ”œโ”€โ”€ .gitignore # Git ignore rules
39
+ โ”œโ”€โ”€ LICENSE # MIT License
40
+ โ”œโ”€โ”€ README.md # This file
41
+ โ””โ”€โ”€ logs/ # Local JSON logs (created at runtime)
42
+
43
+ text
44
 
45
  ---
46
 
 
66
 
67
  ---
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  ## ๐Ÿ”ฎ Future Enhancements
70
 
71
  - [ ] Add visualization dashboard for session analytics
 
84
 
85
  For questions, suggestions, or collaboration:
86
  - Open an issue on GitHub
87
+ - Contact: Dave Roby / DRStudios: Drdrproduction@gmail.com
88
 
89
  ---
90
 
91
+ **"Dream a little dream... let the LLMs imagine the future."** ๐ŸŒŸ