$ show aaif-goose/goose
Goose is an open-source AI agent platform that provides a desktop application (Electron/React), CLI (Rust), and SDK (Python, Kotlin) for interacting with large language models through a unified Agent Client Protocol (ACP). In production, it enables users to define sessions with multiple LLM providers (Anthropic, OpenAI, Google, Azure, Bedrock, local models via MLX/GGUF, and 40+ declarative providers), extend capabilities via MCP servers and built-in platform extensions (shell, image, file editing, code analysis, apps creation), and automate workflows through parameterized recipes. The architecture is a hybrid: a Rust backend handles agent state machine orchestration, tool execution, permission management, and provider abstraction, while an Electron frontend provides a rich chat interface with settings, extension management, scheduling, and MCP apps display. Key entry points include the CLI binary (crates/goose-cli/src/main.rs), the ACP server (crates/goose/src/acp/server/), and the desktop renderer (ui/desktop/src/renderer.tsx). Data flows involve user input → state machine processing → LLM provider calls → tool execution → response streaming back to the UI, with telemetry and cost tracking throughout. External dependencies include OpenAI/Anthropic/Google APIs, MCP servers, Whisper for dictation, and optional services like PostHog and Langfuse for observability.
The LLM identified 4 files worth highlighting for reuse:
Implements a composable state machine for the agent loop using an Operation trait. Each operation (LLM inference, tool calling, compaction, hooks, error handling) is a separate struct implementing `Operation` with `not_applicable()`, `applied()`, and `yielded()` methods. Operations are ordered in a dynamic list, and the machine proceeds through them on each turn. This pattern is cleanly separated from session specifics, making it reusable for any turn-based conversational agent that needs configurable pipelines of processing steps.
An MCP server that auto-generates data visualizations (charts, maps, sankey diagrams, treemaps, etc.) from structured data using embedded JavaScript libraries (D3.js, Chart.js, Leaflet, Mermaid). It detects data structure and selects the best visualization type, renders an HTML file with interactive controls. This is a self-contained MCP server that can be extracted and used with any MCP-compatible agent, solving a common need for AI agents to produce visual outputs from tool results.
Implements a permission store that manages allowed/denied tool calls per extension with fine-grained rules (e.g., allow only specific tools, approve once, approve for session, always deny). Uses a trie-like structure for pattern matching on tool names. This is isolated from the rest of the agent and can be reused by any system that needs to control which tools an AI agent can invoke, with persistent rules and clear approval semantics.
Provides a canonical model registry that maps provider-specific model names to unified model metadata (context window, pricing per token, input/output modalities, release date, cache semantics). Built from JSON data files and supports programmatic lookup, filtering, and cost estimation. This is a reusable data component that any LLM application can adopt to normalize model capabilities and pricing across dozens of providers without hardcoding per-provider logic.