Building Personal AI Assistant with GitHub Copilot SDK

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:

  • Models: Access Copilot-supported models (Claude, GPT, Gemini, etc.)
  • Bash execution and shell access (bash is all an AI agent needs)
  • Code tools: file viewing, regex search, patch application
  • Web tools: search the web, fetch URLs
  • GitHub integration: issues, PRs, commits, code search via built-in MCP
  • Multiple tool calls within a single reasoning turn
  • User input requests bridged to the transport layer

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:

  • browser: Automate websites with Playwright, store login credentials, take screenshots
  • reminder: Cron-based reminders (once, daily, weekly, monthly, weekdays)
  • job: Schedule recurring AI prompts (e.g., daily summary, weekly review)
  • memory: Read, write, search persistent memory files
  • conversation: Search and retrieve past chat history
  • system: Introspect settings, apply safe config changes, restart Neo

Session features:

  • Per-chat model picker (override default)
  • Layered memory: daily logs, weekly summaries, channel overlays
  • Live progress UI (thinking → reasoning → tool → done)
  • Voice input via Deepgram STT
  • Automatic context compaction when conversations get long
  • Neo can edit its own persona, change log levels, request a restart and everything is recorded in history

How easy is it to build?

Just 3 lines of code to create session:

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

Article content
Neo 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


To view or add a comment, sign in

More articles by Saad B.

Others also viewed

Explore content categories