Skip to content

abhid1234/agent-kit

Repository files navigation

agent-kit

CI npm version License: MIT

TypeScript-first library for building stateful, persistent AI agents.

Live Playground | Blog Post | npm | Docs


Why agent-kit?

Comparison with LangChain, Vercel AI SDK, CrewAI

  • Persistent memory across sessions — SQLite or PostgreSQL. Restart your process; the agent still remembers.
  • Simple tool system — define a tool in 5 lines with Tool.create. No decorators, no class inheritance.
  • Multi-agent coordination — 4 strategies: Sequential, Parallel, Debate, Hierarchical.
  • Built-in observability — subscribe to tool:start, tool:end, memory:save events. No paid add-on.
  • TypeScript-first — strict types throughout. Your editor autocompletes everything.

4 Core Concepts

Agent, Tool, Memory, Team — 4 core concepts

Agent, Tool, Memory, Team — with code examples


Installation

npm install @avee1234/agent-kit

Or scaffold a new project:

npx @avee1234/agent-kit init my-agent

Quick Start

import { Agent, Tool, Memory } from '@avee1234/agent-kit';

const searchTool = Tool.create({
  name: 'web_search',
  description: 'Search the web',
  parameters: { query: { type: 'string' } },
  execute: async ({ query }) => fetch(`https://api.search.com?q=${query}`).then(r => r.json()),
});

const agent = new Agent({
  name: 'research-assistant',
  model: { provider: 'ollama', model: 'llama3' },
  memory: new Memory({ store: 'sqlite' }),
  tools: [searchTool],
  system: 'You are a research assistant.',
});

const response = await agent.chat('Find recent papers on transformers');

No model config required — ships with a built-in MockAdapter for development and testing without API keys.


The "Wow Moment": Memory That Survives Restarts

Agent remembers context across process restarts

Kill the process, restart it, same SQLite file — the agent picks up where it left off.

Short-term → Summarization → Long-term memory pipeline


Multi-Agent Coordination

4 coordination strategies: Sequential, Parallel, Debate, Hierarchical

const team = new Team({
  agents: [researcher, writer, critic],
  strategy: 'debate',
  maxRounds: 3,
});
const result = await team.run('What is the best database for embeddings?');

Built-In Observability

Real-time event stream: tool:start, tool:end, memory

agent.on('*', (e) => console.log(e.type, e.data, e.latencyMs));

No LangSmith, no third-party service. Just EventEmitter — pipe it to whatever you use.


Where Each Tool Shines

Comparison table: LangChain vs Vercel AI SDK vs CrewAI vs agent-kit


Model Configuration

// Mock (zero config, built-in — great for testing)
const agent = new Agent({ name: 'test' });

// Ollama (local models)
const agent = new Agent({ name: 'local', model: { provider: 'ollama', model: 'llama3' } });

// Google AI Studio (Gemini)
const agent = new Agent({
  name: 'gemini',
  model: new OpenAICompatibleAdapter({
    baseURL: 'https://generativelanguage.googleapis.com/v1beta/openai',
    model: 'gemini-2.0-flash',
    apiKey: process.env.GOOGLE_AI_API_KEY,
  }),
});

// Any OpenAI-compatible endpoint (Together, OpenRouter, Groq, etc.)
const agent = new Agent({
  name: 'agent',
  model: new OpenAICompatibleAdapter({ baseURL: '...', model: '...', apiKey: '...' }),
});

Try It Live

Live playground powered by Google Cloud Run and Gemini

www.abhi-agent-kit.space

4 pre-built agents with real-time tool execution, persistent memory, and live event streaming. Powered by Gemini Flash on Google Cloud Run.


What You Can Build

What I'd do differently — lessons learned

  • Travel planner — destination search + weather + flight/hotel booking + budget calculator
  • Research assistant — web search + note-taking + session memory
  • Customer support — order lookup + conversation history
  • Code reviewer — security analysis + style checking
  • Data analyst — SQL queries + chart generation + persistent findings
  • Personal assistant — calendar + email + long-term preferences

Read More

  • Blog Post — the full story of why and how I built agent-kit
  • Documentation — API reference, guides, and examples
  • npmnpm install @avee1234/agent-kit

Contributing

Bug reports and pull requests welcome. Open an issue to discuss changes before submitting a PR.

License

MIT

About

TypeScript-first library for building stateful, persistent AI agents with memory, tool use, and observability

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors