Kosong: Kimi AI's Agent SDK (github.com)

🤖 AI Summary
Kosong is a new LLM abstraction layer and agent SDK from Kimi AI that standardizes how you build modern AI agents. It provides unified message structures, asynchronous tool orchestration, and pluggable chat providers so you can swap LLM backends without rewriting agent logic. The project aims to reduce vendor lock-in and speed development by offering a consistent API for prompt history, streaming responses, and tool invocation patterns—making it easy to prototype assistants, tool-using agents, and streamed interactions. Technically, Kosong targets Python 3.13+ (uv recommended as package manager) and exposes async primitives: a generate() call with streaming callbacks, a step() primitive that runs an agent step against a typed toolset, and a StepResult/ToolReturnType model for inspecting outputs. It uses pydantic for typed tool parameters (shown with CallableTool2 and SimpleToolset) and ships a Kimi chat provider (example model: kimi-k2-turbo-preview) that accepts base_url and api_key. A local demo agent is included and runnable via environment variables and uv run. For engineers, Kosong’s composable, typed, async approach simplifies building robust, provider-agnostic agents and integrating tools in production or research settings.
Loading comments...
loading comments...