CopilotKit is a comprehensive SDK and framework designed to integrate AI agents into user interfaces across web, mobile, and chat platforms. It functions as a middleware layer connecting frontend UI components (React, Vue, Angular) with backend agent frameworks (LangGraph, CrewAI, PydanticAI, etc.). The core value proposition lies in its ability to synchronize state between the agent and the UI, support generative UI (A2UI) for dynamic component rendering, and facilitate human-in-the-loop workflows. The repository is structured as a monorepo containing core runtime packages, framework-specific adapters, and an extensive suite of integration showcases. The architecture relies on a centralized runtime (`@copilotkit/runtime`) that handles agent connections via SSE and manages tool execution. Frontend interactions are managed through hooks (`useCopilotKit`, `useAgent`) that subscribe to the runtime. The codebase demonstrates a polyglot approach, supporting Python, TypeScript, Java, and C# backends alongside multiple frontend frameworks. While the core SDK is well-structured, the repository exhibits significant code duplication across its 20+ integration showcases, which serve as both documentation and regression tests.