Building Personal AI Assistant with GitHub Copilot SDK
As OpenClaw is taking over the world (and other claws 🦞), everyone's building their own Claws (personal AI agents) now.
So I built mine: Neo. Neo is a personal AI assistant accessible via Telegram (for now), powered by GitHub Copilot SDK.
Why GitHub Copilot SDK
If you haven't tried the Copilot SDK yet, it really is great! I think it has the best pricing + access to all the frontier models the moment they are released. And DevEx is great, too. And its the same engine behind GitHub Copilot CLI (which is great, too btw).
Under the hood the SDK talks to the Copilot CLI running in server mode over JSON-RPC. The CLI runs the agent runtime (planning, tool calls, model requests).
Here’s what we get out of the box:
Copilot Pricing
GitHub Copilot Pro+ costs $40/month and provides 1500 premium requests per month. At one conversation per day, that's 30-50 requests/month.
For higher usage, bring your own API keys. The SDK supports ANTHROPIC_API_KEY and OPENAI_API_KEY directly.
What Neo Does
Neo runs on Telegram, owner-only. Behind it: the Copilot SDK as a session per chat.
Custom tools I built on top:
Session features:
How easy is it to build?
Just 3 lines of code to create session:
Recommended by LinkedIn
const client = new CopilotClient({ githubToken: process.env.GITHUB_TOKEN });
await client.start();
const session = await client.createSession({ systemMessage, tools, onPermissionRequest });
Few lines for a custom tool with Zod schema validation:
import { defineTool } from "@github/copilot-sdk";
import { z } from "zod";
export const reminderTool = defineTool("reminder", {
description: "Create, list, or cancel reminders",
parameters: z.object({
action: z.enum(["create", "list", "cancel"]),
message: z.string().optional(),
fire_at: z.string().optional(), // ISO 8601 UTC
recurrence: z.enum(["once", "daily", "weekly", "monthly"]).optional(),
id: z.number().optional(),
}),
handler: async (args) => {
return `Reminder created for ${args.fire_at}`;
},
});
That's the whole pattern. The SDK handles streaming, tool loops, retries, context management, and model switching. We listen to session events for progress UI. That's it.
Architecture
One send() call. The SDK orchestrates streaming, tool invocations, and retries. Listeners observe session events for progress UI and surface results to Telegram.
Example: Reminders
User: "remind me to check SDK feature releases on Friday at 4pm"
Agent recognizes intent, calls reminder tool with action: create. Handler schedules it (SQLite with cron metadata). On Friday 4 PM, a job executes the prompt: "It's 4 PM. Remind the user to review feature releases." Telegram message arrives.
What's Next
Personal agents are becoming like dotfiles. Everyone will have one.
Checkout code: github.com/saadjs/neo
References
Happy coding!
#AI #copilot #github #ai-agents #typescript #grammY #telegram #SDK
- Saad
Check out https://github.com/jardhel/batiste