$ show BCG-X-Official/agentkit
AgentKit is a full-stack framework for building constrained, reliable LLM agents, developed by BCG X and now deprecated. The codebase consists of a FastAPI backend (Python 3.10) that orchestrates LangChain-based agents through a meta-agent and a simple router, executing tools like SQL queries, PDF question-answering, visualizations, image generation, and summarization. The Next.js 14 frontend provides a conversational chat interface with streaming responses, tool action rendering, and configurable UI components. The application is Dockerized with PostgreSQL, Redis, Minio, and Caddy, and supports optional features such as user authentication (NextAuth), feedback collection (LangSmith), and Celery-based background tasks. The architecture is monolithic in code but service-oriented in deployment, with configuration-driven agent behavior via YAML files. While the codebase demonstrates solid engineering patterns (e.g., streaming callbacks, base tool classes, state management), it is explicitly deprecated, relies on outdated LangChain imports and API versions, and requires significant maintenance to be viable for new projects. The repository serves as a reference for building constrained agents but is not recommended for production use without substantial updates.
The LLM identified 4 files worth highlighting for reuse:
Provides an async base class for all tools, handling LLM initialization, prompt formatting, and streaming via a callback system. This pattern decouples tool-specific logic from common execution infrastructure, making it reusable for creating new tools with minimal boilerplate.
Implements AsyncIteratorCallbackHandler, a LangChain callback handler that queues all agent events (tool starts, LLM tokens, errors) as JSON-serializable objects. This enables robust NDXML streaming of agent execution to the frontend and can be extracted for any streaming LLM application.
A React component that toggles between code (SQL, Python), data tables (react-csv), and interactive graphs (Recharts, Plotly) with CSV and PNG download options. This solves the common need to inspect and export tool outputs and is designed to be reusable across different tool types.
Extends PyYAML to support environment variable interpolation and file includes within YAML configuration files. This pattern simplifies managing environment-specific settings and can be reused in any project that uses YAML-based configuration with sensitive or environment-dependent values.