General Introduction
Atomic Agents is an extremely lightweight and modular framework designed around the concept of atomicity for building agent AI pipelines and applications. The framework provides a set of tools and agents that can be combined to create powerful applications. It is built on Instructor and leverages Pydantic for data and pattern validation and serialization. All logic and control flow is written in Python, enabling developers to apply best practices and workflows from traditional software development without sacrificing flexibility or clarity.Atomic Agents is designed to meet the needs of organizations for consistent and reliable outputs through modularity, predictability, scalability, and control.
Recommended Reading:Goodbye LangChain! Atomic Agent is on fire!
Function List
- modularization: Build AI applications by combining small, reusable components.
- predictability: Define clear input and output patterns to ensure consistent behavior.
- scalability: Easily replace components or integrate new ones without destroying the entire system.
- controlling: Fine-tune each part of the system individually, from system tips to tool integration.
- data validation: Data and pattern validation and serialization using Pydantic.
- Python development: All logic and control flow is written in Python for ease of use by developers.
Using Help
Installation process
- Make sure Python 3.11 or later is installed.
- Install Atomic Agents using pip:
pip install atomic-agents
- Install providers such as OpenAI and Groq as needed:
pip install openai groq
Guidelines for use
Creating a Proxy
- Defining System Tips: Determine the act and purpose of the agent.
- Defining Input Modes: Specifies the structure and validation rules for agent input.
- Defining Output Modes: Specifies the structure and validation rules for the agent output.
- stored memory: Save dialog history or other relevant data.
- context provider (computing): Inject dynamic context into the agent's system prompt at runtime.
sample code (computing)
from atomic_agents import Agent, SystemPrompt, InputSchema, OutputSchema
# Define the system prompt
system_prompt = SystemPrompt("You are an AI assistant that helps users solve problems.")
# Define input and output schemas
input_schema = InputSchema({"type": "object", "properties": {"question": {"type": "string"}}})
output_schema = OutputSchema({"type": "object", "properties": {"answer": {"type": "string"}}})
# Create an agent
agent = Agent(system_prompt=system_prompt, input_schema=input_schema, output_schema=output_schema)
# Using the agent
response = agent.run({"question": "What's the weather like today?"})
print(response["answer"])
Development Workflow
- Creating a new branch: Create branches for new features or fixes.
git checkout -b feature-branch
- Making code changes: Make changes in the appropriate project directory.
- Formatting Code: Use Black formatting code.
black atomic_agents
- code inspection: Code checking with Flake8.
flake8 atomic_agents
- operational test: Ensure that all tests pass.
pytest --cov atomic_agents
- Submit changes: Commit and push to a remote repository.
git commit -m 'Add some feature'
git push origin feature-branch
- Creating a pull request: Create a pull request on GitHub describing the changes and linking to related issues.