+++ recipe archive +++
Cookbook
86 recipes, each a complete program you can copy and run. Every recipe is type-checked against the current packages and comes from — or links to — a runnable example in the repository.
86 recipes16 sections
Run a recipe on its own
Recipes use top-level await, so run them in an ES module project. Each recipe lists the packages to add and the command to run it.
new project · bash
mkdir cogitator-recipes && cd cogitator-recipes
npm init -y && npm pkg set type=module
pnpm add -D tsx typescript @types/nodeMost recipes call Google Gemini, which has a free tier — get a key at Google AI Studio. Swap the provider and model to use OpenAI, Anthropic or a local Ollama model instead.
Or run the full examples
repository · bash
git clone https://github.com/cogitator-ai/Cogitator-AI.git && cd Cogitator-AI
pnpm install && pnpm build
echo "GOOGLE_API_KEY=your-key" > .env
npx tsx examples/core/01-basic-agent.ts+++ sections +++
Getting Started4A first agent with tools and streaming, the built-in tools, typed JSON answers and a scaffolded project.Agents & Tools10Cache expensive tools, pause for approval, hand conversations between agents, keep long chats inside the context window, fall back to another model, give tools per-request deps, load skills from SKILL.md.Memory & RAG7Threads that remember, token-aware context, hybrid search, knowledge graphs and retrieval-augmented agents.Workflows3DAG workflows with tool, agent and function nodes, conditional branches, human approvals and map-reduce.Swarms5Several agents on one task: debate, pipeline, delegation, voting and negotiation.Reasoning & Learning5Explore several solution paths, learn from past runs, replay and fork runs, reason about cause and effect.Safety & Cost5Block prompt injection, filter harmful input and output, decide tool calls by rules and modes, and keep spending under a budget.MCP, A2A & ACP7Use MCP servers, expose your tools and agents over MCP, talk to other agents over A2A, and put your agents in editors over ACP.Servers & Frameworks8Serve agents over REST, SSE and WebSocket from Express, Fastify, Hono, Koa, Next.js and Tetsu, or behind the OpenAI and AI SDK interfaces.Deno & Edge2The Hono adapter on Deno and on Cloudflare Workers.Evals3Measure agents with datasets, metrics, LLM judges, assertions and statistically tested A/B comparisons.Voice4Speech-to-text, agent and text-to-speech pipelines, realtime speech-to-speech and WebSocket voice servers.Browser Agents3Agents that drive a real browser: scraping, filling forms and browsing with stealth.Messaging Channels7Put an agent on Telegram, a WebChat socket, GitHub issues and reviews, an email inbox or Microsoft Teams, or build a full personal assistant from a config object.Infrastructure8Persistent memory in Redis and PostgreSQL, distributed job queues, sandboxed execution and deployment.Advanced5Agents that extend themselves, logic programming, constraint solving, verified plans and WASM-sandboxed tools.