# ZipAgent

A lightweight Python framework for building an AI agent in a few lines of code, with a tool decorator, streaming output, context management and native Model Context Protocol integration.

ZipAgent is a Python framework for building AI agents with a small, simple API. Its core agent engine, tool system and conversation management are implemented in about 700 lines of code.

A function decorated as a tool becomes callable by the agent, and an Agent is created with a name, instructions and a list of tools, then run through a Runner. Streaming responses expose events for answer text and tool calls as they happen, and a Context object tracks multi-turn conversation history and token usage across a session. ZipAgent also integrates natively with the Model Context Protocol to reach external tools, supports custom model configuration such as pointing at any OpenAI-compatible endpoint, and raises typed errors for cases such as tool execution failures and reaching a maximum number of turns.

It installs from PyPI and is covered by more than 120 test cases.

Website: https://github.com/JiayuXu0/ZipAgent
