robot_lab 0.0.1 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/deploy-github-pages.yml +9 -9
- data/.irbrc +6 -0
- data/CHANGELOG.md +90 -0
- data/README.md +203 -46
- data/Rakefile +70 -1
- data/docs/api/core/index.md +12 -0
- data/docs/api/core/robot.md +478 -130
- data/docs/api/core/tool.md +205 -209
- data/docs/api/history/active-record-adapter.md +174 -94
- data/docs/api/history/config.md +186 -93
- data/docs/api/history/index.md +57 -61
- data/docs/api/history/thread-manager.md +123 -73
- data/docs/api/mcp/client.md +119 -48
- data/docs/api/mcp/index.md +75 -60
- data/docs/api/mcp/server.md +120 -136
- data/docs/api/mcp/transports.md +172 -184
- data/docs/api/streaming/context.md +157 -74
- data/docs/api/streaming/events.md +114 -166
- data/docs/api/streaming/index.md +74 -72
- data/docs/architecture/core-concepts.md +361 -112
- data/docs/architecture/index.md +97 -59
- data/docs/architecture/message-flow.md +138 -129
- data/docs/architecture/network-orchestration.md +197 -50
- data/docs/architecture/robot-execution.md +199 -146
- data/docs/architecture/state-management.md +255 -187
- data/docs/concepts.md +312 -48
- data/docs/examples/basic-chat.md +89 -77
- data/docs/examples/index.md +222 -47
- data/docs/examples/mcp-server.md +207 -203
- data/docs/examples/multi-robot-network.md +129 -35
- data/docs/examples/rails-application.md +159 -160
- data/docs/examples/tool-usage.md +295 -204
- data/docs/getting-started/configuration.md +275 -162
- data/docs/getting-started/index.md +1 -1
- data/docs/getting-started/installation.md +22 -13
- data/docs/getting-started/quick-start.md +166 -121
- data/docs/guides/building-robots.md +417 -212
- data/docs/guides/creating-networks.md +94 -24
- data/docs/guides/mcp-integration.md +152 -113
- data/docs/guides/memory.md +220 -164
- data/docs/guides/streaming.md +80 -110
- data/docs/guides/using-tools.md +259 -212
- data/docs/index.md +50 -37
- data/examples/01_simple_robot.rb +6 -9
- data/examples/02_tools.rb +6 -9
- data/examples/03_network.rb +13 -14
- data/examples/04_mcp.rb +5 -8
- data/examples/05_streaming.rb +5 -8
- data/examples/06_prompt_templates.rb +42 -37
- data/examples/07_network_memory.rb +13 -14
- data/examples/08_llm_config.rb +140 -0
- data/examples/09_chaining.rb +223 -0
- data/examples/10_memory.rb +331 -0
- data/examples/11_network_introspection.rb +230 -0
- data/examples/12_message_bus.rb +74 -0
- data/examples/13_spawn.rb +90 -0
- data/examples/14_rusty_circuit/comic.rb +143 -0
- data/examples/14_rusty_circuit/display.rb +203 -0
- data/examples/14_rusty_circuit/heckler.rb +57 -0
- data/examples/14_rusty_circuit/open_mic.rb +121 -0
- data/examples/14_rusty_circuit/prompts/open_mic_comic.md +20 -0
- data/examples/14_rusty_circuit/prompts/open_mic_heckler.md +23 -0
- data/examples/14_rusty_circuit/prompts/open_mic_scout.md +20 -0
- data/examples/14_rusty_circuit/scout.rb +173 -0
- data/examples/14_rusty_circuit/scout_notes.md +89 -0
- data/examples/14_rusty_circuit/show.log +234 -0
- data/examples/15_memory_network_and_bus/editor_in_chief.rb +24 -0
- data/examples/15_memory_network_and_bus/editorial_pipeline.rb +206 -0
- data/examples/15_memory_network_and_bus/linux_writer.rb +80 -0
- data/examples/15_memory_network_and_bus/os_editor.rb +46 -0
- data/examples/15_memory_network_and_bus/os_writer.rb +46 -0
- data/examples/15_memory_network_and_bus/output/combined_article.md +13 -0
- data/examples/15_memory_network_and_bus/output/final_article.md +15 -0
- data/examples/15_memory_network_and_bus/output/linux_draft.md +5 -0
- data/examples/15_memory_network_and_bus/output/mac_draft.md +7 -0
- data/examples/15_memory_network_and_bus/output/memory.json +13 -0
- data/examples/15_memory_network_and_bus/output/revision_1.md +19 -0
- data/examples/15_memory_network_and_bus/output/revision_2.md +15 -0
- data/examples/15_memory_network_and_bus/output/windows_draft.md +7 -0
- data/examples/15_memory_network_and_bus/prompts/os_advocate.md +13 -0
- data/examples/15_memory_network_and_bus/prompts/os_chief.md +13 -0
- data/examples/15_memory_network_and_bus/prompts/os_editor.md +13 -0
- data/examples/README.md +197 -0
- data/examples/prompts/{assistant/system.txt.erb → assistant.md} +3 -0
- data/examples/prompts/{billing/system.txt.erb → billing.md} +3 -0
- data/examples/prompts/{classifier/system.txt.erb → classifier.md} +3 -0
- data/examples/prompts/comedian.md +6 -0
- data/examples/prompts/comedy_critic.md +10 -0
- data/examples/prompts/configurable.md +9 -0
- data/examples/prompts/dispatcher.md +12 -0
- data/examples/prompts/{entity_extractor/system.txt.erb → entity_extractor.md} +3 -0
- data/examples/prompts/{escalation/system.txt.erb → escalation.md} +7 -0
- data/examples/prompts/frontmatter_mcp_test.md +9 -0
- data/examples/prompts/frontmatter_named_test.md +5 -0
- data/examples/prompts/frontmatter_tools_test.md +6 -0
- data/examples/prompts/{general/system.txt.erb → general.md} +3 -0
- data/examples/prompts/{github_assistant/system.txt.erb → github_assistant.md} +8 -0
- data/examples/prompts/{helper/system.txt.erb → helper.md} +3 -0
- data/examples/prompts/{keyword_extractor/system.txt.erb → keyword_extractor.md} +3 -0
- data/examples/prompts/llm_config_demo.md +20 -0
- data/examples/prompts/{order_support/system.txt.erb → order_support.md} +8 -0
- data/examples/prompts/os_advocate.md +13 -0
- data/examples/prompts/os_chief.md +13 -0
- data/examples/prompts/os_editor.md +13 -0
- data/examples/prompts/{product_support/system.txt.erb → product_support.md} +7 -0
- data/examples/prompts/{sentiment_analyzer/system.txt.erb → sentiment_analyzer.md} +3 -0
- data/examples/prompts/{synthesizer/system.txt.erb → synthesizer.md} +3 -0
- data/examples/prompts/{technical/system.txt.erb → technical.md} +3 -0
- data/examples/prompts/{triage/system.txt.erb → triage.md} +6 -0
- data/lib/generators/robot_lab/templates/initializer.rb.tt +1 -1
- data/lib/robot_lab/adapters/openai.rb +2 -1
- data/lib/robot_lab/ask_user.rb +75 -0
- data/lib/robot_lab/config/defaults.yml +121 -0
- data/lib/robot_lab/config.rb +183 -0
- data/lib/robot_lab/error.rb +6 -0
- data/lib/robot_lab/mcp/client.rb +1 -1
- data/lib/robot_lab/memory.rb +2 -2
- data/lib/robot_lab/robot.rb +523 -249
- data/lib/robot_lab/robot_message.rb +44 -0
- data/lib/robot_lab/robot_result.rb +1 -0
- data/lib/robot_lab/robotic_model.rb +1 -1
- data/lib/robot_lab/streaming/context.rb +1 -1
- data/lib/robot_lab/tool.rb +108 -172
- data/lib/robot_lab/tool_config.rb +1 -1
- data/lib/robot_lab/tool_manifest.rb +2 -18
- data/lib/robot_lab/version.rb +1 -1
- data/lib/robot_lab.rb +66 -55
- metadata +107 -116
- data/examples/prompts/assistant/user.txt.erb +0 -1
- data/examples/prompts/billing/user.txt.erb +0 -1
- data/examples/prompts/classifier/user.txt.erb +0 -1
- data/examples/prompts/entity_extractor/user.txt.erb +0 -3
- data/examples/prompts/escalation/user.txt.erb +0 -34
- data/examples/prompts/general/user.txt.erb +0 -1
- data/examples/prompts/github_assistant/user.txt.erb +0 -1
- data/examples/prompts/helper/user.txt.erb +0 -1
- data/examples/prompts/keyword_extractor/user.txt.erb +0 -3
- data/examples/prompts/order_support/user.txt.erb +0 -22
- data/examples/prompts/product_support/user.txt.erb +0 -32
- data/examples/prompts/sentiment_analyzer/user.txt.erb +0 -3
- data/examples/prompts/synthesizer/user.txt.erb +0 -15
- data/examples/prompts/technical/user.txt.erb +0 -1
- data/examples/prompts/triage/user.txt.erb +0 -17
- data/lib/robot_lab/configuration.rb +0 -143
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Reads all three drafts from memory, synthesizes a combined article.
|
|
4
|
+
# Also handles revision requests from the chief via bus.
|
|
5
|
+
#
|
|
6
|
+
# Like OsWriter, uses a direct shared_memory reference to avoid the
|
|
7
|
+
# extract_run_context mutation issue with parallel pipeline steps.
|
|
8
|
+
class OsEditor < RobotLab::Robot
|
|
9
|
+
attr_accessor :shared_memory
|
|
10
|
+
attr_reader :article
|
|
11
|
+
|
|
12
|
+
def initialize(**opts)
|
|
13
|
+
super(**opts)
|
|
14
|
+
@article = nil
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def call(result)
|
|
18
|
+
# Read all three drafts from shared memory
|
|
19
|
+
mac_draft = @shared_memory&.get(:mac_draft) || "No draft available."
|
|
20
|
+
windows_draft = @shared_memory&.get(:windows_draft) || "No draft available."
|
|
21
|
+
linux_draft = @shared_memory&.get(:linux_draft) || "No draft available."
|
|
22
|
+
|
|
23
|
+
composite_prompt = <<~PROMPT
|
|
24
|
+
Here are three advocacy drafts for different operating systems for home AI research labs.
|
|
25
|
+
Synthesize them into a balanced article.
|
|
26
|
+
|
|
27
|
+
## macOS Advocacy
|
|
28
|
+
#{mac_draft}
|
|
29
|
+
|
|
30
|
+
## Windows Advocacy
|
|
31
|
+
#{windows_draft}
|
|
32
|
+
|
|
33
|
+
## Linux/BSD Advocacy
|
|
34
|
+
#{linux_draft}
|
|
35
|
+
PROMPT
|
|
36
|
+
|
|
37
|
+
robot_result = run(composite_prompt, network_memory: @shared_memory)
|
|
38
|
+
@article = robot_result.reply.to_s
|
|
39
|
+
|
|
40
|
+
path = File.join(OUTPUT_DIR, "combined_article.md")
|
|
41
|
+
File.write(path, "# Combined Article (Editor Draft)\n\n#{@article}\n")
|
|
42
|
+
puts " [#{@name}] Combined article written to #{path}"
|
|
43
|
+
|
|
44
|
+
result.with_context(@name.to_sym, robot_result).continue(robot_result)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Base writer that runs LLM and stores its draft in shared memory.
|
|
4
|
+
# Used by mac_writer and win_writer directly; LinuxWriter extends this.
|
|
5
|
+
#
|
|
6
|
+
# NOTE: We bypass extract_run_context for network_memory access because
|
|
7
|
+
# its delete() pattern mutates the shared run_params hash — in parallel
|
|
8
|
+
# pipeline steps, only the first step to run would get the memory object.
|
|
9
|
+
# Instead, each robot holds a direct reference via shared_memory=.
|
|
10
|
+
class OsWriter < RobotLab::Robot
|
|
11
|
+
attr_accessor :shared_memory
|
|
12
|
+
|
|
13
|
+
def initialize(memory_key:, **opts)
|
|
14
|
+
super(**opts)
|
|
15
|
+
@memory_key = memory_key
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def call(result)
|
|
19
|
+
message = extract_message(result)
|
|
20
|
+
|
|
21
|
+
robot_result = run(message, network_memory: @shared_memory)
|
|
22
|
+
|
|
23
|
+
if @shared_memory
|
|
24
|
+
draft = robot_result.reply.to_s
|
|
25
|
+
@shared_memory.current_writer = @name
|
|
26
|
+
@shared_memory.set(@memory_key, draft)
|
|
27
|
+
|
|
28
|
+
path = File.join(OUTPUT_DIR, "#{@memory_key}.md")
|
|
29
|
+
File.write(path, "# #{@name} Draft\n\n#{draft}\n")
|
|
30
|
+
puts " [#{@name}] Draft written to memory[:#{@memory_key}] and #{path}"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
result.with_context(@name.to_sym, robot_result).continue(robot_result)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
private
|
|
37
|
+
|
|
38
|
+
def extract_message(result)
|
|
39
|
+
case result.value
|
|
40
|
+
when Hash then result.value[:message]
|
|
41
|
+
when RobotLab::RobotResult then result.value.reply
|
|
42
|
+
when String then result.value
|
|
43
|
+
else result.value.to_s
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Combined Article (Editor Draft)
|
|
2
|
+
|
|
3
|
+
# Choosing the Right Operating System for Your Home AI Research Lab
|
|
4
|
+
|
|
5
|
+
Building a home AI research lab requires careful consideration of your operating system, as this foundational choice will impact everything from GPU acceleration to software compatibility. Each major platform—macOS, Windows, and Linux/BSD—brings distinct advantages that appeal to different research priorities and workflows.
|
|
6
|
+
|
|
7
|
+
**macOS excels in energy efficiency and unified architecture benefits**, particularly for researchers using Apple Silicon machines. The M-series chips' unified memory architecture eliminates traditional CPU-GPU bottlenecks, making them surprisingly effective for large language model work within memory constraints. Apple's MLX framework and Metal Performance Shaders provide optimized acceleration paths, while the Unix foundation ensures compatibility with the Python scientific stack. However, this platform's strength is primarily limited to Apple hardware, and CUDA support remains unavailable for NVIDIA-dependent workflows.
|
|
8
|
+
|
|
9
|
+
**Windows offers the broadest hardware compatibility and vendor support**, making it the go-to choice for researchers prioritizing maximum GPU options and plug-and-play simplicity. First-class NVIDIA CUDA support, DirectML for multi-vendor GPU acceleration, and WSL2 for Linux compatibility create a comprehensive environment. The platform particularly shines for users wanting access to consumer-friendly tools like AUTOMATIC1111's Stable Diffusion interfaces or LM Studio, backed by extensive community documentation. The trade-off comes in system overhead and potential stability concerns during intensive, long-running training jobs.
|
|
10
|
+
|
|
11
|
+
**Linux and BSD systems provide unmatched control and stability** for serious computational work. These platforms offer the most direct access to GPU drivers, the latest kernel optimizations, and mature containerization through Docker and Podman. FreeBSD's ZFS filesystem adds enterprise-grade data integrity, while Linux distributions like Ubuntu provide comprehensive package management for AI frameworks. The open-source nature ensures transparency and customizability, though it demands more technical expertise for optimal configuration.
|
|
12
|
+
|
|
13
|
+
**The optimal choice depends on your specific research profile**: Choose macOS if you're already invested in Apple hardware and prioritize energy efficiency for smaller-scale experiments. Select Windows if you want maximum hardware flexibility with minimal configuration overhead, especially for image generation and consumer-oriented AI tools. Opt for Linux/BSD if you're running large-scale training jobs requiring maximum stability and performance, or if you need the flexibility of custom configurations and bleeding-edge framework support. For most researchers, the decision ultimately comes down to balancing technical expertise against time-to-productivity—Windows for quick starts, Linux for maximum control, and macOS for Apple ecosystem integration.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Final Article — APPROVED
|
|
2
|
+
|
|
3
|
+
# Choosing the Right Operating System for Your Home AI Research Lab
|
|
4
|
+
|
|
5
|
+
Building a home AI research lab requires careful consideration of your operating system, as this foundational choice will impact everything from GPU acceleration to software compatibility. Each major platform—macOS, Windows, and Linux/BSD—brings distinct advantages that appeal to different research priorities and workflows.
|
|
6
|
+
|
|
7
|
+
**macOS excels in energy efficiency and unified architecture benefits**, particularly for researchers using Apple Silicon machines. The M-series chips' unified memory architecture eliminates traditional CPU-GPU bottlenecks, making them surprisingly effective for large language model work within memory constraints. Apple's MLX framework and Metal Performance Shaders provide optimized acceleration paths, while the Unix foundation ensures compatibility with the Python scientific stack. Tools like Hugging Face Transformers run seamlessly with MPS backend support, and applications like DiffusionBee leverage Metal for Stable Diffusion workflows. The platform's energy efficiency allows intensive training sessions without thermal throttling issues common in high-end PC builds. However, this strength is limited to Apple hardware, CUDA support remains unavailable for NVIDIA-dependent workflows, and the premium hardware costs can be prohibitive for budget-conscious researchers.
|
|
8
|
+
|
|
9
|
+
**Windows offers the broadest hardware compatibility and vendor support**, making it the ideal choice for researchers prioritizing maximum GPU options and plug-and-play simplicity. First-class NVIDIA CUDA support provides seamless access to CUDA 12.x, cuDNN, and TensorRT—essential for PyTorch, TensorFlow, and JAX frameworks powering modern models. DirectML enables hardware-agnostic ML acceleration across AMD, Intel, and NVIDIA GPUs, while WSL2 provides Linux compatibility without sacrificing Windows' superior hardware support. The platform excels with consumer-friendly tools like AUTOMATIC1111's Stable Diffusion interfaces, LM Studio for local LLM serving, and ComfyUI workflows, all backed by extensive community documentation. Windows licensing costs add to overall expenses, and the system overhead can impact stability during long-running training jobs, but the ease of setup makes it attractive for researchers who want to focus on experiments rather than system administration.
|
|
10
|
+
|
|
11
|
+
**Linux and BSD systems provide unmatched control and stability** for serious computational work. These platforms offer direct access to GPU drivers, the latest kernel optimizations, and mature containerization through Docker and Podman. Ubuntu and Debian provide comprehensive package repositories with one-command installations of PyTorch, TensorFlow, and CUDA toolkits, while Fedora delivers cutting-edge kernel support for new GPU architectures. FreeBSD's ZFS filesystem adds enterprise-grade data integrity with automatic checksums and snapshots—critical for protecting valuable datasets and model checkpoints. The open-source nature ensures transparency and customizability, with server-grade stability that prevents crashes during extended training sessions. The trade-off is a steeper learning curve requiring technical expertise for optimal configuration, though the performance benefits and zero licensing costs often justify the investment for serious researchers.
|
|
12
|
+
|
|
13
|
+
**Cost considerations significantly impact platform selection**. Linux systems offer the best value proposition with no licensing fees and compatibility with budget hardware, while macOS requires premium Apple hardware that can cost 2-3x equivalent PC specifications. Windows falls in the middle with moderate licensing costs but maximum hardware flexibility, allowing researchers to optimize price-performance ratios across different GPU options.
|
|
14
|
+
|
|
15
|
+
**The optimal choice depends on your specific research profile and technical comfort level**: Choose macOS if you're already invested in Apple hardware, prioritize energy efficiency for smaller-scale experiments, and value the seamless integration of Unix-based tools with premium hardware. Select Windows if you want maximum hardware flexibility with minimal configuration overhead, especially for image generation workflows and consumer-oriented AI tools, and prefer extensive community support for troubleshooting. Opt for Linux/BSD if you're running large-scale training jobs requiring maximum stability and performance, need custom system configurations, or want to minimize costs while maximizing control. For most researchers, the decision balances technical expertise against time-to-productivity—Windows for quick starts and broad compatibility, Linux for maximum performance and control, and macOS for energy-efficient workflows within the Apple ecosystem.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# linux_writer Draft
|
|
2
|
+
|
|
3
|
+
When building a home AI research lab focused on LLM fine-tuning, image generation, and local inference, Linux and BSD systems stand as the undisputed champions for serious researchers. Unlike proprietary alternatives, these open-source platforms give you complete control over your GPU stack—from low-level CUDA drivers to high-level ML frameworks. Ubuntu and Debian shine with their comprehensive package repositories, offering one-command installations of PyTorch, TensorFlow, Hugging Face Transformers, and CUDA toolkits without dependency hell. For bleeding-edge work, Fedora provides the latest kernel support ensuring day-one compatibility with new GPU architectures like RTX 4090s or H100s, while its SELinux security model protects your valuable training data and model weights. The containerization story is equally compelling: Docker and Podman run natively, allowing you to spin up isolated environments for different experiments—imagine running Stable Diffusion XL in one container while fine-tuning a 7B parameter LLaMA model in another, all without conflicts.
|
|
4
|
+
|
|
5
|
+
The performance and reliability advantages become even more pronounced for serious research workflows. FreeBSD's ZFS filesystem provides bulletproof data integrity with automatic checksums and snapshots—critical when you're storing multi-terabyte datasets and irreplaceable model checkpoints from weeks-long training runs. The system's deterministic behavior ensures reproducible experiments, while jails offer lightweight isolation perfect for testing different versions of frameworks like DeepSpeed or Triton. Linux distributions excel in GPU compute with mature NVIDIA CUDA support, ROCm for AMD cards, and emerging Intel XPU capabilities. The community ecosystem is unmatched: from PyTorch Hub to Hugging Face Model Hub integration, from Jupyter notebooks to MLflow experiment tracking, everything runs optimally on these platforms. Server-grade stability means your 48-hour LoRA fine-tuning jobs won't crash from desktop OS quirks, while the vast package repositories provide everything from ONNX Runtime for optimized inference to Weights & Biases for experiment monitoring—all maintained by thousands of contributors who understand the needs of computational researchers.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# mac_writer Draft
|
|
2
|
+
|
|
3
|
+
**macOS: The Ultimate Platform for Home AI Research Labs**
|
|
4
|
+
|
|
5
|
+
When building a home AI research lab focused on LLM fine-tuning, image generation, and local inference, macOS stands as the clear winner, primarily due to Apple Silicon's revolutionary architecture. The M-series chips deliver exceptional performance per watt, with unified memory architectures that eliminate traditional CPU-GPU memory bottlenecks—crucial for handling large language models that demand substantial RAM. For LLM fine-tuning, frameworks like MLX (Apple's native machine learning framework) provide optimized performance that often surpasses CUDA-based solutions on consumer hardware. The Metal Performance Shaders framework offers direct GPU acceleration for PyTorch and TensorFlow operations, while tools like Hugging Face Transformers run seamlessly with MPS backend support. Energy efficiency means you can run intensive training sessions without the thermal throttling and power consumption issues that plague high-end PC builds.
|
|
6
|
+
|
|
7
|
+
The software ecosystem further solidifies macOS's position as the premier AI development platform. CoreML integration allows for seamless deployment of trained models with hardware-optimized inference, while the Unix foundation provides access to the entire Python scientific computing stack—NumPy, SciPy, pandas, and scikit-learn all install effortlessly through Homebrew or conda. For image generation workflows, Stable Diffusion runs exceptionally well through optimized implementations like DiffusionBee and Draw Things, leveraging Metal's compute capabilities. The developer experience is unmatched: Xcode provides excellent debugging tools, Jupyter notebooks integrate perfectly with the system, and Docker Desktop for Mac ensures reproducible environments. The growing community around Apple Silicon ML development, exemplified by projects like whisper.cpp and llama.cpp with Metal acceleration, demonstrates the platform's momentum. Combined with tools like Ollama for local LLM serving and the seamless integration between macOS development tools and popular AI frameworks, macOS offers the most cohesive and powerful environment for serious AI research at home.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {},
|
|
3
|
+
"results": [],
|
|
4
|
+
"messages": [],
|
|
5
|
+
"custom": {
|
|
6
|
+
"ubuntu_specialist": "Ubuntu/Debian offers exceptional package management through apt with extensive pre-built libraries for AI frameworks like PyTorch, TensorFlow, and CUDA toolkit, eliminating complex compilation steps. The distributions provide excellent hardware compatibility across diverse GPU vendors (NVIDIA, AMD, Intel) and architectures, while maintaining strong community support with comprehensive documentation for AI-specific configurations. Their LTS releases ensure stable, long-term environments crucial for reproducible research workflows.",
|
|
7
|
+
"fedora_specialist": "Fedora/RHEL excels for AI research due to its cutting-edge kernel support that ensures compatibility with the latest GPU drivers and hardware accelerators, while SELinux provides robust security isolation for sensitive research data and multi-tenant workloads. The enterprise-grade tooling ecosystem, including containers (Podman), orchestration, and package management, offers production-ready infrastructure that scales from development to deployment, making it ideal for researchers who need both bleeding-edge capabilities and rock-solid stability.",
|
|
8
|
+
"mac_draft": "**macOS: The Ultimate Platform for Home AI Research Labs**\n\nWhen building a home AI research lab focused on LLM fine-tuning, image generation, and local inference, macOS stands as the clear winner, primarily due to Apple Silicon's revolutionary architecture. The M-series chips deliver exceptional performance per watt, with unified memory architectures that eliminate traditional CPU-GPU memory bottlenecks—crucial for handling large language models that demand substantial RAM. For LLM fine-tuning, frameworks like MLX (Apple's native machine learning framework) provide optimized performance that often surpasses CUDA-based solutions on consumer hardware. The Metal Performance Shaders framework offers direct GPU acceleration for PyTorch and TensorFlow operations, while tools like Hugging Face Transformers run seamlessly with MPS backend support. Energy efficiency means you can run intensive training sessions without the thermal throttling and power consumption issues that plague high-end PC builds.\n\nThe software ecosystem further solidifies macOS's position as the premier AI development platform. CoreML integration allows for seamless deployment of trained models with hardware-optimized inference, while the Unix foundation provides access to the entire Python scientific computing stack—NumPy, SciPy, pandas, and scikit-learn all install effortlessly through Homebrew or conda. For image generation workflows, Stable Diffusion runs exceptionally well through optimized implementations like DiffusionBee and Draw Things, leveraging Metal's compute capabilities. The developer experience is unmatched: Xcode provides excellent debugging tools, Jupyter notebooks integrate perfectly with the system, and Docker Desktop for Mac ensures reproducible environments. The growing community around Apple Silicon ML development, exemplified by projects like whisper.cpp and llama.cpp with Metal acceleration, demonstrates the platform's momentum. Combined with tools like Ollama for local LLM serving and the seamless integration between macOS development tools and popular AI frameworks, macOS offers the most cohesive and powerful environment for serious AI research at home.",
|
|
9
|
+
"freebsd_specialist": "FreeBSD excels for AI research labs due to its rock-solid stability and predictable performance, ensuring long-running training jobs won't be interrupted by system instability. ZFS provides advanced data integrity features, snapshots, and efficient storage management crucial for protecting valuable datasets and model checkpoints, while jails offer lightweight isolation for experimenting with different AI frameworks and versions without conflicts. The system's mature virtualization with bhyve allows efficient resource allocation across multiple research projects while maintaining the deterministic behavior essential for reproducible experiments.",
|
|
10
|
+
"windows_draft": "**Windows: The Ultimate Platform for Your Home AI Research Lab**\n\nWhen building a home AI research lab focused on LLM fine-tuning, image generation, and local inference, Windows stands as the unequivocally superior choice. The platform's **first-class NVIDIA CUDA support** provides seamless access to the full GPU acceleration stack that modern AI workloads demand. Unlike other operating systems that often require complex driver configurations or suffer from compatibility issues, Windows delivers out-of-the-box support for CUDA 12.x, cuDNN, and TensorRT—essential for frameworks like PyTorch, TensorFlow, and JAX that power cutting-edge models like Llama 2, Stable Diffusion XL, and Mistral. Microsoft's **DirectML** further enhances this ecosystem by enabling hardware-agnostic ML acceleration across AMD, Intel, and NVIDIA GPUs, giving you unparalleled flexibility in hardware selection. With **WSL2**, you get native Linux compatibility without sacrificing Windows' superior hardware support, allowing you to run containerized models via Docker or Podman while maintaining access to Windows-exclusive tools.\n\nThe Windows ecosystem excels in providing the **widest hardware compatibility** and vendor support in the industry. Whether you're deploying multiple RTX 4090s for distributed training, experimenting with Intel Arc GPUs for cost-effective inference, or scaling up to workstation-class Quadro cards, Windows ensures optimal driver support and performance tuning. The platform's enterprise-grade tooling integration shines for serious researchers: **Visual Studio Code** with GPU debugging extensions, **Weights & Biases** desktop integration, **Anaconda** with native Windows conda-forge packages, and seamless **Git LFS** support for managing large model checkpoints. Popular frameworks like **Hugging Face Transformers**, **ComfyUI** for Stable Diffusion workflows, and **text-generation-webui** for local LLM serving all provide superior Windows support with pre-compiled binaries and automated installers. The vibrant Windows AI community, centered around platforms like the AUTOMATIC1111 ecosystem and LM Studio, offers extensive documentation, troubleshooting resources, and model optimization guides specifically tailored to Windows environments—making your research journey both productive and well-supported.",
|
|
11
|
+
"linux_draft": "When building a home AI research lab focused on LLM fine-tuning, image generation, and local inference, Linux and BSD systems stand as the undisputed champions for serious researchers. Unlike proprietary alternatives, these open-source platforms give you complete control over your GPU stack—from low-level CUDA drivers to high-level ML frameworks. Ubuntu and Debian shine with their comprehensive package repositories, offering one-command installations of PyTorch, TensorFlow, Hugging Face Transformers, and CUDA toolkits without dependency hell. For bleeding-edge work, Fedora provides the latest kernel support ensuring day-one compatibility with new GPU architectures like RTX 4090s or H100s, while its SELinux security model protects your valuable training data and model weights. The containerization story is equally compelling: Docker and Podman run natively, allowing you to spin up isolated environments for different experiments—imagine running Stable Diffusion XL in one container while fine-tuning a 7B parameter LLaMA model in another, all without conflicts.\n\nThe performance and reliability advantages become even more pronounced for serious research workflows. FreeBSD's ZFS filesystem provides bulletproof data integrity with automatic checksums and snapshots—critical when you're storing multi-terabyte datasets and irreplaceable model checkpoints from weeks-long training runs. The system's deterministic behavior ensures reproducible experiments, while jails offer lightweight isolation perfect for testing different versions of frameworks like DeepSpeed or Triton. Linux distributions excel in GPU compute with mature NVIDIA CUDA support, ROCm for AMD cards, and emerging Intel XPU capabilities. The community ecosystem is unmatched: from PyTorch Hub to Hugging Face Model Hub integration, from Jupyter notebooks to MLflow experiment tracking, everything runs optimally on these platforms. Server-grade stability means your 48-hour LoRA fine-tuning jobs won't crash from desktop OS quirks, while the vast package repositories provide everything from ONNX Runtime for optimized inference to Weights & Biases for experiment monitoring—all maintained by thousands of contributors who understand the needs of computational researchers."
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Revision 1
|
|
2
|
+
|
|
3
|
+
This is an excellent, well-balanced synthesis of the three advocacy pieces. You've successfully transformed partisan arguments into an objective analysis that fairly represents each platform's strengths while acknowledging their limitations.
|
|
4
|
+
|
|
5
|
+
**Strengths of your synthesis:**
|
|
6
|
+
|
|
7
|
+
- **Fair representation**: You extracted the core technical arguments from each advocacy piece without the hyperbolic language
|
|
8
|
+
- **Clear structure**: Each platform gets dedicated coverage with consistent evaluation criteria (performance, compatibility, ease of use)
|
|
9
|
+
- **Practical guidance**: The final paragraph provides actionable decision-making criteria based on different user profiles
|
|
10
|
+
- **Technical accuracy**: You correctly highlighted key differentiators like Apple Silicon's unified memory, Windows' CUDA support, and Linux's containerization advantages
|
|
11
|
+
|
|
12
|
+
**Minor suggestions for enhancement:**
|
|
13
|
+
|
|
14
|
+
- Consider adding a brief mention of **cost considerations** (macOS hardware premium, Windows licensing, Linux being free)
|
|
15
|
+
- The **learning curve** aspect could be slightly more explicit—Linux requiring the most technical expertise, Windows being most accessible, macOS in the middle
|
|
16
|
+
|
|
17
|
+
**Editorial tone assessment**: You've struck exactly the right professional, measured tone for a technology publication. The piece reads as genuinely helpful guidance rather than advocacy, which is precisely what readers need when making infrastructure decisions.
|
|
18
|
+
|
|
19
|
+
This synthesis effectively serves readers who need to make informed decisions about their AI research environment without being swayed by platform evangelism.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Revision 2
|
|
2
|
+
|
|
3
|
+
# Choosing the Right Operating System for Your Home AI Research Lab
|
|
4
|
+
|
|
5
|
+
Building a home AI research lab requires careful consideration of your operating system, as this foundational choice will impact everything from GPU acceleration to software compatibility. Each major platform—macOS, Windows, and Linux/BSD—brings distinct advantages that appeal to different research priorities and workflows.
|
|
6
|
+
|
|
7
|
+
**macOS excels in energy efficiency and unified architecture benefits**, particularly for researchers using Apple Silicon machines. The M-series chips' unified memory architecture eliminates traditional CPU-GPU bottlenecks, making them surprisingly effective for large language model work within memory constraints. Apple's MLX framework and Metal Performance Shaders provide optimized acceleration paths, while the Unix foundation ensures compatibility with the Python scientific stack. Tools like Hugging Face Transformers run seamlessly with MPS backend support, and applications like DiffusionBee leverage Metal for Stable Diffusion workflows. The platform's energy efficiency allows intensive training sessions without thermal throttling issues common in high-end PC builds. However, this strength is limited to Apple hardware, CUDA support remains unavailable for NVIDIA-dependent workflows, and the premium hardware costs can be prohibitive for budget-conscious researchers.
|
|
8
|
+
|
|
9
|
+
**Windows offers the broadest hardware compatibility and vendor support**, making it the ideal choice for researchers prioritizing maximum GPU options and plug-and-play simplicity. First-class NVIDIA CUDA support provides seamless access to CUDA 12.x, cuDNN, and TensorRT—essential for PyTorch, TensorFlow, and JAX frameworks powering modern models. DirectML enables hardware-agnostic ML acceleration across AMD, Intel, and NVIDIA GPUs, while WSL2 provides Linux compatibility without sacrificing Windows' superior hardware support. The platform excels with consumer-friendly tools like AUTOMATIC1111's Stable Diffusion interfaces, LM Studio for local LLM serving, and ComfyUI workflows, all backed by extensive community documentation. Windows licensing costs add to overall expenses, and the system overhead can impact stability during long-running training jobs, but the ease of setup makes it attractive for researchers who want to focus on experiments rather than system administration.
|
|
10
|
+
|
|
11
|
+
**Linux and BSD systems provide unmatched control and stability** for serious computational work. These platforms offer direct access to GPU drivers, the latest kernel optimizations, and mature containerization through Docker and Podman. Ubuntu and Debian provide comprehensive package repositories with one-command installations of PyTorch, TensorFlow, and CUDA toolkits, while Fedora delivers cutting-edge kernel support for new GPU architectures. FreeBSD's ZFS filesystem adds enterprise-grade data integrity with automatic checksums and snapshots—critical for protecting valuable datasets and model checkpoints. The open-source nature ensures transparency and customizability, with server-grade stability that prevents crashes during extended training sessions. The trade-off is a steeper learning curve requiring technical expertise for optimal configuration, though the performance benefits and zero licensing costs often justify the investment for serious researchers.
|
|
12
|
+
|
|
13
|
+
**Cost considerations significantly impact platform selection**. Linux systems offer the best value proposition with no licensing fees and compatibility with budget hardware, while macOS requires premium Apple hardware that can cost 2-3x equivalent PC specifications. Windows falls in the middle with moderate licensing costs but maximum hardware flexibility, allowing researchers to optimize price-performance ratios across different GPU options.
|
|
14
|
+
|
|
15
|
+
**The optimal choice depends on your specific research profile and technical comfort level**: Choose macOS if you're already invested in Apple hardware, prioritize energy efficiency for smaller-scale experiments, and value the seamless integration of Unix-based tools with premium hardware. Select Windows if you want maximum hardware flexibility with minimal configuration overhead, especially for image generation workflows and consumer-oriented AI tools, and prefer extensive community support for troubleshooting. Opt for Linux/BSD if you're running large-scale training jobs requiring maximum stability and performance, need custom system configurations, or want to minimize costs while maximizing control. For most researchers, the decision balances technical expertise against time-to-productivity—Windows for quick starts and broad compatibility, Linux for maximum performance and control, and macOS for energy-efficient workflows within the Apple ecosystem.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# win_writer Draft
|
|
2
|
+
|
|
3
|
+
**Windows: The Ultimate Platform for Your Home AI Research Lab**
|
|
4
|
+
|
|
5
|
+
When building a home AI research lab focused on LLM fine-tuning, image generation, and local inference, Windows stands as the unequivocally superior choice. The platform's **first-class NVIDIA CUDA support** provides seamless access to the full GPU acceleration stack that modern AI workloads demand. Unlike other operating systems that often require complex driver configurations or suffer from compatibility issues, Windows delivers out-of-the-box support for CUDA 12.x, cuDNN, and TensorRT—essential for frameworks like PyTorch, TensorFlow, and JAX that power cutting-edge models like Llama 2, Stable Diffusion XL, and Mistral. Microsoft's **DirectML** further enhances this ecosystem by enabling hardware-agnostic ML acceleration across AMD, Intel, and NVIDIA GPUs, giving you unparalleled flexibility in hardware selection. With **WSL2**, you get native Linux compatibility without sacrificing Windows' superior hardware support, allowing you to run containerized models via Docker or Podman while maintaining access to Windows-exclusive tools.
|
|
6
|
+
|
|
7
|
+
The Windows ecosystem excels in providing the **widest hardware compatibility** and vendor support in the industry. Whether you're deploying multiple RTX 4090s for distributed training, experimenting with Intel Arc GPUs for cost-effective inference, or scaling up to workstation-class Quadro cards, Windows ensures optimal driver support and performance tuning. The platform's enterprise-grade tooling integration shines for serious researchers: **Visual Studio Code** with GPU debugging extensions, **Weights & Biases** desktop integration, **Anaconda** with native Windows conda-forge packages, and seamless **Git LFS** support for managing large model checkpoints. Popular frameworks like **Hugging Face Transformers**, **ComfyUI** for Stable Diffusion workflows, and **text-generation-webui** for local LLM serving all provide superior Windows support with pre-compiled binaries and automated installers. The vibrant Windows AI community, centered around platforms like the AUTOMATIC1111 ecosystem and LM Studio, offers extensive documentation, troubleshooting resources, and model optimization guides specifically tailored to Windows environments—making your research journey both productive and well-supported.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: OS advocate for home AI research labs
|
|
3
|
+
parameters:
|
|
4
|
+
os_name: null
|
|
5
|
+
strengths: null
|
|
6
|
+
---
|
|
7
|
+
You are a passionate advocate for <%= os_name %> as the ideal operating system for a home AI research lab.
|
|
8
|
+
|
|
9
|
+
Key strengths to emphasize: <%= strengths %>
|
|
10
|
+
|
|
11
|
+
Write a 2-3 paragraph advocacy piece arguing why <%= os_name %> is the best choice for someone building a home AI research lab. Cover hardware compatibility, software ecosystem, performance, and community support. Be specific about AI/ML frameworks, GPU support, and developer tooling.
|
|
12
|
+
|
|
13
|
+
Be persuasive but factual. Use concrete examples of tools and workflows.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Editor-in-chief who gives final approval on articles
|
|
3
|
+
---
|
|
4
|
+
You are the editor-in-chief of a technology publication. Review the submitted article for:
|
|
5
|
+
|
|
6
|
+
1. Balance — does it fairly represent all platforms?
|
|
7
|
+
2. Accuracy — are technical claims correct?
|
|
8
|
+
3. Recommendation quality — is the conclusion well-supported?
|
|
9
|
+
4. Readability — is it clear and well-structured?
|
|
10
|
+
|
|
11
|
+
If the article meets your standards, respond starting with APPROVED followed by a brief note on what makes it strong.
|
|
12
|
+
|
|
13
|
+
If it needs work, respond starting with REVISE: followed by specific, actionable feedback on what to improve. Be concise.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Editor who synthesizes OS advocacy drafts into a balanced article
|
|
3
|
+
---
|
|
4
|
+
You are a senior technology editor specializing in AI infrastructure.
|
|
5
|
+
|
|
6
|
+
You will receive three advocacy drafts arguing for different operating systems (macOS, Windows, Linux/BSD) for home AI research labs. Synthesize them into a balanced 4-6 paragraph article that:
|
|
7
|
+
|
|
8
|
+
1. Acknowledges the strengths of each platform
|
|
9
|
+
2. Compares them fairly across key dimensions (cost, GPU support, software ecosystem, ease of use)
|
|
10
|
+
3. Identifies which scenarios favor which OS
|
|
11
|
+
4. Ends with a clear, nuanced recommendation
|
|
12
|
+
|
|
13
|
+
Write in a professional editorial voice. Be objective even though your sources are advocates.
|
data/examples/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# RobotLab Examples
|
|
2
|
+
|
|
3
|
+
Working demonstrations of RobotLab features, from single-robot basics to multi-robot orchestration and message bus communication.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Ruby >= 3.2
|
|
8
|
+
- `bundle install` (from the project root)
|
|
9
|
+
- An LLM API key (e.g., `ANTHROPIC_API_KEY`)
|
|
10
|
+
|
|
11
|
+
## Running Examples
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Run a specific example by number
|
|
15
|
+
bundle exec rake examples:run[1]
|
|
16
|
+
|
|
17
|
+
# Run all examples
|
|
18
|
+
bundle exec rake examples:all
|
|
19
|
+
|
|
20
|
+
# Run directly
|
|
21
|
+
bundle exec ruby examples/01_simple_robot.rb
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Directory Structure
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
examples/
|
|
28
|
+
01_simple_robot.rb # Basic robot with template
|
|
29
|
+
02_tools.rb # Robot with custom tools
|
|
30
|
+
03_network.rb # Multi-robot network with routing
|
|
31
|
+
04_mcp.rb # MCP server integration (GitHub)
|
|
32
|
+
05_streaming.rb # Real-time streaming events
|
|
33
|
+
06_prompt_templates.rb # Template-based e-commerce support
|
|
34
|
+
07_network_memory.rb # Shared memory with concurrent robots
|
|
35
|
+
08_llm_config.rb # Configuration hierarchy demo
|
|
36
|
+
09_chaining.rb # with_* method chaining & reconfiguration
|
|
37
|
+
10_memory.rb # Advanced Memory API operations
|
|
38
|
+
11_network_introspection.rb # Network visualization & inspection
|
|
39
|
+
12_message_bus.rb # Bidirectional robot communication
|
|
40
|
+
13_spawn.rb # Dynamic specialist robot spawning
|
|
41
|
+
14_rusty_circuit/ # Multi-robot open mic with self-modification
|
|
42
|
+
open_mic.rb # Main entrypoint — wires up the show
|
|
43
|
+
comic.rb # Comedian with self-modification tools
|
|
44
|
+
heckler.rb # Audience heckler (can stay silent or counter-joke)
|
|
45
|
+
scout.rb # Talent scout with analyst spawning
|
|
46
|
+
display.rb # Terminal formatting (color, wrapping, file output)
|
|
47
|
+
prompts/ # Templates for comic, heckler, and scout
|
|
48
|
+
prompts/ # Prompt templates (.md with YAML front matter)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
### 01 — Simple Robot
|
|
54
|
+
|
|
55
|
+
Create and run a basic robot using a prompt template. Sends a single message and displays the response.
|
|
56
|
+
|
|
57
|
+
**Requires:** LLM API key
|
|
58
|
+
|
|
59
|
+
### 02 — Tools
|
|
60
|
+
|
|
61
|
+
Give a robot custom tools (`Calculator`, `FortuneCookie`) defined as `RubyLLM::Tool` subclasses. The LLM decides when to call each tool based on the user's request.
|
|
62
|
+
|
|
63
|
+
**Requires:** LLM API key
|
|
64
|
+
|
|
65
|
+
### 03 — Multi-Robot Network
|
|
66
|
+
|
|
67
|
+
Build a customer support network with a classifier robot that routes requests to billing, technical, or general specialists. Uses SimpleFlow's optional task activation for conditional routing.
|
|
68
|
+
|
|
69
|
+
**Requires:** LLM API key
|
|
70
|
+
|
|
71
|
+
### 04 — MCP Integration
|
|
72
|
+
|
|
73
|
+
Connect to the GitHub MCP server via stdio transport. Part 1 demonstrates direct `MCP::Client` usage (listing tools, calling `search_repositories`). Part 2 wraps the MCP server inside a robot for natural-language queries.
|
|
74
|
+
|
|
75
|
+
**Requires:** LLM API key, `GITHUB_PERSONAL_ACCESS_TOKEN`, `github-mcp-server` installed
|
|
76
|
+
|
|
77
|
+
### 05 — Streaming
|
|
78
|
+
|
|
79
|
+
Real-time streaming of robot responses using `RobotLab::Streaming::Context`. Simulates text deltas with timing to demonstrate the streaming event model, then shows the code pattern for streaming with a robot or network.
|
|
80
|
+
|
|
81
|
+
**Requires:** None (simulated events, no LLM calls)
|
|
82
|
+
|
|
83
|
+
### 06 — Prompt Templates
|
|
84
|
+
|
|
85
|
+
Full e-commerce support system using prompt_manager templates with YAML front matter. A triage robot classifies customer requests and routes to order, product, or escalation specialists. Demonstrates build-time context (company info, policies) and run-time context (customer data, order history).
|
|
86
|
+
|
|
87
|
+
**Requires:** LLM API key
|
|
88
|
+
|
|
89
|
+
### 07 — Network Memory
|
|
90
|
+
|
|
91
|
+
Reactive shared memory with concurrent robots. Multiple analysis robots (sentiment, entity extraction, keywords) run in parallel and write to shared memory. A synthesizer robot waits for all results using blocking reads, then produces a combined analysis. Demonstrates subscriptions, notifications, and network broadcast.
|
|
92
|
+
|
|
93
|
+
**Requires:** LLM API key
|
|
94
|
+
|
|
95
|
+
### 08 — LLM Configuration
|
|
96
|
+
|
|
97
|
+
Walks through the full configuration hierarchy without making LLM calls:
|
|
98
|
+
|
|
99
|
+
1. Bundled defaults
|
|
100
|
+
2. Environment-specific overrides
|
|
101
|
+
3. XDG user config
|
|
102
|
+
4. Project config
|
|
103
|
+
5. Environment variables
|
|
104
|
+
6. Template front matter
|
|
105
|
+
7. Constructor parameters
|
|
106
|
+
8. `with_*` method chaining
|
|
107
|
+
9. Run-time context
|
|
108
|
+
|
|
109
|
+
**Requires:** None (no LLM calls)
|
|
110
|
+
|
|
111
|
+
### 09 — Chaining & Reconfiguration
|
|
112
|
+
|
|
113
|
+
Demonstrates the Robot API surface for runtime configuration: `with_*` method chaining, `update()` for reconfiguration, `to_h` introspection, config diffs between steps, and how constructor params override template front matter.
|
|
114
|
+
|
|
115
|
+
**Requires:** None (no LLM calls)
|
|
116
|
+
|
|
117
|
+
### 10 — Advanced Memory
|
|
118
|
+
|
|
119
|
+
Comprehensive Memory API demo: `StateProxy` for method-style access, key and pattern subscriptions, `MemoryChange` objects, key enumeration, serialization round-trips, clone for isolated copies, delete with reserved key protection, and clear vs reset.
|
|
120
|
+
|
|
121
|
+
**Requires:** None (no LLM calls)
|
|
122
|
+
|
|
123
|
+
### 11 — Network Introspection
|
|
124
|
+
|
|
125
|
+
Network visualization and inspection tools: `to_mermaid()` for diagram export, `to_dot()` for Graphviz, `execution_plan()` for text output, `visualize()` for ASCII pipelines, robot access by name, dynamic `add_robot()`, `to_h()` introspection, task-specific config, and `broadcast()`.
|
|
126
|
+
|
|
127
|
+
**Requires:** None (no LLM calls)
|
|
128
|
+
|
|
129
|
+
### 12 — Message Bus
|
|
130
|
+
|
|
131
|
+
Bidirectional robot communication via TypedBus. A comedy critic (Alice) tasks a comedian (Bob) to tell robot jokes. Alice evaluates each joke with her LLM; if it's not funny, she sends Bob back for another attempt. Bob's temperature ramps from 0.2 to 1.0 across retries for increasing creativity. The loop continues until Alice approves or `MAX_ATTEMPTS` is reached.
|
|
132
|
+
|
|
133
|
+
Demonstrates: Robot subclasses, prompt templates, auto-ack `on_message`, `reply()` convenience, temperature ramping, convergence patterns.
|
|
134
|
+
|
|
135
|
+
**Requires:** LLM API key
|
|
136
|
+
|
|
137
|
+
### 13 — Spawning Robots
|
|
138
|
+
|
|
139
|
+
Dynamic specialist creation at runtime. A dispatcher robot receives questions, asks its LLM what kind of specialist is needed, then uses `spawn` to create one on the fly. The bus is created lazily on the first spawn — no explicit bus setup required. Spawned specialists are reused across questions of the same type.
|
|
140
|
+
|
|
141
|
+
Demonstrates: `spawn` for dynamic robot creation, lazy bus creation, `on_message` for reply handling, LLM-driven delegation.
|
|
142
|
+
|
|
143
|
+
**Requires:** LLM API key
|
|
144
|
+
|
|
145
|
+
### 14 — The Rusty Circuit (Open Mic Night)
|
|
146
|
+
|
|
147
|
+
A comedy club where three robots interact through a shared message bus. A comedian performs stand-up armed with self-modification tools (style reinvention, energy adjustment, coaching). A heckler reacts from the audience — heckling weak material, telling counter-jokes with the comic as the punch line, showing grudging respect, or staying silent when a bit doesn't warrant a response. A talent scout observes silently, spawning specialist analysts and refining evaluation criteria before delivering a final verdict.
|
|
148
|
+
|
|
149
|
+
Terminal output is color-formatted: comic bits in cyan (left-aligned), heckler reactions in yellow (right-indented), tool annotations dimmed. Scout notes go to `scout_notes.md` instead of STDOUT. The final verdict appears in green on both STDOUT and the scout file.
|
|
150
|
+
|
|
151
|
+
Demonstrates: Robot subclasses, self-modification via tool side effects, dynamic spawning (`spawn`), shared `:room` channel + personal channels, processing guards for async serialization, `[SILENCE]` opt-out pattern, style reinvention via user-prompt injection.
|
|
152
|
+
|
|
153
|
+
**Requires:** LLM API key
|
|
154
|
+
|
|
155
|
+
## Prompt Templates
|
|
156
|
+
|
|
157
|
+
Templates live in `examples/prompts/` as `.md` files with YAML front matter. Each template defines a robot's personality and behavior:
|
|
158
|
+
|
|
159
|
+
```markdown
|
|
160
|
+
---
|
|
161
|
+
description: Simple helpful assistant
|
|
162
|
+
temperature: 0.7
|
|
163
|
+
parameters:
|
|
164
|
+
company_name: null
|
|
165
|
+
---
|
|
166
|
+
You are a helpful assistant for <%= company_name %>.
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Front matter keys like `model`, `temperature`, `top_p`, `max_tokens` are applied to the robot's chat automatically. Parameters with `null` values are required and must be provided via `context:` at build time.
|
|
170
|
+
|
|
171
|
+
### Template Inventory
|
|
172
|
+
|
|
173
|
+
| Template | Used By | Description |
|
|
174
|
+
|----------|---------|-------------|
|
|
175
|
+
| `helper.md` | 01 | Simple helpful assistant |
|
|
176
|
+
| `assistant.md` | 02 | Assistant with tool access |
|
|
177
|
+
| `classifier.md` | 03 | Request classifier (billing/technical/general) |
|
|
178
|
+
| `billing.md` | 03 | Billing specialist |
|
|
179
|
+
| `technical.md` | 03 | Technical support specialist |
|
|
180
|
+
| `general.md` | 03 | General support |
|
|
181
|
+
| `github_assistant.md` | 04 | GitHub-aware assistant |
|
|
182
|
+
| `triage.md` | 06 | E-commerce request triage |
|
|
183
|
+
| `order_support.md` | 06 | Order inquiry specialist |
|
|
184
|
+
| `product_support.md` | 06 | Product questions specialist |
|
|
185
|
+
| `escalation.md` | 06 | Complex issue handler |
|
|
186
|
+
| `sentiment_analyzer.md` | 07 | Sentiment analysis |
|
|
187
|
+
| `entity_extractor.md` | 07 | Entity extraction |
|
|
188
|
+
| `keyword_extractor.md` | 07 | Keyword extraction |
|
|
189
|
+
| `synthesizer.md` | 07 | Multi-source synthesis |
|
|
190
|
+
| `llm_config_demo.md` | 08 | Configuration demo |
|
|
191
|
+
| `configurable.md` | 09 | Configurable template with front matter |
|
|
192
|
+
| `comedian.md` | 12 | Robot joke teller |
|
|
193
|
+
| `comedy_critic.md` | 12 | Joke evaluator (FUNNY/NOT_FUNNY) |
|
|
194
|
+
| `dispatcher.md` | 13 | Specialist role dispatcher |
|
|
195
|
+
| `open_mic_comic.md` | 14 | Observational comedian with self-modification |
|
|
196
|
+
| `open_mic_heckler.md` | 14 | Tough audience heckler (can stay silent or counter-joke) |
|
|
197
|
+
| `open_mic_scout.md` | 14 | Talent scout with analyst recruitment |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Demanding comedy critic that evaluates jokes
|
|
3
|
+
temperature: 0.2
|
|
4
|
+
---
|
|
5
|
+
You are a brutally demanding comedy critic. You have extremely high
|
|
6
|
+
standards. Most jokes are NOT funny to you — predictable puns, obvious
|
|
7
|
+
wordplay, and basic setups bore you. Only truly clever, surprising, or
|
|
8
|
+
brilliantly constructed jokes earn your approval.
|
|
9
|
+
Reply with EXACTLY one word on the first line: FUNNY or NOT_FUNNY
|
|
10
|
+
Then on the next line give a one-sentence explanation of your verdict.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Dispatcher that decides which specialist to spawn
|
|
3
|
+
temperature: 0.2
|
|
4
|
+
---
|
|
5
|
+
You are a dispatcher. Given a user question, decide which ONE specialist
|
|
6
|
+
should handle it. Reply with EXACTLY two lines:
|
|
7
|
+
|
|
8
|
+
Line 1: the specialist role as a single lowercase_snake_case word
|
|
9
|
+
(e.g. historian, scientist, poet, philosopher, mathematician)
|
|
10
|
+
Line 2: a one-sentence system prompt that tells that specialist how to behave
|
|
11
|
+
|
|
12
|
+
Nothing else. No preamble, no explanation.
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Senior specialist for escalated cases
|
|
3
|
+
parameters:
|
|
4
|
+
company_name: null
|
|
5
|
+
authorities: null
|
|
6
|
+
customer: null
|
|
7
|
+
---
|
|
1
8
|
You are a senior customer experience specialist for <%= company_name %>, handling escalated and complex cases.
|
|
2
9
|
|
|
3
10
|
## Your Role
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: GitHub assistant with MCP tool access
|
|
3
|
+
mcp:
|
|
4
|
+
- name: github
|
|
5
|
+
transport: stdio
|
|
6
|
+
command: npx
|
|
7
|
+
args: ["-y", "@modelcontextprotocol/server-github"]
|
|
8
|
+
---
|
|
1
9
|
You are a helpful GitHub assistant with access to GitHub tools via MCP.
|
|
2
10
|
|
|
3
11
|
You can search repositories, view issues, read file contents, and more.
|