Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/00-hello-world/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ async def main() -> None:
graph = build_graph()
graph.attach_observer(trace)
try:
final = await graph.invoke(PipelineState(query="what is RAG?"))
final = await graph.invoke(PipelineState(query="why did Apollo 13 abort its lunar landing?"))
print(f"\nclassification: {final.classification}")
if final.research_plan is not None:
print(f"research_plan: {final.research_plan}")
Expand Down
4 changes: 2 additions & 2 deletions examples/01-routing-and-subgraphs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
uv sync --group examples
cd examples/01-routing-and-subgraphs
LLM_API_KEY=sk-... uv run python main.py "what year did the moon landing happen"
LLM_API_KEY=sk-... uv run python main.py "is espresso actually more caffeinated than drip?"
LLM_API_KEY=sk-... uv run python main.py "why is the lunar south pole strategically important?"
"""

from __future__ import annotations
Expand Down Expand Up @@ -454,7 +454,7 @@ def build_graph() -> CompiledGraph[AssistantState]:


async def main() -> None:
question = " ".join(sys.argv[1:]) or "is espresso actually more caffeinated than drip coffee?"
question = " ".join(sys.argv[1:]) or "why is the lunar south pole strategically important?"
graph = build_graph()
try:
final = await graph.invoke(AssistantState(question=question))
Expand Down
11 changes: 6 additions & 5 deletions examples/02-explicit-subgraph-mapping/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""openarmature demo: same compiled subgraph reused at two sites in one parent
graph, each site with its own ExplicitMapping.

**Use case:** Compare two topics ("rust vs go", "espresso vs drip coffee")
by running the same analysis subgraph on each, then synthesizing a verdict.
**Use case:** Compare two topics ("Apollo program vs Artemis program",
"Apollo 11 vs Apollo 17") by running the same analysis subgraph on each,
then synthesizing a verdict.

**Demonstrates:** One compiled subgraph reused at two parent sites with
per-site `ExplicitMapping` — the canonical way to express "run the same
Expand All @@ -27,8 +28,8 @@

uv sync --group examples
cd examples/02-explicit-subgraph-mapping
LLM_API_KEY=sk-... uv run python main.py "rust" "go"
LLM_API_KEY=sk-... uv run python main.py "espresso vs drip coffee"
LLM_API_KEY=sk-... uv run python main.py "Apollo 11" "Apollo 17"
LLM_API_KEY=sk-... uv run python main.py "Apollo program vs Artemis program"
"""

from __future__ import annotations
Expand Down Expand Up @@ -262,7 +263,7 @@ async def main() -> None:
elif len(args) == 1 and " vs " in args[0].lower():
topic_a, topic_b = re.split(r" vs ", args[0], maxsplit=1, flags=re.IGNORECASE)
else:
topic_a, topic_b = "rust", "go"
topic_a, topic_b = "Apollo 11", "Apollo 17"

graph = build_graph()
try:
Expand Down
2 changes: 1 addition & 1 deletion examples/03-observer-hooks/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
uv sync --group examples --all-extras
cd examples/03-observer-hooks
LLM_API_KEY=sk-... uv run python main.py "what year did the moon landing happen"
LLM_API_KEY=sk-... uv run python main.py "explain the rise of espresso culture"
LLM_API_KEY=sk-... uv run python main.py "explain why NASA is returning to the moon with Artemis"

(``--all-extras`` pulls in ``opentelemetry-sdk`` for the OTel observer.)
"""
Expand Down
30 changes: 17 additions & 13 deletions examples/04-nested-subgraphs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
uv sync --group examples
cd examples/04-nested-subgraphs
LLM_API_KEY=sk-... uv run python main.py "what year did humans first land on the moon?"
LLM_API_KEY=sk-... uv run python main.py "how is espresso different from drip coffee?"
LLM_API_KEY=sk-... uv run python main.py "what happened on Apollo 13?"
LLM_API_KEY=sk-... uv run python main.py "who was on the Artemis II crew?"
"""

from __future__ import annotations
Expand Down Expand Up @@ -93,23 +94,26 @@ async def _chat(system: str, user: str) -> str:
),
},
{
"title": "Espresso",
"title": "Apollo 13",
"body": (
"Espresso is a coffee brewing method of Italian origin. It is made by forcing pressurized "
"hot water through finely ground coffee. The resulting shot is more concentrated than coffee "
"brewed by other methods, with a layer of crema on top. Espresso has more caffeine per "
"unit volume than most coffee beverages but a typical serving is one-tenth the volume of a "
"drip coffee, so a single espresso usually contains less total caffeine than a drip cup."
"Apollo 13 was the seventh crewed mission in the Apollo program and the third intended "
"to land on the Moon. The lunar landing was aborted after an oxygen tank in the service "
"module ruptured two days after launch in April 1970, crippling power and life support. "
"The crew of Jim Lovell, Jack Swigert, and Fred Haise used the lunar module Aquarius as "
"a lifeboat and looped around the Moon on a free-return trajectory before splashing down "
"safely in the Pacific. The mission is remembered as a successful failure."
),
},
{
"title": "Walking",
"title": "Artemis II",
"body": (
"Walking is the most common form of human locomotion and is associated with a range of "
"health benefits including reduced risk of cardiovascular disease, improved mood, and "
"lower mortality. A moderate pace of around 100 steps per minute is often cited as a "
"useful threshold. Walking as a deliberate practice has long been associated with "
"thinking and writing — many writers credit long walks as part of their creative process."
"Artemis II was the first crewed mission of NASA's Artemis program, launching from "
"Kennedy Space Center on April 1, 2026 atop the Space Launch System rocket. The "
"ten-day flight carried astronauts Reid Wiseman, Victor Glover, Christina Koch, and "
"Jeremy Hansen aboard the Orion spacecraft Integrity on a free-return trajectory around "
"the Moon and back. It was the first crewed flight beyond low Earth orbit since Apollo "
"17 in 1972. The capsule splashed down in the Pacific Ocean on April 10, 2026, marking "
"a successful test flight ahead of the Artemis III lunar landing mission."
),
},
]
Expand Down
Loading