ActiveAgents is a Rails application designed to develop and demonstrate the capabilities of Solid Agent and Active Agent, two powerful libraries for leveraging large language models (LLMs) and other AI tools within the Rails ecosystem. This project is part of the activeagent organization.
ActiveAgents serves as a comprehensive platform to showcase the integration and usage of Solid Agent and Active Agent. The application provides examples, documentation, and a demo environment to help developers understand how to effectively utilize these libraries in their own Rails applications.
- ActiveAgents (
activeagent/activeagents
): The primary Rails application for development and demonstration purposes. - Solid Agent (
activeagent/solid_agent
): A library for building robust agents with support for multiple LLMs. - Active Agent (
activeagent/activeagent
): A Rails plugin that simplifies the creation and management of agents, with support for asynchronous operations and generative adapters.
- Multi-LLM Support: Integrate with various large language models through centralized configuration.
- Agent Framework: Define agents with a common interface and implement custom logic for different tasks.
- Extensible Design: Easily add new generative adapters to support additional LLMs.
- Asynchronous Operations: Use
operate_later
andoperate_later!
to queue tasks for background processing. - Configuration Management: Load and manage configurations for different LLMs from
config/
directory. - Job Integration: Seamlessly integrate with ActiveJob for scheduling and executing tasks asynchronously.
- Ruby on Rails (version 6.0 or higher)
- PostgreSQL (for database)
- Redis (for background job processing)
-
Clone the repository:
git clone https://github.com/activeagent/activeagents.git cd activeagents
-
Install dependencies:
bundle install yarn install
-
Set up the database:
rails db:setup
-
Start the server:
rails server
-
Visit the application: Open your browser and navigate to
http://localhost:3000
Configure the available generative adapters and other settings in config/application.rb
or config/initializers/active_agent.rb
. Load specific configurations for each LLM in the config/
directory (e.g., chatgpt.yml
, gemini.yml
).
Define and use agents in your Rails application as follows:
BaseAgent Class
class BaseAgent << SolidAgent::
def operate
# Define synchronous operation logic here
end
def operate_later
# Queue the operation for background processing
end
def operate_later!
# Queue the operation for background processing with higher priority
end
end
ContentFilterAgent Class
class ContentFilterAgent < BaseAgent
def operate
# Define content filtering logic using LLM here
end
end
Job Class for Asynchronous Operations
class AgentJob < ApplicationJob
queue_as :default
def perform(agent_class, *args)
agent_class.constantize.new(*args).operate
end
end
We welcome contributions to improve ActiveAgents, Solid Agent, and Active Agent. To contribute, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/your-feature-name
- Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, feel free to open an issue or contact us at contact@activeagent.org.
Happy coding! 🚀