Loading the notebook…
Loading the notebook…
Notebooks · First agents · 01
Use this notebook to test the smallest possible Agent setup.
Its imports and arguments are checked against shipit-agent 3.0. The outputs were saved when it was written, for an earlier release.
from pathlib import Path
import sys
ROOT = (
Path.cwd().resolve().parent
if Path.cwd().name == "notebooks"
else Path.cwd().resolve()
)
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from examples.run_multi_tool_agent import build_llm_from_env
from shipit_agent import Agent!pip install litellmRequirement already satisfied: litellm in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (1.83.13) Requirement already satisfied: fastuuid==0.14.0 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (0.14.0) Requirement already satisfied: httpx==0.28.1 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (0.28.1) Requirement already satisfied: openai==2.24.0 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (2.24.0) Requirement already satisfied: python-dotenv==1.0.1 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (1.0.1) Requirement already satisfied: tiktoken==0.12.0 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (0.12.0) Requirement already satisfied: importlib-metadata==8.5.0 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (8.5.0) Requirement already satisfied: tokenizers==0.22.2 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (0.22.2) Requirement already satisfied: click==8.1.8 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (8.1.8) Requirement already satisfied: jinja2==3.1.6 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (3.1.6) Requirement already satisfied: aiohttp==3.13.3 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (3.13.3) Requirement already satisfied: pydantic==2.12.5 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (2.12.5) Requirement already satisfied: jsonschema==4.23.0 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from litellm) (4.23.0) Requirement already satisfied: aiohappyeyeballs>=2.5.0 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from aiohttp==3.13.3->litellm) (2.6.1) Requirement already satisfied: aiosignal>=1.4.0 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from aiohttp==3.13.3->litellm) (1.4.0) Requirement already satisfied: attrs>=17.3.0 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from aiohttp==3.13.3->litellm) (23.2.0) Requirement already satisfied: frozenlist>=1.1.1 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from aiohttp==3.13.3->litellm) (1.4.1) Requirement already satisfied: multidict<7.0,>=4.5 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from aiohttp==3.13.3->litellm) (6.0.5) Requirement already satisfied: propcache>=0.2.0 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from aiohttp==3.13.3->litellm) (0.4.1) Requirement already satisfied: yarl<2.0,>=1.17.0 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from aiohttp==3.13.3->litellm) (1.23.0) Requirement already satisfied: anyio in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from httpx==0.28.1->litellm) (4.11.0) Requirement already satisfied: certifi in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from httpx==0.28.1->litellm) (2024.2.2) Requirement already satisfied: httpcore==1.* in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from httpx==0.28.1->litellm) (1.0.5) Requirement already satisfied: idna in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from httpx==0.28.1->litellm) (3.7) Requirement already satisfied: zipp>=3.20 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from importlib-metadata==8.5.0->litellm) (3.23.0) Requirement already satisfied: MarkupSafe>=2.0 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from jinja2==3.1.6->litellm) (2.1.5) Requirement already satisfied: jsonschema-specifications>=2023.03.6 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from jsonschema==4.23.0->litellm) (2023.12.1) Requirement already satisfied: referencing>=0.28.4 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from jsonschema==4.23.0->litellm) (0.35.1) Requirement already satisfied: rpds-py>=0.7.1 in ~/.pyenv/versions/3.11.0/lib/python3.11/site-packages (from jsonschema==4.23.0->litellm) (0.19.1) Requirement alread … output trimmed
!playwright install chromiumllm = build_llm_from_env("bedrock")from pydantic import BaseModel
class Movie(BaseModel):
title: str
rating: float
genre: str | None = None
agent = Agent(llm=llm)
result = agent.run(
"Recommend a great thriller from the last decade.",
output_schema=Movie,
)
print(type(result.parsed)) # <class '__main__.Movie'>
# raw JSON text the model produced<class '__main__.Movie'>
resultAgentResult(output='{\n "title": "Sicario",\n "rating": 7.6,\n "genre": "Thriller"\n}', messages=[Message(role='system', content='You are Shipit, a capable general-purpose agent runtime.\n\nCore behavior:\n- Be accurate, direct, and execution-oriented.\n- Solve the user\'s task end-to-end when possible instead of stopping at analysis.\n- Use tools when they materially improve correctness, freshness, or efficiency.\n- Prefer structured evidence over guesses.\n\nTool behavior:\n- Read tool descriptions and tool prompts carefully before calling them.\n- Use the smallest correct tool for the jo… (82,551 more characters)parse_result = result.parsedparse_result.title'Sicario'
print(result.parsed.title) # "The Dark Knight"
print(result.parsed.rating) # 9.0
print(result.output) print(result)AgentResult(output='', messages=[Message(role='system', content='You are Shipit, a capable general-purpose agent runtime.\n\nCore behavior:\n- Be accurate, direct, and execution-oriented.\n- Solve the user\'s task end-to-end when possible instead of stopping at analysis.\n- Use tools when they materially improve correctness, freshness, or efficiency.\n- Prefer structured evidence over guesses.\n\nTool behavior:\n- Read tool descriptions and tool prompts carefully before calling them.\n- Use the smallest correct tool for the job.\n- When a task is complex, plan before acting.\n- When informatio… (118,861 more characters)
Saved output:
AgentResult(output='', messages=[Message(role='system', content='You are Shipit, a capable general-purpose agent runtime.
Core behavior:
- Be accurate, direct, and execution-oriented.
- Solve the user\'s task end-to-end when possible instead of stopping at analysis.
- Use tools when they materially improve correctness, freshness, or efficiency.
- Prefer structured evidence over guesses.
Tool behavior:
- Read tool descriptions and tool prompts carefully before calling them.
- Use the smallest correct tool for the job.
- When a task is complex, plan before acting.
- When information may be outdated, prefer web and external tools over stale assumptions.
- When a task needs files, artifacts, or code execution, use the relevant tools instead of simulating output.
Quality bar:
- Keep outputs clear and complete.
- Verify important results before returning them.
- Surface residual uncertainty instead of hiding it.
- Avoid repeated failed actions; adjust strategy after an error.
<!-- skill:product-development-guide -->
Skill: Product Development Guide
Helps you validate product ideas, scope an MVP, write a PRD, plan a roadmap, and prepare for launch.
Product Development Guide helps you turn product ideas into clearer decisions and action plans.
It can help with idea validation, MVP scoping, feature prioritization, PRD drafting, roadmap planning, and launch readiness. This is useful when you want a more structured way to decide what to build, what to delay, and what to do next.
Use it for:
- validating a product idea
- scoping an MVP
- prioritizing features
- writing a product spec or PRD
- planning a roadmap or launch checklist
It works well for founders, product managers, startup teams, and builders who want a clearer product plan without overcomplicating the process.
Use cases: Validate a startup idea before committing significant time and money to building it; Define an MVP scope for a new feature that the team keeps over-engineering; Prioritize a product backlog using a structured framework before a planning session; Develop a go-to-market strategy for a product about to launch; Identify the riskiest assumptions in a product plan and design experiments to test them
… 1330 more lines
from shipit_agent.tools.dashboard_render import DashboardRenderTool
agent = Agent(
llm=llm, # Bedrock / OpenAI / Anthropic / LiteLLM — any
tools=[DashboardRenderTool()],
prompt=(
"You are a visual reporting assistant. When the user asks for a "
"dashboard, one-pager, or visual summary, call render_dashboard "
"with the section types that fit the question."
),
)
for i in agent.stream("Make a Q2-FY26 sales dashboard for the board: MRR, growth chart, top customers, risk callouts."):
print(i, end="")AgentEvent(type='run_started', message='Agent run started', payload={'prompt': 'Make a Q2-FY26 sales dashboard for the board: MRR, growth chart, top customers, risk callouts.'})AgentEvent(type='step_started', message='LLM completion started', payload={'tool_count': 11, 'iteration': 1})AgentEvent(type='reasoning_started', message='Model reasoning started', payload={'iteration': 1})AgentEvent(type='reasoning_completed', message='Model reasoning completed', payload={'iteration': 1, 'content': 'The user wants a Q2-FY26 sales dashboard for the board, with MRR, growth chart, top customers, risk call… (5,513 more characters)from IPython.display import Markdown, display
agent = Agent(
llm=llm,
name="no-tools-demo",
description="Minimal agent without tools using the default AWS Bedrock LLM setup.",
)
result = agent.run("Explain what this agent can do without any tools attached.")
display(Markdown(result.output))Below is a concise overview of what I (the language‑model‑based agent) can do without any external tools such as a web‑search engine, code interpreter, file system, or database connector.
| Capability | What it means | Typical uses |
|---|---|---|
| Natural‑language understanding | I can read and interpret any text you provide – questions, instructions, excerpts, code snippets, data tables, etc. | Clarifying requirements, extracting intent, summarising user‑provided documents |
| Natural‑language generation | I can produce fluent, context‑aware prose in many styles and registers. | Writing essays, emails, reports, creative stories, marketing copy, documentation |
| Knowledge recall | I contain a broad, static knowledge base learned during pre‑training (up to my 2024‑06 cut‑off). I can answer factual questions, explain concepts, and provide historical or scientific context within that window. | Explaining physics concepts, describing historical events, giving programming best‑practices |
| Reasoning & problem solving | I can chain logical steps, perform arithmetic, solve puzzles, and walk through algorithms mentally. | Solving math problems, algorithm design, planning a trip itinerary, troubleshooting logic bugs |
| Code synthesis & review | I can write, refactor, and explain code in many languages, and I can simulate what the code would do (but I cannot actually execute it). | Generating functions, suggesting improvements, teaching programming concepts |
| Data manipulation (in‑memory) | I can transform, sort, filter, or aggregate data that you paste into the conversation, using plain‑text reasoning or pseudo‑code. | Re‑formatting CSV snippets, summarising tables, calculating statistics manually |
| Language translation | I can translate text between a large number of languages, preserving tone and nuance. | Translating emails, localising UI strings, interpreting foreign‑language excerpts |
| Summarisation & extraction | I can condense long passages, produce bullet‑point take‑aways, or extract specific entities (names, dates, numbers, etc.). | Summarising research papers, extracting action items from meeting notes |
| Creative brainstorming | I can generate ideas, outlines, or prompts for artistic, business, or technical projects. | Producing product names, plot twists, UI concepts, marketing angles |
| Role‑play & tutoring | I can adopt a persona (teacher, interview coach, mentor) and provide guided practice or feedback. | Conducting mock interviews, teaching a language, offering career advice |
| Simulation of simple programs | By reasoning step‑by‑step I can “run” small snippets of code in my head, predict output, and debug logically. | Predicting the result of a loop, tracing a recursive function, checking edge cases |
| Limitation | Why it matters |
|---|---|
| Live web searches | I cannot retrieve information that changed after my knowledge cut‑off (June 2024) or look up obscure/real‑time data. |
| File system access | I cannot read, write, or list files on a computer or cloud storage. |
| Code execution | I cannot actually run Python, JavaScript, or any other language to verify behavior; I can only reason about it. |
| Database/ API calls | I cannot query external services (e.g., weather APIs, stock tickers). |
| Multimedia processing | I cannot view images, audio, video, or generate them (e.g., no image generation, no speech synthesis). |
| Persistent state | Each interaction is stateless beyond the current conversation; I don’t retain memory across separate sessions. |