An open API service indexing awesome lists of open source software.

https://github.com/dmitriz/archon-hello-world


https://github.com/dmitriz/archon-hello-world

Last synced: 9 months ago
JSON representation

Awesome Lists containing this project

README

          

# Hello World Agent

A simple AI agent built with [Pydantic AI](https://ai.pydantic.dev/) that demonstrates the basic structure and functionality of an agent created through the [Archon Agent Builder](https://github.com/dmitriz/Archon).

## Overview

This project showcases a minimal AI agent implementation that responds with "Hello, World!" to any user input. It serves as a foundational example for understanding how Pydantic AI agents are structured and can be extended for more complex use cases.

## Features

- **Simple Response Logic**: Always responds with "Hello, World!" regardless of input
- **Async Support**: Built with asynchronous operations for scalability
- **Clean Architecture**: Follows Archon's agent structure with separate files for:
- Agent definition (`agent.py`)
- Tools (`agent_tools.py`)
- Prompts (`agent_prompts.py`)
- Main execution (`main.py`)

## Project Structure

```
archon-hello-world/
├── agent.py # Main agent class definition
├── agent_tools.py # Agent tools (empty for this simple example)
├── agent_prompts.py # Agent prompts (empty for this simple example)
├── main.py # Entry point to run the agent
├── requirements.txt # Python dependencies
├── pyproject.toml # UV project configuration
├── uv.lock # Dependency lock file
└── README.md # This file
```

## Generated by Archon

This agent was generated using the **Archon Agent Builder**, an AI-powered tool that creates complete Pydantic AI agents based on natural language descriptions.

**Original Request**: *"Create a simple hello world agent that just says 'Hello, World!' when asked anything."*

Archon automatically generated:
- Complete agent implementation
- Proper project structure
- Dependencies and configuration
- Documentation and examples

Learn more about Archon at: [Archon Agent Builder](https://github.com/dmitriz/Archon)

## Requirements

- Python 3.11+
- UV package manager (recommended) or pip

## Installation

1. Clone or download this project
2. Install dependencies using UV (recommended):
```bash
uv add pydantic-ai
```

Or using pip:
```bash
pip install -r requirements.txt
```

## Usage

Run the agent interactively:

```bash
python main.py
```

The agent will prompt you to ask anything, and it will respond with "Hello, World!" regardless of your input.

### Example Interaction

```
$ python main.py
Ask anything: What's the weather like?
Hello, World!
```

```
$ python main.py
Ask anything: How are you?
Hello, World!
```

## Code Example

The core agent implementation is straightforward:

```python
from pydantic_ai import Agent

class HelloWorldAgent(Agent):
async def run(self, user_input: str) -> str:
"""Responds with 'Hello, World!' to any input given."""
return "Hello, World!"

hello_world_agent = HelloWorldAgent()
```

## Extending This Agent

This simple agent can be extended by:

1. **Adding Tools**: Implement functions in `agent_tools.py` for external API calls, file operations, etc.
2. **Custom Prompts**: Define system prompts and user message templates in `agent_prompts.py`
3. **Enhanced Logic**: Modify the `run` method to include conditional responses, AI model integration, etc.
4. **State Management**: Add context tracking for multi-turn conversations

## Development

This project uses:
- **Pydantic AI**: For agent framework and validation
- **UV**: For fast Python package management
- **Git**: Version control with feature branch workflow

## License

This project is part of the Archon ecosystem. See the main [Archon repository](https://github.com/dmitriz/Archon) for license information.

## Next Steps

- Try modifying the response in `agent.py`
- Add conditional logic based on user input
- Integrate with external APIs using tools
- Explore more complex agent patterns in the Archon documentation

---

*Generated with ❤️ by Archon Agent Builder*