Examples
Each example is one file you can run. They check their own results, and the SDK's tests run all of them offline, so they work with the version these docs describe.
| Example | Shows |
|---|---|
| Governed refund agent | An agent with a tool that needs a human's approval. |
| Document Q&A | Retrieval, reranking and a grounded answer with citations. |
| Streaming chat | Tokens and node progress as they happen. |
| Resume across processes | A run that stops in one process and finishes in another. |
| Parallel agents | One agent per item, and a council that ranks its answers. |
| Deep agent | Planning, a governed filesystem, and a sub-agent. |
Run one
git clone https://github.com/AI-Adriane/ailu-core && cd ailu-core
pnpm install && bash scripts/build-napi.sh
AILU_LLM_MOCK=1 pnpm --filter @ailu-ai/graph-sdk exec node --import tsx examples/agent.ts
Drop AILU_LLM_MOCK=1 and set a provider key (ANTHROPIC_API_KEY, ...) to run on a real model.
Longer examples in the repository
startup-e2e.ts: a venture pipeline on the catalog runner, with a brand-review human gate and adeploy_to_prodtool that waits for the founder's approval.finance-sage-optimization.ts: an agent analyses an accounting export; posting corrections waits for the CFO's approval.product-pipeline.ts: brief to launch, with a component, a semantic retriever and agents on three model tiers.qa-rag.ts: question answering where an answer no source backs goes to a human review gate instead of being published.token-economics.ts: prompt tokens of one long shared context compared with governed RAG agents.