Skip to content

SDK Tutorials

SDK Tutorials — Real Problems, Real Solutions

Section titled “SDK Tutorials — Real Problems, Real Solutions”

These tutorials don’t waste your time with “hello world” demos. Each one solves a problem that costs real money, real engineer-hours, or both. They’re short, opinionated, and brutally focused on outcomes.

Start with the runnable SDK example tracks below before you go deep into the full tutorials.

Business needBest example track
Customer support triagebusiness_case_showcase + session_aware_support
Executive update draftingbusiness_case_showcase
Budget-sensitive engineering helpcost_aware_review
Multi-step analyst workparallel_research + multi_agent_pipeline

These examples are not aspirational — they are backed by fresh local end-to-end verification.

TargetCoverage proof
Rust34/34 passed
Node.js30/30 passed
Python28/28 passed
WASM17/17 passed
#TutorialProblem SolvedMeasured Win
1Cost-Aware Code ReviewLLM bills from over-using flagship models on trivial work60–90% cost cut vs. always-Opus baseline
2Parallel Research PipelineSequential LLM calls that take 30s when they could take 6s5× throughput on independent queries
3Multi-Agent DocumentationOne model trying to do 5 jobs poorlySpecialist fork pattern with shared context
4Session-Aware Support BotBots that forget who the user is and re-ask everythingFTS5 search across every prior conversation
5Safe SQL Agent (Custom Tool)Agents that can read anything — including your prod DBAllow-list + approval gate for destructive ops

If any of these apply, read on:

┌────────────────────────────────────────────────────────────────┐
│ You are building an LLM product and… │
│ │
│ ✓ Your monthly LLM bill just doubled │
│ ✓ Users complain the bot is "slow" │
│ ✓ You need to mix models (cheap + expensive) in one flow │
│ ✓ You need tool-use with human-in-the-loop approval │
│ ✓ You need to embed an agent in an existing app (not CLI) │
└────────────────────────────────────────────────────────────────┘

The three EdgeCrab SDKs are thin language wrappers around one Rust engine — the same engine that powers the CLI. No REST, no IPC, no Python-subprocess-spawns-Rust hacks.

┌─────────────────────────────────┐
│ edgecrab-sdk-core (Rust) │
│ SdkAgent │ ToolRegistry │ DB │
│ ReAct loop │ streaming │
└──┬────────────┬────────────┬────┘
│ │ │
┌─────────┘ │ └─────────┐
│ │ │
┌────┴─────┐ ┌──────┴─────┐ ┌──────┴─────┐
│ Rust │ │ Python │ │ Node.js │
│ edgecrab │ │ edgecrab │ │ edgecrab │
│ -sdk │ │ (PyO3) │ │ (napi-rs) │
└──────────┘ └────────────┘ └────────────┘
│ │ │
in-process in-process in-process
zero-copy zero-copy zero-copy

This matters because:

  • No network hop → p50 latency matches CLI.
  • Shared session DB → a Python script and a Node.js dashboard can read the same conversation history.
  • Same toolset → any tool that works in the CLI works in every SDK.
  • All code samples are tested and known-working on EdgeCrab SDK v0.6+.
  • Every tutorial has a verification block you can paste into a terminal.
  • Every tutorial has a cost/latency table showing the win.
  • We recommend starting with Cost-Aware Code Review — it sets up patterns used throughout.
Terminal window
# 1. Install EdgeCrab (any SDK)
# Rust:
cargo add edgecrab-sdk tokio --features tokio/full
# Python:
pip install edgecrab
# Node.js:
npm install edgecrab
# 2. Set one of these API keys in your shell
export OPENAI_API_KEY=sk-... # OpenAI
export GITHUB_TOKEN=ghp_... # GitHub Copilot (gpt-5-mini and related catalog access)
export OPENAI_BASE_URL=http://localhost:11434/v1 # Local Ollama / compatible endpoint

Every tutorial works with any model in the catalog. We recommend copilot/gpt-5-mini for the cost-sensitive examples and openai/gpt-4o or openai/gpt-5 for the reasoning-heavy ones.

To swap models in any example:

// Rust
let agent = SdkAgent::new("copilot/gpt-5-mini")?;
# Python
agent = Agent("copilot/gpt-5-mini")
Node.js
const agent = new Agent({ model: 'copilot/gpt-5-mini' });

Ready? Start with Tutorial 1 — Cost-Aware Code Review →