Quick Start
Install Zypher Agent and create your first AI agent in under 5 minutes
Quick Start
Get Zypher Agent running in under 5 minutes. This guide shows you the essential pattern for creating any AI agent.
Prerequisites
- Deno 2.0+ (install here)
- API Keys - Get an Anthropic API key (here) and Firecrawl API key (here)
- Note: This example uses Anthropic's Claude, but you can use OpenAI or other providers (see LLM Providers)
- Firecrawl is just an example MCP server for web crawling - you can use any MCP server or none at all
Step 1: Install Zypher Agent
Add Zypher Agent to your project:
deno add jsr:@corespeed/zypher
deno add npm:rxjs-for-await
Step 2: Set Up Environment Variables
Create a .env
file in your project root:
ANTHROPIC_API_KEY=your_anthropic_api_key_here
FIRECRAWL_API_KEY=your_firecrawl_api_key_here
Step 3: Create Your First Agent
Create a new file called main.ts
:
This example demonstrates the core pattern: create an agent with your preferred LLM provider, optionally register MCP servers for external capabilities, then run tasks. We're using Firecrawl as an example MCP server to enable web crawling.
import { AnthropicModelProvider, ZypherAgent } from "@corespeed/zypher";
import { eachValueFrom } from "rxjs-for-await";
// Helper function to safely get environment variables
function getRequiredEnv(name: string): string {
const value = Deno.env.get(name);
if (!value) {
throw new Error(`Environment variable ${name} is not set`);
}
return value;
}
// Create the agent with your preferred LLM provider
const agent = new ZypherAgent(
new AnthropicModelProvider({
apiKey: getRequiredEnv("ANTHROPIC_API_KEY"),
}),
);
// Register and connect to an MCP server to give the agent web crawling capabilities
await agent.mcpServerManager.registerServer({
id: "firecrawl",
type: "command",
command: {
command: "npx",
args: ["-y", "firecrawl-mcp"],
env: {
FIRECRAWL_API_KEY: getRequiredEnv("FIRECRAWL_API_KEY"),
},
},
});
// Initialize the agent
await agent.init();
// Run a task - the agent will use web crawling to find current AI news
const event$ = agent.runTask(
`Find latest AI news`,
"claude-sonnet-4-20250514",
);
// Stream the results in real-time
for await (const event of eachValueFrom(event$)) {
console.log(event);
}
Step 4: Run Your Agent
Execute your agent:
deno run -A main.ts
You'll see the AI agent respond with an explanation of what AI agents are.
That's it!
You've created your first Zypher Agent with just a few lines of code. The basic pattern is:
- Install -
deno add jsr:@corespeed/zypher
- Create - Agent with your preferred LLM provider
- Run - Any task with
agent.runTask()
Try Different Tasks
Change the task string to try different things:
// Ask questions
agent.runTask("What are the benefits of using AI agents?")
// Give instructions
agent.runTask("Write a hello world program in TypeScript")
// Request analysis
agent.runTask("List the pros and cons of different programming languages")
Interactive CLI Mode
For a more interactive experience, you can use the built-in terminal interface with runAgentInTerminal
. This provides a chat-like interface where you can have conversations with your agent:
import { runAgentInTerminal } from "@corespeed/zypher";
// const agent = new ZypherAgent(...)
// await agent.init()
// Start interactive CLI
await runAgentInTerminal(agent, "claude-sonnet-4-20250514");
This opens a terminal interface where you can:
- Chat with your agent interactively
- See real-time responses as they stream
- Ask follow-up questions in the same session
Next Steps
Congratulations! 🎉 You've created your first Zypher Agent. Here's what to explore next:
Learn the Fundamentals
- LLM Providers - Configure different AI models
- Tools & MCP - Built-in tools and external integrations
- Checkpoints - Save and restore agent state
Advanced Features
- Loop Interceptors - Control execution flow
- Built-in Tools - File system, terminal, and search tools
Get Inspired
- Basic Research Agent - Complete example with web crawling
- Examples Repository - Ready-to-run examples and starter templates
Ready for more? Check out our examples section or browse the examples repository to see what's possible with Zypher Agent!