AgentForge is a low-code framework that allows developers of all skill levels to create, test, and iterate AI-powered autonomous agents and cognitive architectures seamlessly. In this article, we’ll guide you through the process of setting up AgentForge and creating your first agent. Let’s dive in!
Table of Contents
Features
AgentForge offers an array of powerful functionalities to help you build agents or cognitive architectures effortlessly:
- Customizable Agents: Tailor agents to fit your specific use cases with ease.
- Custom Tools & Actions: Extend functionality by creating custom tools and actions.
- Dynamic Prompt Templates: Utilize flexible prompt templates that adapt to various contexts.
- LLM Agnostic Agents: Run different agents with various LLMs as per your requirements.
- On-The-Fly Prompt Editing: Modify prompts in real-time without restarting the system.
- OpenAI, Google & Anthropic API Support: Seamlessly integrate with popular LLM APIs.
- Open-Source Model Support: Leverage local models through Ollama and LMStudio.
Installation and Quick Start
Setting up AgentForge is simple. Just follow these steps:
- Install AgentForge via pip:
pip install agentforge
- Set Up Environment Variables:
- For OpenAI:
export OPENAI_API_KEY=your-openai-api-key
- For Anthropic:
export ANTHROPIC_API_KEY=your-anthropic-api-key
- For OpenAI:
- Run a Basic Agent:
1. Define the Agent Class
Create a Python file named echo_agent.py in your project root:
from agentforge import Agent class EchoAgent(Agent): pass # The agent_name is automatically set to EchoAgent
2. Create the Prompt Template (EchoAgent.yaml)
Inside the .agentforgeagents directory, create a YAML file named EchoAgent.yaml:
Prompts: System: You are an assistant that echoes the user's input. User: + user_input
3. Write a Script to Run the Agent
Create a separate Python script (e.g., run_agent.py) in your project root:
from echo_agent import EchoAgent # Initialize the agent agent = EchoAgent() # Run the agent with an input message response = agent.run(user_input="Hello, AgentForge!") print(response)
4. Execute the Script
Ensure your virtual environment is activated and run the script:
python run_agent.py
5. Example Response
Assuming the agent is connected to an LLM, the output might be:
Hello, AgentForge!
Note: The actual response will depend on the LLM used and its configuration. This is just a very crude example.
Documentation
The extensive AgentForge documentation is your guide for everything related to this framework:
- Installation Guide: Step-by-step instructions to install AgentForge.
- Prerequisites Guide: Details all pre-installation requirements and dependencies.
- Using AgentForge: Learn how to run agents, create custom agents, and build cognitive architectures with examples.
- Troubleshooting Guide: Find solutions to common issues and platform-specific problems.
Contributing
Your contributions to AgentForge’s development are highly appreciated! Feel free to open issues or submit pull requests with improvements or bug fixes. We also welcome any UI/UX collaborators interested in enhancing the framework.
Contact Us
If you have questions or want to reach out:
- Email: contact@agentforge.net
- Discord: Join our Discord Server
License
This project is licensed under the GNU General Public License v3.0. For more information, see the LICENSE file for more details.
Troubleshooting Ideas
If you’re encountering problems while using AgentForge, consider the following troubleshooting steps:
- Make sure all environment variables are set correctly, particularly API keys.
- Ensure that the versions of Python and dependencies are up to date.
- If your agent is unresponsive, check the connection to the LLM API.
- Review your YAML configuration for any syntax errors.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.