Getting Started Agent
This Livebook defines the smallest useful Jidoka conversation: inspect one agent, preview one prompt, then run two turns in one session. It does not use a provider key or network access.
package_root = Path.expand("../..", __DIR__)
Mix.install(
[
{:kino, "~> 0.14"},
{:jidoka, path: package_root}
],
consolidate_protocols: false,
lockfile: Path.join(package_root, "mix.lock")
)
Code.require_file(Path.expand("../loader.exs", __DIR__))
JidokaExamples.Loader.load!(__DIR__)
alias JidokaExamples.GettingStarted.Agent
alias JidokaExamples.GettingStarted.Scenario
Jidoka.Kino.setup_notebook(model: "test:getting-started", check_provider?: false)
Inspect The Agent
The agent has one model, one instruction, and no tools.
inspection = Jidoka.inspect(Agent)
%{
id: inspection.spec.id,
instructions: inspection.spec.instructions,
model: inspection.spec.model,
operations: inspection.spec.operations
}
Preview The Prompt
Preflight builds the exact prompt without calling the model.
input = "What can you help me with?"
{:ok, preflight} = Jidoka.preflight(Agent, input)
%{
diagnostics: preflight.diagnostics,
messages: preflight.prompt.messages,
model: preflight.prompt.model,
operations: preflight.prompt.operations
}
Run Two Chats In One Session
The scenario injects one deterministic model function and calls
Jidoka.Session.chat/3 twice. A production call uses the model declared by the
agent.
{:ok, report} = Scenario.run(input: input)
%{
answers: report.answers,
inputs: report.inputs,
model: report.model,
session_id: report.session_id,
turn_count: report.turn_count
}
Continue
Open examples/support_agent/support_agent.livemd to add a tool, an operation
control, and an approval path.