Skip to content

Building AI agents, atomically

Add public codebase map + enable codebase-mapper

Eigenwise0b5d3016f43d
diff --git a/.claude/.codebase-info/.map-state.json b/.claude/.codebase-info/.map-state.json
new file mode 100644
index 0000000..b836798
--- /dev/null
+++ b/.claude/.codebase-info/.map-state.json
@@ -0,0 +1,18 @@
+{
+ "tool": "codebase-mapper",
+ "version": "2.0.0",
+ "mappedAt": "2026-06-13",
+ "gitCommit": "3d33e62f2b6796b7259c1e3e5d77c4313a56f22d",
+ "documents": [
+ "architecture.md",
+ "tech-landscape.md",
+ "directory-structure.md",
+ "entry-points.md",
+ "modules.md",
+ "communication.md",
+ "dependencies.md",
+ "patterns.md",
+ "coding-style.md",
+ "onboarding.md"
+ ]
+}
diff --git a/.claude/.codebase-info/INDEX.md b/.claude/.codebase-info/INDEX.md
new file mode 100644
index 0000000..7274c31
--- /dev/null
+++ b/.claude/.codebase-info/INDEX.md
@@ -0,0 +1,41 @@
+# Codebase Map — Atomic Agents
+
+*Last Updated: 2026-06-13*
+
+Atomic Agents is a lightweight, modular Python framework for building agentic AI applications as
+composable, schema-driven building blocks (built on Instructor + Pydantic). This repository is a
+`uv`-workspace **monorepo**: the core framework, a TUI tool installer, a tool library, and examples.
+
+**Stack:** Python ≥3.12 · Instructor · Pydantic v2 · LiteLLM · MCP · Textual · uv + Hatchling
+**Shape:** Monorepo — `atomic-agents/` (core lib) · `atomic-assembler/` (CLI) · `atomic-forge/` (tools) · `atomic-examples/` (examples)
+**Package:** `atomic-agents` v2.8.1 on PyPI · core import package is `atomic_agents`
+
+## Documents
+
+| Document | What's inside |
+|----------|---------------|
+| [architecture.md](./architecture.md) | Framework + monorepo architecture, the agent run lifecycle |
+| [tech-landscape.md](./tech-landscape.md) | Languages, libraries, build/release, infra |
+| [directory-structure.md](./directory-structure.md) | Annotated monorepo tree |
+| [entry-points.md](./entry-points.md) | Library API, the `atomic` CLI, examples |
+| [modules.md](./modules.md) | Core package modules + the monorepo subprojects |
+| [communication.md](./communication.md) | LLM providers, MCP, hooks, tool fetching |
+| [dependencies.md](./dependencies.md) | Categorized packages |
+| [patterns.md](./patterns.md) | Atomicity, schema-driven I/O, context providers, testing |
+| [coding-style.md](./coding-style.md) | Formatting, linting, naming conventions |
+| [onboarding.md](./onboarding.md) | Setup with uv, tests, docs, common tasks |
+
+## How to use this map
+
+- New here? Read `onboarding.md`, then `architecture.md`.
+- Building or maintaining an agent? `patterns.md` + `modules.md` + `entry-points.md`.
+- Adding a tool? `modules.md` (atomic-forge section) + `patterns.md`.
+- The project's own design *philosophy* lives in `AGENTS.md` at the repo root (imported by
+ `CLAUDE.md`); this map is its structural, navigational complement.
+
+## Keeping this map current
+
+After changes to the framework's public API, the monorepo layout, dependencies, the agent
+run/context pipeline, MCP/provider integration, or the forge tool set, refresh the affected docs with
+`/codebase-mapper:update-codebase-map`. (There are intentionally no `database.md` or `docker.md`
+docs — the framework has neither.)
diff --git a/.claude/.codebase-info/architecture.md b/.claude/.codebase-info/architecture.md
new file mode 100644
index 0000000..e36947a
--- /dev/null
+++ b/.claude/.codebase-info/architecture.md
@@ -0,0 +1,81 @@
+# Architecture
+
+*Last Updated: 2026-06-13*
+
+## Summary
+
+Atomic Agents builds agentic AI applications out of small, single-purpose, composable parts. Its
+central idea — "atomicity" — is that an agent is essentially a typed function: a Pydantic **input
+schema** in, a Pydantic **output schema** out, with the LLM call mediated by the
+[Instructor](https://github.com/instructor-ai/instructor) library so structured outputs work across
+providers (OpenAI, Anthropic, Gemini, and anything LiteLLM supports). There are no hidden
+abstractions: the developer controls the system prompt, the conversation history, and the schemas.
+
+The repository is a **monorepo** managed as a `uv` workspace with four parts:
+
+- **`atomic-agents/`** — the core framework (PyPI package `atomic-agents`, imported as `atomic_agents`).
+- **`atomic-assembler/`** — a Textual TUI (the `atomic` command) that downloads tools from the forge
+ into a user's project.
+- **`atomic-forge/`** — a library of 13 standalone, copy-into-your-project tools.
+- **`atomic-examples/`** — 15 runnable example applications.
+
+## High-Level Flow
+
+```
+Agent run (atomic_agents core):
+
+ input schema ─┐
+ ▼
+ SystemPromptGenerator (+ context providers) ──► system message ─┐
+ ChatHistory (typed Messages, multimodal, token-trimmed) ─► msgs ┤
+ ▼
+ instructor → client.chat.completions.create(response_model=Out)
+ │
+ LLM provider (OpenAI / Anthropic / Gemini / LiteLLM …)
+ │
+ validated Out (Pydantic) ◄────────────┘
+ ├──► appended to ChatHistory
+ └──► returned to caller
+
+Tool install (atomic-assembler TUI):
+ `atomic` → clone github.com/eigenwise/atomic-agents → copy atomic-forge/tools/<tool> → user project
+```
+
+## Components
+
+| Component | Path | Responsibility |
+|-----------|------|----------------|
+| Core agent | `atomic-agents/atomic_agents/agents/atomic_agent.py` | `AtomicAgent`, `AgentConfig`, run / stream / async methods |
+| Base contracts | `atomic-agents/atomic_agents/base/` | `BaseIOSchema`, `BaseTool`, `BaseToolConfig`, `BaseResource`, `BasePrompt` |
+| Context | `atomic-agents/atomic_agents/context/` | `SystemPromptGenerator`, `BaseDynamicContextProvider`, `ChatHistory` |
+| Connectors | `atomic-agents/atomic_agents/connectors/mcp/` | Model Context Protocol tools / resources / prompts |
+| Utils | `atomic-agents/atomic_agents/utils/` | Token counting (LiteLLM), tool-message formatting |
+| Assembler (CLI) | `atomic-assembler/atomic_assembler/` | Textual TUI to fetch/install forge tools |
+| Forge (tools) | `atomic-forge/tools/` | 13 standalone tools, each `BaseTool`-based |
+
+## The Agent Run Lifecycle
+
+1. The caller wraps an LLM client with Instructor (e.g. `instructor.from_openai(OpenAI())`) and builds
+ an `AgentConfig`, then instantiates `AtomicAgent[InputSchema, OutputSchema](config)`.
+2. On `run(input)`, the `SystemPromptGenerator` assembles the system message from
+ background / steps / output-instructions plus any registered **context providers** (evaluated live
+ at call time).
+3. The `ChatHistory` (typed `Message`s, multimodal-aware) is serialized into the provider message
+ list; oldest *turns* are trimmed to respect `max_context_tokens`.
+4. `client.chat.completions.create(response_model=output_schema)` performs the structured LLM call via
+ Instructor. Streaming and async variants exist: `run_stream`, `run_async`, `run_async_stream`.
+5. The validated output schema is appended to history and returned. Instructor **hooks**
+ (`parse:error`, `completion:kwargs`, `completion:response`, …) provide observability and retry.
+
+## Key Decisions & Constraints
+
+- **Schema-first, no magic.** Every input/output subclasses `BaseIOSchema` (Pydantic); a non-empty
+ docstring is required and used as the schema's description.
+- **Provider-agnostic.** Instructor + LiteLLM mean any supported model works; the agent never
+ hardcodes a provider. (Gemini quirk: pass `assistant_role="model"`.)
+- **Python ≥3.12** — uses PEP 695 generic syntax (`AtomicAgent[In, Out]`).
+- **Tools are not a dependency.** Forge tools are *copied* into the user's repo (full control, no
+ version lock-in) by the assembler, rather than pip-installed.
+- **No database and no containers** in the framework itself.
+- **v2 was a breaking change** from v1 — see `UPGRADE_DOC.md` (`BaseAgent`→`AtomicAgent`,
+ `AgentMemory`→`ChatHistory`, flattened imports, schemas moved to generic type parameters).
diff --git a/.claude/.codebase-info/coding-style.md b/.claude/.codebase-info/coding-style.md
new file mode 100644
index 0000000..2d30cfd
--- /dev/null
+++ b/.claude/.codebase-info/coding-style.md
@@ -0,0 +1,28 @@
+# Coding Style
+
+*Last Updated: 2026-06-13*
+
+## Tooling
+- **Formatter:** Black, line length **127** (`[tool.black]` in `pyproject.toml`; also a pre-commit hook).
+- **Linter:** Flake8 — `.flake8` sets `max-line-length = 150`, `max-complexity = 10`, ignores
+ `E203, W293, W503`, and excludes `.venv/venv/__pycache__/build/dist`. (The pre-commit Flake8 hook
+ passes `--max-line-length=127` to align with Black.)
+- **Pre-commit** (`.pre-commit-config.yaml`): trailing-whitespace, end-of-file-fixer, check-yaml,
+ check-added-large-files, Black, Flake8.
+- **CI** runs `black --check` and `flake8` across all four subprojects (`code-quality.yml`).
+
+## Conventions
+| Kind | Convention | Example |
+|------|------------|---------|
+| Modules / files | `snake_case.py` | `atomic_agent.py`, `system_prompt_generator.py` |
+| Packages | `snake_case` | `atomic_agents`, `atomic_assembler` |
+| Classes | `PascalCase` | `AtomicAgent`, `SystemPromptGenerator` |
+| Functions / vars | `snake_case` | `register_context_provider`, `max_context_tokens` |
+| I/O schemas | `<Thing>InputSchema` / `<Thing>OutputSchema` | `BasicChatInputSchema` |
+| Tools / configs | `<Thing>Tool` / `<Thing>ToolConfig` | `CalculatorTool`, `CalculatorToolConfig` |
+
+## Notes
+- Target **Python ≥3.12**; use PEP 695 generics (`class AtomicAgent[In, Out]`, `AtomicAgent[A, B](...)`).
+- Every `BaseIOSchema` subclass **must** have a docstring — it becomes the schema's description and is
+ validated at class-definition time.
+- Prefer explicit configuration objects over hidden globals.
diff --git a/.claude/.codebase-info/communication.md b/.claude/.codebase-info/communication.md
new file mode 100644
index 0000000..2c86b2b
--- /dev/null
+++ b/.claude/.codebase-info/communication.md
@@ -0,0 +1,37 @@
+# Communication & Integrations
+
+*Last Updated: 2026-06-13*
+
+The framework exposes no HTTP API of its own; "communication" here means how it talks to LLM
+providers and external tools.
+
+## LLM providers (via Instructor)
+- All model calls go through an **Instructor-wrapped client** the caller supplies
+ (`instructor.from_openai(...)`, `from_anthropic(...)`, etc.). The agent calls
+ `client.chat.completions.create(response_model=OutputSchema)` (and `create_partial` for streaming).
+- Provider-agnostic: OpenAI, Anthropic, Google Gemini, MiniMax, and 100+ models via LiteLLM. Mode is
+ configurable (`Mode.TOOLS` is the default).
+- Provider quirks live in `AgentConfig`: `system_role`, `assistant_role` (use `"model"` for Gemini),
+ `tool_result_role` (auto-detected).
+- Code: `atomic-agents/atomic_agents/agents/atomic_agent.py`.
+
+## Token accounting (via LiteLLM)
+- `atomic-agents/atomic_agents/utils/token_counter.py` uses LiteLLM's `token_counter` for
+ provider-agnostic counts, which drive the context-window trimming in `AtomicAgent`.
+
+## MCP — Model Context Protocol
+- `atomic-agents/atomic_agents/connectors/mcp/` turns MCP server capabilities into agent
+ tools/resources/prompts: `MCPFactory`, `MCPDefinitionService`, `SchemaTransformer`, and
+ `fetch_mcp_tools` / `fetch_mcp_resources` / `fetch_mcp_prompts` (sync + async). See the
+ `mcp-agent` and `progressive-disclosure` examples.
+
+## Hooks / observability
+- Built on Instructor's hook system: `register_hook(event, handler)`, `unregister_hook`,
+ `clear_hooks`. Events include `parse:error`, `completion:kwargs`, `completion:response`,
+ `token:counted`. See the `hooks-example` example and `docs/guides/hooks.md`.
+
+## Assembler ↔ GitHub
+- `atomic-assembler` clones `https://github.com/eigenwise/atomic-agents.git` (via GitPython), reads
+ `atomic-forge/tools/`, and copies the chosen tool into the user's project (skipping build files).
+ Source URL and paths are in `atomic-assembler/atomic_assembler/constants.py` and `utils.py`
+ (`GithubRepoCloner`, `AtomicToolManager`).
diff --git a/.claude/.codebase-info/dependencies.md b/.claude/.codebase-info/dependencies.md
new file mode 100644
index 0000000..0eba7a8
--- /dev/null
+++ b/.claude/.codebase-info/dependencies.md
@@ -0,0 +1,44 @@
+# Dependencies
+
+*Last Updated: 2026-06-13*
+
+Declared in `pyproject.toml` (Hatchling build, `uv` workspace; versions locked in `uv.lock`).
+
+## Runtime — core
+| Package | Purpose |
+|---------|---------|
+| instructor (==1.14.5) | Structured (Pydantic) LLM outputs across providers — the core dependency |
+| pydantic (≥2.11,<3) | Schemas / data validation for all I/O |
+| litellm (≥1.50,<2) | Provider-agnostic token counting & model metadata |
+| rich (≥13.7.1,<14) | Console formatting |
+
+## Runtime — CLI / tooling
+| Package | Purpose |
+|---------|---------|
+| textual (≥5.3,<6) | TUI framework for the `atomic` assembler |
+| mcp[cli] (≥1.6) | Model Context Protocol client + CLI |
+| requests (≥2.32,<3) | HTTP |
+| gitpython (≥3.1.43,<4) | Clone the repo to fetch forge tools |
+| pyyaml (≥6,<7) | Read tool `config.yaml` metadata |
+| pyfiglet (≥1,<2) | ASCII-art banners in the TUI |
+
+## Development
+| Package | Purpose |
+|---------|---------|
+| black (≥24.8,<25) | Formatter (line length 127) |
+| flake8 (≥7.1,<8) | Linter |
+| pre-commit (≥4,<5) | Git hook runner |
+| pytest / pytest-cov / pytest-asyncio | Tests, coverage, async tests |
+| openai (≥2,<3) | Example/test provider client |
+
+## Docs
+`sphinx`, `sphinx-rtd-theme`, `myst-parser`, `sphinx-copybutton`, `sphinx-design`,
+`sphinx-autobuild`, `sphinxcontrib-mermaid`, `pdoc3`, `beautifulsoup4`, `markdownify`.
+
+## Console script
+`atomic = atomic_assembler.main:main` (from `[project.scripts]`).
+
+## Notes
+- `requirements.txt` / `setup.py` are legacy shims; `pyproject.toml` + `uv.lock` are the source of truth.
+- Instructor is pinned exactly (`==1.14.5`); most other deps use compatible ranges.
+- Each `atomic-forge` tool and each `atomic-examples` project declares its **own** dependencies.
diff --git a/.claude/.codebase-info/directory-structure.md b/.claude/.codebase-info/directory-structure.md
new file mode 100644
index 0000000..09585ca
--- /dev/null
+++ b/.claude/.codebase-info/directory-structure.md
@@ -0,0 +1,58 @@
+# Directory Structure
+
+*Last Updated: 2026-06-13*
+
+## Root Layout
+
+```
+atomic-agents/ # repo root (uv workspace)
+├── atomic-agents/ # CORE framework project (PyPI: atomic-agents)
+│ └── atomic_agents/ # import package
+│ ├── agents/ # AtomicAgent, AgentConfig
+│ ├── base/ # BaseIOSchema, BaseTool, BaseResource, BasePrompt
+│ ├── context/ # SystemPromptGenerator, ChatHistory, context providers
+│ ├── connectors/mcp/ # Model Context Protocol integration
+│ └── utils/ # token counter, tool-message formatting
+│ └── tests/ # pytest suite (agents/, base/, context/, connectors/, utils/)
+├── atomic-assembler/ # Textual TUI (`atomic` command) to install forge tools
+│ └── atomic_assembler/ # main.py, app.py, screens/, widgets/, utils.py, constants.py
+├── atomic-forge/ # library of standalone tools (NOT a package)
+│ ├── tools/<tool>/ # one folder per tool: tool/<tool>.py, tests/, pyproject.toml
+│ └── guides/ # tool authoring guides (e.g. tool_structure.md)
+├── atomic-examples/ # 15 runnable example apps (each its own project)
+├── docs/ # Sphinx + MyST documentation (api/, guides/, examples/)
+├── guides/ # DEV_GUIDE.md and contributor guides
+├── scripts/ # sync_version.py, generate_llms_files.py
+├── pyproject.toml # package metadata, deps, [tool.black], uv workspace
+├── build_and_deploy.ps1 # version bump + uv build/publish
+├── AGENTS.md # the project's own design philosophy (imported by CLAUDE.md)
+└── README.md
+```
+
+## Key Directories
+
+### `atomic-agents/atomic_agents/` (core)
+The framework itself. `agents/atomic_agent.py` is the heart (`AtomicAgent`). `base/` holds the
+Pydantic-based contracts every agent/tool/resource/prompt implements. `context/` assembles system
+prompts and stores conversation history. `connectors/mcp/` bridges to MCP servers. `utils/` does
+token accounting via LiteLLM.
+
+### `atomic-assembler/atomic_assembler/`
+A Textual terminal UI launched by the `atomic` command (`main.py:main`). `app.py` routes between
+`screens/` (main menu, tool explorer, file picker, README viewer); `utils.py` clones the GitHub repo
+and copies a selected tool into the user's project.
+
+### `atomic-forge/tools/`
+13 self-contained tools (`arxiv_search`, `calculator`, `tavily_search`, `weather`,
+`webpage_scraper`, `wikipedia_search`, …). Each tool folder contains `tool/<name>.py` (Input/Output
+`BaseIOSchema` + a `BaseToolConfig` + a `BaseTool` subclass), `tests/`, and its own
+`pyproject.toml`/`requirements.txt`. Tools are copied into user projects, not pip-installed.
+
+### `atomic-examples/`
+15 standalone example apps (`quickstart`, `rag-chatbot`, `deep-research`, `web-search-agent`,
+`mcp-agent`, `fastapi-memory`, `youtube-summarizer`, …), each with its own `pyproject.toml`. These
+are excluded from the workspace build.
+
+### `docs/` and `guides/`
+`docs/` is a Sphinx + MyST site (`api/` reference, `guides/`, `examples/`, `conf.py`), deployed to
+GitHub Pages. `guides/DEV_GUIDE.md` is the contributor setup/workflow guide.
diff --git a/.claude/.codebase-info/entry-points.md b/.claude/.codebase-info/entry-points.md
new file mode 100644
index 0000000..8dbf194
--- /dev/null
+++ b/.claude/.codebase-info/entry-points.md
@@ -0,0 +1,58 @@
+# Entry Points
+
+*Last Updated: 2026-06-13*
+
+## 1. Library API (the primary entry point)
+
+```python
+from atomic_agents import AtomicAgent, AgentConfig, BasicChatInputSchema, BasicChatOutputSchema
+import instructor
+from openai import OpenAI
+
+agent = AtomicAgent[BasicChatInputSchema, BasicChatOutputSchema](
+ AgentConfig(client=instructor.from_openai(OpenAI()), model="gpt-5-mini")
+)
+result = agent.run(BasicChatInputSchema(chat_message="Hello"))
+```
+
+- **Module:** `atomic-agents/atomic_agents/agents/atomic_agent.py`
+- **Run methods:** `run`, `run_stream`, `run_async`, `run_async_stream`.
+- Custom agents define their own `BaseIOSchema` subclasses and pass them as `AtomicAgent[In, Out]`.
+
+## 2. CLI — `atomic`
+
+| Entry | Type | Purpose | File |
+|-------|------|---------|------|
+| `atomic` | Textual TUI | Browse & install forge tools into a project | `atomic-assembler/atomic_assembler/main.py:main` |
+
+Declared in `pyproject.toml` (`[project.scripts] atomic = "atomic_assembler.main:main"`). Flags:
+`--enable-logging`, `--version`.
+
+## 3. MCP
+
+MCP server tools/resources/prompts become agent components via `atomic_agents.connectors.mcp`
+(`fetch_mcp_tools(...)`, `MCPFactory`). See `communication.md`.
+
+## 4. Examples (each runnable on its own, under `atomic-examples/<name>/`)
+
+| Example | Demonstrates |
+|---------|--------------|
+| `quickstart` | basic chatbot, custom schema, multi-provider (4 scripts) |
+| `rag-chatbot` | retrieval-augmented generation |
+| `web-search-agent` | query generation + web search + answer |
+| `deep-research` | a pipeline of single-purpose agents |
+| `orchestration-agent` | choosing between search / calculator tools |
+| `mcp-agent` | MCP client/server, multiple transports |
+| `progressive-disclosure` | efficient MCP tool loading (3 servers, 24 tools) |
+| `fastapi-memory` | multi-user / multi-session memory behind a FastAPI service |
+| `hooks-example` | monitoring, error handling, retry via hooks |
+| `basic-multimodal` / `nested-multimodal` | images / PDFs in (nested) schemas |
+| `basic-pdf-analysis` | PDF analysis with a multimodal model |
+| `youtube-summarizer` / `youtube-to-recipe` | transcript → summary / structured recipe |
+| `dspy-integration` | combining DSPy with Atomic Agents |
+
+## Representative Flow
+
+`agent.run(input)` → `SystemPromptGenerator.generate_prompt()` (+ context providers) → serialize
+`ChatHistory` → `instructor` `client.chat.completions.create(response_model=Out)` → validated `Out`
+appended to history → returned. See `architecture.md`.
diff --git a/.claude/.codebase-info/modules.md b/.claude/.codebase-info/modules.md
new file mode 100644
index 0000000..b335683
--- /dev/null
+++ b/.claude/.codebase-info/modules.md
@@ -0,0 +1,61 @@
+# Key Modules
+
+*Last Updated: 2026-06-13*
+
+## Core framework — `atomic-agents/atomic_agents/`
+
+### agents
+- **Location:** `atomic-agents/atomic_agents/agents/atomic_agent.py`
+- **Purpose:** The `AtomicAgent[InputSchema, OutputSchema]` class and `AgentConfig`. Orchestrates the
+ run lifecycle (sync / stream / async), context-provider registration, hook registration, and
+ context-window trimming.
+- **Exposes:** `AtomicAgent`, `AgentConfig`, `BasicChatInputSchema`, `BasicChatOutputSchema`.
+- **Depends on:** `base/`, `context/`, `utils/`, `instructor`.
+
+### base
+- **Location:** `atomic-agents/atomic_agents/base/`
+- **Purpose:** The typed contracts everything else implements.
+- **Key files:** `base_io_schema.py` (`BaseIOSchema` — Pydantic base; non-empty docstring enforced and
+ used as the schema description), `base_tool.py` (`BaseTool[In, Out]`, `BaseToolConfig`),
+ `base_resource.py` (`BaseResource`), `base_prompt.py` (`BasePrompt`).
+- **Exposes via package root:** `BaseIOSchema`, `BaseTool`, `BaseToolConfig`.
+
+### context
+- **Location:** `atomic-agents/atomic_agents/context/`
+- **Purpose:** System-prompt assembly and conversation memory.
+- **Key files:** `system_prompt_generator.py` (`SystemPromptGenerator`, `BaseDynamicContextProvider`),
+ `chat_history.py` (`ChatHistory`, `Message` — multimodal Image/Audio/PDF, turn grouping,
+ `dump()`/`load()` serialization).
+
+### connectors/mcp
+- **Location:** `atomic-agents/atomic_agents/connectors/mcp/`
+- **Purpose:** Model Context Protocol integration — expose MCP server tools/resources/prompts as
+ Atomic Agents components.
+- **Exposes:** `MCPFactory`, `MCPDefinitionService`, `SchemaTransformer`,
+ `fetch_mcp_tools` / `fetch_mcp_resources` / `fetch_mcp_prompts` (sync + async).
+
+### utils
+- **Location:** `atomic-agents/atomic_agents/utils/`
+- **Key files:** `token_counter.py` (`TokenCounter` via LiteLLM; `get_context_token_count`),
+ `format_tool_message.py`.
+
+## Subprojects
+
+### atomic-assembler (CLI)
+- **Location:** `atomic-assembler/atomic_assembler/`
+- **Purpose:** Textual TUI to browse and install forge tools into a user project.
+- **Key files:** `main.py` (`main()`; argparse `--enable-logging`, `--version`), `app.py`
+ (`AtomicAssembler(App)`), `screens/` (`main_menu`, `atomic_tool_explorer`, `file_explorer`,
+ `tool_info_screen`), `widgets/`, `utils.py` (`GithubRepoCloner`, `AtomicToolManager`),
+ `constants.py` (GitHub URL, `TOOLS_SUBFOLDER`).
+
+### atomic-forge (tools)
+- **Location:** `atomic-forge/tools/`
+- **Purpose:** 13 standalone tools, each an independent mini-project following the `BaseTool` pattern,
+ copied into user projects by the assembler (build files such as `pyproject.toml` / `requirements.txt`
+ / `uv.lock` are skipped on copy).
+- **Authoring guide:** `atomic-forge/guides/tool_structure.md`.
+
+### atomic-examples
+- **Location:** `atomic-examples/`
+- **Purpose:** 15 runnable reference apps. Catalog in `entry-points.md`.
diff --git a/.claude/.codebase-info/onboarding.md b/.claude/.codebase-info/onboarding.md
new file mode 100644
index 0000000..46c12ea
--- /dev/null
+++ b/.claude/.codebase-info/onboarding.md
@@ -0,0 +1,44 @@
+# Onboarding
+
+*Last Updated: 2026-06-13*
+
+## Prerequisites
+- Python **≥3.12**
+- [`uv`](https://docs.astral.sh/uv/) — package & workspace manager
+- An LLM API key for whatever provider you use (e.g. `OPENAI_API_KEY`); a repo-level `.env` is supported.
+
+## Quick start
+```bash
+git clone https://github.com/eigenwise/atomic-agents.git
+cd atomic-agents
+uv sync # install the whole workspace (core + assembler + dev deps)
+# add your API key(s) to a .env file
+```
+Examples are standalone projects — `cd atomic-examples/<name>` and follow that example's README to run
+it. To launch the tool-installer TUI: `uv run atomic` (or `atomic` once it's on your PATH).
+
+## Common commands
+| Command | Purpose |
+|---------|---------|
+| `uv sync` | Install/update all workspace dependencies |
+| `uv run pytest --cov=atomic_agents atomic-agents` | Run the core test suite with coverage |
+| `uv run black --check atomic-agents atomic-assembler atomic-examples atomic-forge` | Format check |
+| `uv run flake8 --extend-exclude=.venv atomic-agents atomic-assembler atomic-examples atomic-forge` | Lint |
+| `cd docs && uv run make html` | Build the Sphinx docs |
+| `./build_and_deploy.ps1 patch --dry` | Dry-run a release (version bump + build) |
+
+## Common tasks
+- **Build a new agent:** define input/output `BaseIOSchema` subclasses, wrap an LLM client with
+ Instructor, pass it to `AtomicAgent[In, Out](AgentConfig(...))`. See `patterns.md` + `entry-points.md`.
+- **Add a forge tool:** create `atomic-forge/tools/<name>/` following
+ `atomic-forge/guides/tool_structure.md` (input/output schemas, `BaseToolConfig`, a `BaseTool`
+ subclass, `tests/`).
+- **Add an example:** create `atomic-examples/<name>/` with its own `pyproject.toml`.
+- **Release:** `build_and_deploy.ps1 <major|minor|patch>` (needs `PYPI_TOKEN`).
+
+## Gotchas
+- The LLM client must be **Instructor-wrapped** before it goes into `AgentConfig`.
+- For Gemini, set `assistant_role="model"` in `AgentConfig`.
+- `__version__` is read from installed package metadata (`importlib.metadata`) — it reflects the
+ installed build, not a hardcoded constant.
+- Migrating from v1? See `UPGRADE_DOC.md` (renamed classes, flattened imports, schemas as generics).
diff --git a/.claude/.codebase-info/patterns.md b/.claude/.codebase-info/patterns.md
new file mode 100644
index 0000000..7267dc0
--- /dev/null
+++ b/.claude/.codebase-info/patterns.md
@@ -0,0 +1,45 @@
+# Patterns & Conventions
+
+*Last Updated: 2026-06-13*
+
+## Atomicity
+Build with small, single-purpose, composable parts ("LEGO blocks"): each agent, tool, and context
+provider does one thing and is reusable. Compose pipelines by feeding one agent's output schema into
+the next's input. See `atomic-examples/deep-research` and `orchestration-agent`.
+
+## Schema-driven I/O
+- Every input and output is a `BaseIOSchema` (Pydantic) subclass with a **required docstring** (used
+ as the LLM-facing description). Naming: `<Thing>InputSchema` / `<Thing>OutputSchema`.
+- Agents are parameterized by schemas via PEP 695 generics: `AtomicAgent[InputSchema, OutputSchema]`.
+- Structured output is enforced by Instructor through `response_model=OutputSchema`.
+
+## Dynamic system prompts (context providers)
+- `SystemPromptGenerator(background=[...], steps=[...], output_instructions=[...], context_providers={...})`.
+- A `BaseDynamicContextProvider` injects live data (retrieved docs, current date, search results) into
+ the system prompt at call time. Register via `agent.register_context_provider(name, provider)`.
+
+## Tools
+- A tool is a `BaseTool[InputSchema, OutputSchema]` with a `run(params) -> OutputSchema` method and an
+ optional `BaseToolConfig` (override `title`/`description` to disambiguate similar tools).
+- Forge tool layout (`atomic-forge/guides/tool_structure.md`): imports → input schema → output
+ schema(s) → config → tool class + logic → example usage.
+
+## Memory
+- `ChatHistory` stores typed `Message`s grouped into turns (a user+assistant pair shares a `turn_id`),
+ is multimodal-aware (Image/Audio/PDF), and supports `dump()`/`load()`. `AtomicAgent` trims the
+ oldest whole turns to honor `max_context_tokens`.
+
+## Error handling & retries
+- Lean on Instructor's validation/retry of structured outputs, plus hook events (`parse:error`, …)
+ for observability. See `docs/guides/error-handling.md` and `docs/guides/hooks.md`.
+
+## Testing
+- `pytest` (+ `pytest-asyncio` for async, `pytest-cov` for coverage), with `unittest.mock` for LLM
+ clients. Core tests in `atomic-agents/tests/` mirror the package layout (`agents/`, `base/`,
+ `context/`, `connectors/mcp/`, `utils/`). Discovery (`pytest.ini`): files `test_*.py`, classes
+ `Test*`, functions `test_*`.
+
+## Configuration
+- Runtime config is explicit via `AgentConfig` (client, model, history, roles, mode,
+ `model_api_parameters`, `max_context_tokens`) — no global state. Secrets (API keys) come from the
+ environment / `.env`.
diff --git a/.claude/.codebase-info/tech-landscape.md b/.claude/.codebase-info/tech-landscape.md
new file mode 100644
index 0000000..ae9bddd
--- /dev/null
+++ b/.claude/.codebase-info/tech-landscape.md
@@ -0,0 +1,46 @@
+# Technology Landscape
+
+*Last Updated: 2026-06-13*
+
+## Source-of-Truth Files
+
+| Information | File |
+|-------------|------|
+| Package metadata, deps, console scripts | `pyproject.toml` |
+| Locked dependency versions | `uv.lock` |
+| Legacy install shims | `setup.py`, `requirements.txt` |
+| Lint | `.flake8` |
+| Format + git hooks | `.pre-commit-config.yaml`, `[tool.black]` in `pyproject.toml` |
+| Tests | `pytest.ini`, `.coveragerc` |
+| CI/CD | `.github/workflows/` |
+| Release | `build_and_deploy.ps1` |
+| Docs build | `docs/conf.py` |
+
+## Stack
+
+| Layer | Technology | Notes |
+|-------|------------|-------|
+| Language | Python ≥3.12 | PEP 695 generics |
+| Structured LLM I/O | Instructor 1.14.5 (pinned) | provider-agnostic structured outputs |
+| Data modeling | Pydantic v2 (≥2.11) | all schemas are Pydantic models |
+| Provider / token utils | LiteLLM (≥1.50) | token counting, model metadata |
+| Tool protocol | MCP — `mcp[cli]` (≥1.6) | Model Context Protocol connectors |
+| TUI | Textual (≥5.3,<6) | the `atomic` assembler UI |
+| Console output | Rich, pyfiglet | |
+| HTTP / Git | requests, GitPython | assembler fetches forge from GitHub |
+| Build backend | Hatchling | `[build-system]` |
+| Workspace / lock / publish | uv | `uv sync` / `uv build` / `uv publish` |
+| Docs | Sphinx + MyST + RTD theme | + `sphinxcontrib-mermaid`, deployed to GitHub Pages |
+
+## Infrastructure
+
+- **CI (GitHub Actions):**
+ - `code-quality.yml` — on push/PR to `main`/`v2.0`: `uv sync`, `black --check`, `flake8`, then
+ `pytest --cov=atomic_agents` across `atomic-agents`, `atomic-assembler`, `atomic-examples`,
+ `atomic-forge`.
+ - `docs.yml` — on push to `main`: build Sphinx docs, run `scripts/sync_version.py` and
+ `scripts/generate_llms_files.py` (produces `llms-*.txt`), deploy to GitHub Pages.
+- **Release:** `build_and_deploy.ps1 <major|minor|patch> [--dry]` bumps the version in
+ `pyproject.toml`, then `uv sync` → `uv build` → `uv publish` (requires a `PYPI_TOKEN`).
+- **Distribution:** PyPI package `atomic-agents`; the `atomic` console script ships with it.
+- **No runtime infrastructure** — no database, no server, no containers. It is a library + CLI.
diff --git a/.claude/settings.json b/.claude/settings.json
new file mode 100644
index 0000000..6e4a19c
--- /dev/null
+++ b/.claude/settings.json
@@ -0,0 +1,13 @@
+{
+ "enabledPlugins": {
+ "codebase-mapper@claude-toolshed": true
+ },
+ "extraKnownMarketplaces": {
+ "claude-toolshed": {
+ "source": {
+ "source": "github",
+ "repo": "Eigenwise/claude-toolshed"
+ }
+ }
+ }
+}
diff --git a/.gitignore b/.gitignore
index 7c8bfc0..4715706 100644
--- a/.gitignore
+++ b/.gitignore
@@ -152,9 +152,12 @@ personal_scripts/
debug.log
# AI tools
-.claude
+.claude/*
!.claude/skills/
!.claude/skills/**
+!.claude/settings.json
+!.claude/.codebase-info/
+!.claude/.codebase-info/**
CLAUDE.md
CLAUDE.local.md
.serena
\ No newline at end of file