poietic-generator-api
Version, currently 1.0.02 versions
- 1.0.0latestOct 12, 2025
- pre-cleanup-2026-06not indexedJun 9, 2026
github.com/OAuber/poietic-generator-llm-agents
AI-powered autonomous drawing agents for the Poietic Generator`
Installation
# Add this to your shard.yml
dependencies:
poietic-generator-api:
github: OAuber/poietic-generator-llm-agents
version: ~> 1.0.0Then run:
shards installshard.yml
No shard.yml has been indexed for 1.0.0. You can read it on the repository.
Dependencies
This version declares no dependencies.
README
π€ Poietic Generator - LLM Agents
AI-powered autonomous drawing agents for the Poietic Generator
Part of the Poietic Generator ecosystem - A collaborative real-time drawing experiment since 1986.
π Table of Contents
- Overview
- Features
- Architecture
- Quick Start
- Installation
- Configuration
- Usage
- Supported LLM Providers
- How It Works
- Advanced Features
- Documentation
- Examples
- Contributing
- License
- Credits
π― Overview
This package provides autonomous AI agents that can participate in the Poietic Generator collaborative drawing experience. Each agent controls a 20Γ20 pixel cell and draws in real-time, creating emergent collective artworks.
What is Poietic Generator?
The Poietic Generator is a pioneering collaborative drawing system where multiple participants draw simultaneously on a shared grid. Each user sees their own 20Γ20 cell plus their neighbors' cells, creating a large evolving mosaic. This package extends this concept to AI agents, enabling human-AI co-creation.
Why LLM Agents?
- π¨ Creative autonomy: Agents make artistic decisions based on spatial context
- π€ Collaboration: Agents detect and interact with neighboring cells (human or AI)
- π§ Emergent behavior: Complex patterns emerge from simple local rules
- π¬ Experimentation: Study AI creativity, cooperation, and collective intelligence
β¨ Features
Core Capabilities
- β Multi-LLM Support: Anthropic Claude, OpenAI GPT, Ollama (local), Mistral
- β Real-time Drawing: WebSocket-based live updates (20-25 pixels per iteration)
- β Spatial Awareness: Agents analyze their 8 neighbors (N, S, E, W, NE, NW, SE, SW)
- β Collaborative Strategies: Mirror, translation, rotation of neighbor patterns
- β Artistic Techniques: 5 color palettes (monochromatic, complementary, triadic, analogous, warmβcold)
- β Temporal Continuity: Agents remember and continue their previous drawings
- β Graceful Fallback: Automatic recovery when LLM output fails
Advanced Features
- π¨ Depth & Shadows: Color gradients for 3D effects
- π Progressive Drawing: Pixels sent gradually over iteration interval (smooth animation)
- π Performance Analytics: Real-time monitoring (tokens/sec, response times)
- π‘οΈ Robust Parsing: Handles malformed LLM outputs with compact text format
- π Palette Techniques: Contrast, harmony, atmospheric perspective
- π§© Border Prioritization: Enhanced collaboration at cell boundaries
ποΈ Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Poietic Generator β
β (Crystal WebSocket Server) β
β Port 3001 β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββ΄βββββββββββββ
β β
ββββββββββΌβββββββββ βββββββββΌβββββββββ
β Human Browser β β AI Agent β
β (Viewer) β β (ai-player) β
βββββββββββββββββββ ββββββββββ¬ββββββββ
β
ββββββββββΌβββββββββ
β AI Proxy Serverβ
β (FastAPI) β
β Port 8003 β
ββββββββββ¬βββββββββ
β
βββββββββββββββββββΌββββββββββββββββββ
β β β
ββββββΌββββββ ββββββββΌβββββββ ββββββββΌβββββββ
β Anthropicβ β OpenAI β β Ollama β
β Claude β β GPT β β (Local) β
ββββββββββββ βββββββββββββββ βββββββββββββββ
Components
public/ai-player.html: Web interface for launching AI agentspublic/js/ai-player.js: Agent orchestration, WebSocket client, iteration looppublic/js/spatial-analysis.js: Neighbor detection and spatial context generationpublic/js/llm-adapters/: LLM-specific prompt engineering and response parsingpython/poietic_ai_server.py: FastAPI proxy for LLM APIs (CORS, analytics, Ollama)docs/MANUEL_*.md: Instruction manuals for each LLM (in French, used as system prompts)
π Quick Start
Prerequisites
- Poietic Generator server running (Crystal): Installation guide
- Python 3.8+ (for AI proxy server)
- Node.js / Web browser (for AI agent client)
- API keys for external LLMs (Anthropic, OpenAI) OR Ollama for local inference
1. Start the Poietic Generator Server
cd poietic-generator-api
./bin/poietic-generator-api --port=3001
2. Start the AI Proxy Server
cd python
pip install -r requirements.txt
python poietic_ai_server.py
# Server running on http://localhost:8003
3. Launch AI Agents
Open http://localhost:3001/ai-player.html in your browser:
- Select LLM: Choose Ollama (free, local) or Anthropic/OpenAI (requires API key)
- Configure: Set iteration interval (default: 0s = immediate)
- Customize (optional): Add a user prompt ("Draw abstract patterns", "Use only warm colors", etc.)
- Start: Click "Start" β Agent connects and begins drawing
4. View the Collective Drawing
Open http://localhost:3001 in another browser tab to see humans and AI agents drawing together in real-time!
π¦ Installation
Clone the Repository
git clone https://github.com/OAuber/poietic-generator-llm-agents.git
cd poietic-generator-llm-agents
Python Dependencies
cd python
pip install -r requirements.txt
Required packages:
fastapi(web framework)uvicorn(ASGI server)httpx(async HTTP client for Ollama)
Ollama (Optional, for Local Inference)
Install Ollama: https://ollama.ai/
# Pull the recommended model
ollama pull llama3.2:3b
# Or deploy on OVHcloud AI Deploy (GPU)
# See: https://www.ovhcloud.com/en/public-cloud/ai-deploy/
API Keys (Optional, for Cloud LLMs)
- Anthropic: Get API key
- OpenAI: Get API key
Store keys securely (.env file, environment variables, or enter directly in UI).
βοΈ Configuration
AI Proxy Server
Edit python/poietic_ai_server.py:
# Ollama endpoint (local or remote)
OLLAMA_URL = "http://localhost:11434" # Local
# OLLAMA_URL = "https://your-ollama-instance.app.cloud.ovh.net" # OVHcloud
# CORS origins (allow AI agent frontend)
origins = [
"http://localhost:3000",
"http://localhost:3001",
"http://localhost:8080",
]
Agent Behavior
Edit public/js/llm-adapters/ollama.js (or anthropic.js):
// Number of pixels per iteration
maxTokens: 1000 // ~20-25 pixels for Ollama
// Ollama model
model: "llama3.2:3b" // Lightweight, fast
// model: "llama3.1:8b" // Better quality, slower
// Generation parameters
temperature: 0.7 // Creativity
repeat_penalty: 0.9 // Allow repetition for patterns
Instruction Manuals
Edit docs/MANUEL_OLLAMA.md to customize agent behavior:
## Section 4: FORMES Γ DESSINER
Tu peux dessiner :
- Geometric: circles, triangles, rectangles, spirals
- Letters/Symbols: A-Z, *, +, -, arrows
- Patterns: checkerboard, gradients, waves
- Organic: flowers, trees, fractals
π Usage
Basic Agent Launch
# 1. Start Poietic Generator
cd poietic-generator-api
./bin/poietic-generator-api --port=3001
# 2. Start AI proxy
cd python
python poietic_ai_server.py
# 3. Open browser
firefox http://localhost:3001/ai-player.html
Advanced: Multiple Agents
Open multiple tabs of ai-player.html to launch several agents simultaneously. Each agent gets a unique cell and can collaborate with neighbors!
Custom Prompts
Use the "Custom Prompt" field to guide agent behavior:
"Draw only geometric shapes""Use warm colors (red, orange, yellow)""Create a gradient from top to bottom""Collaborate with neighbors by extending their patterns"
Monitoring
- Agent Console: View logs in browser DevTools (F12)
- Analytics Dashboard:
http://localhost:8003/analytics-dashboard.html - Ollama Stats:
http://localhost:8003/ollama-stats.html
π€ Supported LLM Providers
| Provider | Model | Cost | Speed | Quality | Local |
|---|---|---|---|---|---|
| Ollama | llama3.2:3b | Free | β‘β‘β‘ Fast | βββ Good | β Yes |
| Ollama | llama3.1:8b | Free | β‘β‘ Medium | ββββ Very Good | β Yes |
| Anthropic | claude-3-haiku | $0.25/M tokens | β‘β‘β‘ Fast | ββββ Very Good | β Cloud |
| Anthropic | claude-3.5-sonnet | $3/M tokens | β‘β‘ Medium | βββββ Excellent | β Cloud |
| OpenAI | gpt-4o-mini | $0.15/M tokens | β‘β‘β‘ Fast | ββββ Very Good | β Cloud |
Recommendation: Start with Ollama llama3.2:3b (free, fast, local). Upgrade to llama3.1:8b or Claude for better artistic quality.
π§ How It Works
Agent Loop
1. Connect to Poietic Generator WebSocket
2. Receive initial state (my cell + neighbors)
3. LOOP every N seconds:
a. Analyze spatial context (8 neighbors)
b. Build prompt with:
- My last strategy (continuity)
- Neighbor updates (collaboration)
- Color palette (artistic technique)
- Custom user prompt
c. Send prompt to LLM
d. Parse response (strategy + pixels)
e. Send pixels progressively to server
f. Update neighbors' tracking
4. Repeat until stopped
Spatial Analysis
Each agent sees:
- 8 neighbors (N, S, E, W, NE, NW, SE, SW)
- Recent updates (last 200 pixels per neighbor, ~8-10 iterations)
- Border pixels (prioritized for collaboration)
Example prompt section:
Neighbors:
E (right, x=19) πBORDER(3): 2,7:#E91E63 2,6:#1ABC9C 2,5:#1ABC9C
N (top, y=0) πBORDER(12): 5,17:#964B00 7,17:#964B00 ...
Collaboration ideas (choose ONE or draw freely):
[1] π Mirror neighbor E: 19,7:#E91E63 19,6:#1ABC9C 19,5:#1ABC9C
[2] π Extend neighbor N: 5,0:#964B00 7,0:#964B00 9,0:#964B00
Compact Format
To minimize parsing errors, Ollama uses a compact text format instead of JSON:
strategy: yellow star with shadows
pixels: 10,5:#F1C40F 11,5:#F39C12 10,6:#D68910 11,6:#E67E22 ...
Benefits:
- β Simpler for LLMs to generate
- β Robust regex parsing
- β Graceful fallback (generates random shapes if parsing fails)
Color Palettes
5 artistic techniques for depth and harmony:
- Monochromatique (Monochromatic): 8 shades of one color (dark shadows β light highlights)
- ComplΓ©mentaires (Complementary): 2 opposite colors (strong contrast)
- Triade (Triadic): 3 evenly-spaced colors (balanced harmony)
- Analogues (Analogous): Adjacent colors (smooth transitions)
- ChaudβFroid (WarmβCold): Red/orange β blue/violet (atmospheric perspective)
Example:
Colors (Monochromatic): #3A2A1F #5C4A3F #7D6A5F #9D8A7F #BDA9A0 #DCC9C0 #F5E9E0 #FFF9F5
Use: dark for shadows/depth, light for highlights/foreground.
π¨ Advanced Features
Temporal Continuity
Agents remember their previous strategy and are encouraged to complete drawings:
Last iteration: "yellow star with shadows". CONTINUE it OR start new.
Result: Agents finish stars, letters, patterns instead of changing theme every iteration!
Border Collaboration
Agents prioritize pixels at common borders (x=0, x=19, y=0, y=19):
# Filter neighbor updates for border pixels
if direction == 'E': # East neighbor
border_pixels = updates.filter(u => u.x <= 2) # Their left border
# Transform to my right border (x=19)
Result: Seamless connections between cells (mirrored patterns, extended lines).
Progressive Drawing
Pixels are sent one-by-one over 80% of the iteration interval:
const delayBetweenPixels = (targetInterval * 0.8) / pixels.length;
for (const pixel of pixels) {
sendPixel(pixel);
await sleep(delayBetweenPixels);
}
Result: Smooth animation instead of sudden "flashes" every iteration.
Geometric Transformations
When neighbors draw at borders, agents receive transformation suggestions:
- Mirror (horizontal/vertical)
- Translation (shift pattern)
- Rotation (90Β°)
Example:
[1] π Mirror neighbor W: 0,5:#E74C3C 1,5:#C85A3F 2,5:#AF7AC5
[2] π Translate neighbor N: 5,0:#964B00 7,0:#964B00 9,0:#964B00
π Documentation
docs/MANUEL_OLLAMA.md: Instructions for Ollama agents (French)docs/MANUEL_ANTHROPIC.md: Instructions for Claude agents (French)docs/MANUEL_OPENAI.md: Instructions for GPT agents (French)docs/ARCHITECTURE.md: Technical architecture (coming soon)docs/API.md: API reference (coming soon)
Architecture Diagrams
See docs/ARCHITECTURE_FORMATS_DONNEES.md for:
- Data flow between components
- JSON vs compact format usage
- WebSocket message protocol
π‘ Examples
Example 1: Monochromatique Agent
// Agent receives palette
Colors (Monochromatic): #3A2A1F #5C4A3F #7D6A5F #9D8A7F #BDA9A0 #DCC9C0
Use: dark for shadows/depth, light for highlights/foreground.
// Agent draws a sphere with shadows
strategy: sphere with shadows
pixels: 10,10:#3A2A1F 11,10:#5C4A3F 10,11:#7D6A5F 11,11:#9D8A7F ...
Visual: π A shaded ball (dark left/bottom, light right/top)
Example 2: Collaborative Border Extension
// Agent sees neighbor E drawing at border
E (right, x=19) πBORDER(3): 2,7:#E91E63 2,6:#1ABC9C 2,5:#1ABC9C
// Collaboration suggestion
[1] π Mirror neighbor E: 19,7:#E91E63 19,6:#1ABC9C 19,5:#1ABC9C
// Agent chooses to collaborate
strategy: mirror [1]
pixels: 19,7:#E91E63 19,6:#1ABC9C 19,5:#1ABC9C 18,7:#C85A3F ...
Visual: Seamless color continuity across cell boundary!
Example 3: Temporal Continuity
// Iteration 1
strategy: yellow star
pixels: 10,8:#F1C40F 11,8:#F39C12 9,9:#E67E22 ...
// Iteration 2 (agent remembers)
Last iteration: "yellow star". CONTINUE it OR start new.
strategy: continue yellow star with highlights
pixels: 10,7:#F9E79F 11,7:#F8C471 9,10:#CA6F1E ...
// Result: A complete, finished star instead of abandoned fragments!
π€ Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-improvement - Commit your changes:
git commit -m 'Add amazing improvement' - Push to the branch:
git push origin feature/amazing-improvement - Open a Pull Request
Development Setup
# Clone your fork
git clone https://github.com/YOUR_USERNAME/poietic-generator-llm-agents.git
cd poietic-generator-llm-agents
# Install dependencies
cd python && pip install -r requirements.txt
# Run tests (coming soon)
# pytest tests/
Code Style
- JavaScript: ES6+, 4-space indentation
- Python: PEP 8, Black formatter
- Documentation: English (code comments can be French)
π License
MIT License - see LICENSE file for details.
π Credits
Original Concept
- Olivier Auber - Creator of the Poietic Generator (1986-2025)
- http://poietic-generator.net/
LLM Integration
- Olivier Auber - Design & prompt engineering
- Community contributors - Testing, feedback, improvements
Related Projects
- Poietic Generator (Crystal/Crystal) - Main server
- Poietic Generator History - Historical documentation
Acknowledgments
- Anthropic, OpenAI, Meta (Llama) - LLM providers
- OVHcloud - GPU infrastructure for Ollama deployment
- Crystal community - WebSocket server framework
- FastAPI community - Python proxy server
π Links
- Main Project: Poietic Generator
- Live Demo: http://poietic-generator.net/ (coming soon)
- Documentation: https://poietic-generator.github.io/poietic-generator-documentation/
- Report Issues: GitHub Issues
Made with β€οΈ for collective AI creativity π¨π€
"What emerges when (humans and) AI draw together?"
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.0.0- Tagged
- Oct 12, 2025
- Commit
a2d8f312b175- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/OAuber/poietic-generator-llm-agents
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 2