-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy path28-ref-composition.vvm
More file actions
30 lines (24 loc) · 918 Bytes
/
28-ref-composition.vvm
File metadata and controls
30 lines (24 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# VVM Example 28: Ref Composition (Filesystem State Mode)
# Demonstrates basic ref passing between agents.
# In filesystem mode, research returns a ref value, not the full text.
# The writer receives the ref and reads the file if needed.
agent researcher(
model="sonnet",
prompt="Research topics thoroughly with citations."
)
agent writer(
model="sonnet",
prompt="Write clear, well-structured reports."
)
# Input topic
topic = "quantum computing applications in cryptography"
# Research phase - returns ref value in filesystem mode
research = @researcher `Research {topic}. Include:
- Current state of the field
- Key breakthroughs
- Practical applications
- Future directions`(topic)
# Writing phase - receives ref, reads file if full content needed
report = @writer `Write a comprehensive report using this research.
Structure with introduction, body sections, and conclusion.`(research)
export report