Eigenwise/atomic-agents
Building AI agents, atomically
Atomic Agents – Quick, Jargon‑Light Overview
What it is – A Python library that lets you build agentic AI applications as a set of tiny, single‑purpose components (agents, tools, context providers). Think of each piece as a LEGO brick: you write a small, well‑typed class, then snap it together with others to create a full‑featured chatbot, a RAG system, a web‑search assistant, etc.
Why it matters – Existing agent frameworks often bundle many responsibilities together, making behaviour hard to predict. Atomic Agents enforces:
- Atomicity – each component does one thing and has a clear input‑output schema (via Pydantic).
- Reusability & composability – swap tools or change prompts without rewriting the whole pipeline.
- Predictability – strict schemas guarantee the shape of data flowing between pieces, which is useful for production‑grade reliability.
Core ideas
- System Prompt Generator – builds the prompt that is sent to the LLM, optionally enriched by context providers (e.g., recent search results).
- Input / Output Schemas – Pydantic models that validate what the agent receives and returns.
- Context Providers – plug‑in classes that inject dynamic information into the prompt at runtime.
- Chaining – because schemas line up, the output of one agent can be fed directly into another tool or agent, enabling pipelines such as “generate queries → run web search → summarise”.
How you use it (from the README example)
from atomic_agents import AtomicAgent, AgentConfig, BasicChatInputSchema, BaseIOSchema
from atomic_agents.context import SystemPromptGenerator, ChatHistory
from pydantic import Field
class CustomOutputSchema(BaseIOSchema):
chat_message: str = Field(..., description="The reply")
suggested_questions: list[str] = Field(..., description="Follow‑up ideas")
prompt = SystemPromptGenerator(
background=["You are helpful and suggest follow‑ups."],
steps=["Understand user input.", "Reply concisely.", "Suggest 3 questions."],
output_instructions=["Return a clear answer and three questions."]
)
agent = AtomicAgent[BasicChatInputSchema, CustomOutputSchema](
config=AgentConfig(
client=instructor.from_openai(OpenAI()),
model="gpt-5-mini",
system_prompt_generator=prompt,
history=ChatHistory(),
)
)
resp = agent.run(BasicChatInputSchema(chat_message="Tell me about atomic agents"))
print(resp.chat_message, resp.suggested_questions)
The library handles prompt construction, schema validation, and history management for you.
Tool ecosystem – Atomic Forge – A bundled CLI (atomic) lets you download ready‑made tools (search, calculator, YouTube transcript, PDF reader, etc.). Each tool ships with its own input/output schema, so you can instantly chain them with agents.
Installation & ecosystem
pip install atomic-agents(includes the CLI).- Optional provider extras (
instructor[groq],instructor[anthropic], …) give you access to non‑OpenAI LLMs. - Documentation, Discord, and a subreddit provide community support.
Who should consider it – Python developers building LLM‑driven products who want a clean, type‑safe way to compose agents and tools, especially when they need predictable outputs and easy swapping of components.
All details above are taken directly from the repository’s README; no extra features have been invented.
Related
- Project
- Project
- Project
- Project
- Project