atomic-agents

Eigenwise/atomic-agents

Building AI agents, atomically

6.0k
Stars
513
Forks
9
Open issues
55
Watchers
Python MITLast pushed Jul 5, 2026

Overview

A lightweight and modular framework for building Agentic AI pipelines and applications using LEGO-block like components.

Categories

Tags

Relationships

Integrates with

Alternatives

Related

Similar tools

Install

pip install atomic-agents

README

Atomic Agents

What is Atomic Agents?

The Atomic Agents framework is designed around the concept of atomicity to be an extremely lightweight and modular framework for building Agentic AI pipelines and applications without sacrificing developer experience and maintainability.

Think of it like building AI applications with LEGO blocks - each component (agent, tool, context provider) is:

  • Single-purpose: Does one thing well
  • Reusable: Can be used in multiple pipelines
  • Composable: Easily combines with other components
  • Predictable: Produces consistent, reliable outputs

Built on Instructor and Pydantic, it enables you to create AI applications with the same software engineering principles you already know and love.

NEW: Join our community on Discord at discord.gg/J3W9b5AZJR and our official subreddit at /r/AtomicAgents!

Table of Contents

  • Atomic Agents
    • What is Atomic Agents?
    • Table of Contents
    • Getting Started
      • Installation
      • Quick Example
    • Why Atomic Agents?
    • Core Concepts
      • Anatomy of an Agent
      • Context Providers
      • Chaining Schemas and Agents
    • Examples & Documentation
      • Quickstart Examples
      • Complete Examples
    • 🚀 Version 2.0 Released!
      • Key Changes in v2.0:
      • ⚠️ Upgrading from v1.x
    • Atomic Forge & CLI
      • Running the CLI
    • Project Structure
    • Provider & Model Compatibility
    • Support
    • Contributing
    • License
    • Additional Resources
    • Star History

Getting Started

Installation

To install Atomic Agents, you can use pip:

pip install atomic-agents

Make sure you also install the provider you want to use. Provider SDKs are available as instructor extras:

pip install instructor[groq]        # for Groq
pip install instructor[anthropic]   # for Anthropic
pip install instructor[google-genai] # for Gemini

OpenAI is included by default. For a full list of supported providers, see the Instructor docs.

This also installs the CLI Atomic Assembler, which can be used to download Tools (and soon also Agents and Pipelines).

Quick Example

Here's a quick snippet demonstrating how easy it is to create a powerful agent with Atomic Agents:

from pydantic import Field
from openai import OpenAI
import instructor
from atomic_agents import AtomicAgent, AgentConfig, BasicChatInputSchema, BaseIOSchema
from atomic_agents.context import SystemPromptGenerator, ChatHistory

# Define a custom output schema
class CustomOutputSchema(BaseIOSchema):
    """
    docstring for the custom output schema
    """
    chat_message: str = Field(..., description="The chat message from the agent.")
    suggested_questions: list[str] = Field(..., description="Suggested follow-up questions.")

# Set up the system prompt
system_prompt_generator = SystemPromptGenerator(
    background=["This assistant is knowledgeable, helpful, and suggests follow-up questions."],
    steps=[
        "Analyze the user's input to understand the context and intent.",
        "Formulate a relevant and informative response.",
        "Generate 3 suggested follow-up questions for the user."
    ],
    out