Examples
Detailed practical examples for common NucleusIQ workflows.
Updated for v0.7.14: Autonomous harness (termination_reason, diagnostics, Task.resources, result.parsed). See migration notes if upgrading.
Getting started
- Basic agent — Your first agent with tools (OpenAI, Gemini, context management)
- Streaming — Real-time token-by-token output
Workflows
- File workflow — Search, read, and extract from files
- Autonomous mode guide — why the harness changed, what improved, and current APIs
- Autonomous workflow — Invoice extraction with
Task.resources, enforced schema, anddiagnostics(v0.7.14)
Observability
- Usage tracking — Token usage by purpose and origin
- Cost estimation — Dollar cost tracking after execution
Provider examples
- OpenAI-compatible quickstart — Self-hosted vLLM / SGLang / llama.cpp / LM Studio / Azure OpenAI v1 (
nucleusiq-openai-compatible0.1.0,nucleusiq>=0.7.13) - Gemini quickstart — Google Gemini with all three execution modes
- Anthropic quickstart — Claude DIRECT / STANDARD / AUTONOMOUS (
nucleusiq-anthropic0.2.2,nucleusiq>=0.7.12) - Groq quickstart — Groq DIRECT / STANDARD / AUTONOMOUS (
nucleusiq-groq0.1.1,nucleusiq>=0.7.12) - Ollama quickstart — Native Ollama DIRECT / STANDARD (
nucleusiq-ollama0.2.2,nucleusiq>=0.7.12) - OpenAI-compatible provider — Engines, auth,
validate(), structured-output policy - Anthropic provider guide — Phase B native tools, prompt caching, extended thinking
- Groq provider guide — 429 /
Retry-After,strict_model_capabilities, repo scripts - Ollama provider guide — Native
/api/chat,think, vision, structured-output + tools caveat
Tool adapter examples
- MCP quickstart — Universal Model Context Protocol adapter across every provider (
nucleusiq-mcp0.1.1,nucleusiq>=0.7.12): stdio, HTTP + Bearer, multi-server, filter/rename, graceful degradation, source tracing, plugin guardrails - MCP integration guide — Transports, auth strategies, filtering,
ping(), comparison vs OpenAI server-side MCP
Which page for self-hosted / BYOM?
Start with OpenAI-compatible quickstart; use OpenAI-compatible provider for engines, auth, validate(), and Azure OpenAI v1 limits.
Which page for Anthropic (Claude)?
Start with Anthropic quickstart; use Anthropic provider for install pins, env vars, limitations, and CI-tested examples.
Which page for Ollama?
Start with Ollama quickstart; use Ollama provider for the full capability matrix and env reference.
Which Groq page?
Start with Groq quickstart for copy-paste snippets; use Groq provider for deeper operational guidance.
Which page for MCP?
Start with MCP quickstart for copy-paste recipes (stdio + HTTP, multi-server, tracing); use MCP integration guide for transports, OAuth, decorator filters, and graceful degradation.
Repository examples
Full runnable scripts are available in the GitHub repository:
- Core examples
- OpenAI examples
- OpenAI-compatible examples
- Gemini examples
- Anthropic examples — DIRECT through AUTONOMOUS, streaming, native structured demo
- Groq examples — Direct through Autonomous + structured output
- Ollama examples — Smoke, Direct, streaming live, capabilities matrix
- MCP examples — Eight runnable examples: stdio, HTTP + auth, multi-server, OAuth, error handling, health check, decorator filters, full agent with LLM
- Notebooks — Jupyter notebooks: context management showcase,
mcp_tools_showcase.ipynb(Windows-friendly Streamable HTTP demo), and more