Hellm
Installation
Install the gem and add to the application's Gemfile by executing:
bundle add hellm
If bundler is not being used to manage dependencies, install the gem by executing:
gem install hellm
Usage
Create a project-local .hellm directory with agent and skill definitions.
Minimal structure (as used in example/):
.hellm/
agents/
alfred.agent.md
mathematician.agent.md
skills/
farben/
SKILL.md
Set your OpenAI API key in an environment variable named OPENAI_API_KEY or put this variable in a .env file in the working directory:
OPENAI_API_KEY=your_api_key_here
Run an agent by passing the agent name and prompt:
hellm Alfred "Tell me your favorite color and which month fits it."
Builtin Tools
The framework provides the following tools for agents to use:
calculator- a simple calculator for basic arithmetic operations.
Custom Tools
Custom tools can be defined using Langchain::ToolDefinition, like it is described in the Langchain documentation. Such tools need to be registered in Hellm before they can be used by agents:
Hellm::Tools::Registry.instance.add(:calculator) do
Langchain::Tool::Calculator.new
end
The code shows how to get access to the registry and add a custom tool with a unique name. The block is used as factory method to create a new instance of the tool when needed. Instances are created once only and reused for all agents, so do not store any state in the tool instance.
Example
The example in this repository provides a convenience script which runs the example with one call, showcasing the flow of actions taken by the agents:
cd example
./example.sh
Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hellm.
License
The gem is available as open source under the terms of the MIT License.