Start here
sdk-examples/no-api-key.ts is the fastest way to confirm the SDK, runtime, and local tool wiring are functioning at all.
Examples
These examples match the current sdk-examples/ directory and the current runtime semantics.
The commands below were aligned to the repo-level launch scripts and the clean no-key skip paths,
so they are useful both as docs and as a practical validation surface.
The SDK examples are intentionally split between no-key examples that always run, and model-backed examples that execute live when provider credentials are present.
| Example | Command | What it covers | Credential behavior |
|---|---|---|---|
| No-key SDK demo | npx tsx sdk-examples/no-api-key.ts |
Tool registration, whitelist and blacklist policy behavior, and a Prolog-only DML run with no model call. | Runs without provider keys. |
| Quick start | npm run example |
Minimal SDK setup plus a simple task() and answer() flow. |
Skips cleanly when GOOGLE_GENERATIVE_AI_API_KEY is missing. |
| Basic usage set | npm run examples |
Tool policy demo by default, plus numbered examples for custom tools, user input, cancellation, and a research flow. | The default launcher works without keys because it falls back to the tool-policy example. |
| Neurosymbolic examples | npx tsx sdk-examples/neurosymbolic.ts 1 |
Constraint filtering, symbolic reasoning, and backtracking-oriented workflows. | Skips cleanly when GOOGLE_GENERATIVE_AI_API_KEY is missing. |
| Deep research agent | npx tsx sdk-examples/deep-research.ts "test topic" |
Interactive research flow, Brave-backed search, report generation, and follow-up questions. | Skips cleanly without Google credentials and falls back to mock search when Brave credentials are absent. |
sdk-examples/no-api-key.ts is the fastest way to confirm the SDK, runtime, and local tool wiring are functioning at all.
sdk-examples/quick-start.ts is the smallest model-backed example once GOOGLE_GENERATIVE_AI_API_KEY is configured.
sdk-examples/basic-usage.ts is the broadest reference for tool registration, policies, positional agent_main args, and event handling.
sdk-examples/deep-research.ts is the best example when you want a longer-running orchestration flow instead of a minimal SDK snippet.
The repo now includes a smoke command that exercises the no-key example, the quick-start launcher, the default basic-usage launcher, and the clean skip paths for the key-backed examples.
npm run examples:smoke
sdk-examples/no-api-key.ts fully.npm run example and npm run examples scripts.neurosymbolic.ts and deep-research.ts.0 in a repo that has no provider keys configured.GOOGLE_GENERATIVE_AI_API_KEY.
To enable real Brave-backed search in deep-research.ts, also set BRAVE_API_KEY or BRAVE_KEY.