AI Personal Learning
and practical guidance

Atomic Agents: a framework for building lightweight modular AI intelligences

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!


Atomic Agents: a framework for building lightweight modular AI intelligences-1

 

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

  1. Make sure Python 3.11 or later is installed.
  2. Install Atomic Agents using pip:
   pip install atomic-agents
  1. Install providers such as OpenAI and Groq as needed:
   pip install openai groq

Guidelines for use

Creating a Proxy

  1. Defining System Tips: Determine the act and purpose of the agent.
  2. Defining Input Modes: Specifies the structure and validation rules for agent input.
  3. Defining Output Modes: Specifies the structure and validation rules for the agent output.
  4. stored memory: Save dialog history or other relevant data.
  5. 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

  1. Creating a new branch: Create branches for new features or fixes.
   git checkout -b feature-branch
  1. Making code changes: Make changes in the appropriate project directory.
  2. Formatting Code: Use Black formatting code.
   black atomic_agents
  1. code inspection: Code checking with Flake8.
   flake8 atomic_agents
  1. operational test: Ensure that all tests pass.
   pytest --cov atomic_agents
  1. Submit changes: Commit and push to a remote repository.
   git commit -m 'Add some feature'
git push origin feature-branch
  1. Creating a pull request: Create a pull request on GitHub describing the changes and linking to related issues.
AI Easy Learning

The layman's guide to getting started with AI

Help you learn how to utilize AI tools at a low cost and from a zero base.AI, like office software, is an essential skill for everyone. Mastering AI will give you an edge in your job search and half the effort in your future work and studies.

View Details>
May not be reproduced without permission:Chief AI Sharing Circle " Atomic Agents: a framework for building lightweight modular AI intelligences

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish