Hive
  • Home
  • Modules
    • Agents
    • LLMs (inference)
    • Templates (Prompt Templates)
    • Memory
    • Emitter (Observability)
    • Serialization
    • Tools
    • Cache
    • Logger
    • Version
    • Error Handling
    • SQLTool
Powered by GitBook
On this page
  • Hive Agent Framework
  • Key Features
  • Getting started
  • Roadmap

Home

NextModules

Last updated 5 months ago

Hive Agent Framework

Project Status: Alpha

Key Features

  • 🤖 AI agents: Use our powerful Hive agent refined for Llama 3.1 and Granite 3.0, or build your own.

  • 🛠️ Tools: Use our built-in tools or create your own in Javascript/Python.

  • 👩‍💻 Code interpreter: Run code safely in a sandbox container.

  • 💾 Memory: Multiple strategies to optimize token spend.

  • ⏸️ Serialization Handle complex agentic workflows and easily pause/resume them without losing state.

  • 🔍 Instrumentation: Use Instrumentation based on Emitter to have full visibility of your agent’s inner workings.

  • 🎛️ Production-level control with caching and error handling.

  • 🔁 API: Integrate your agents using an OpenAI-compatible Assistants API and Python SDK.

  • 🖥️ Chat UI: Serve your agent to users in a delightful UI with built-in transparency, explainability, and user controls.

Getting started

Installation

npm install Hive-agent-framework

or

yarn add Hive-agent-framework

Example

import { HiveAgent } from "Hive-agent-framework/agents/Hive/agent";
import { OllamaChatLLM } from "Hive-agent-framework/adapters/ollama/chat";
import { TokenMemory } from "Hive-agent-framework/memory/tokenMemory";
import { DuckDuckGoSearchTool } from "Hive-agent-framework/tools/search/duckDuckGoSearch";
import { OpenMeteoTool } from "Hive-agent-framework/tools/weather/openMeteo";

const llm = new OllamaChatLLM(); // default is llama3.1 (8B), it is recommended to use 70B model

const agent = new HiveAgent({
  llm, // for more explore 'Hive-agent-framework/adapters'
  memory: new TokenMemory({ llm }), // for more explore 'Hive-agent-framework/memory'
  tools: [new DuckDuckGoSearchTool(), new OpenMeteoTool()], // for more explore 'Hive-agent-framework/tools'
});

const response = await agent
  .run({ prompt: "What's the current weather in Las Vegas?" })
  .observe((emitter) => {
    emitter.on("update", async ({ data, update, meta }) => {
      console.log(`Agent (${update.key}) 🤖 : `, update.value);
    });
  });

console.log(`Agent 🤖 : `, response.result.text);

➡️ See a more advanced example.

➡️ you can run this example after local installation, using the command yarn start examples/agents/simple.ts

Local Installation

  1. Clone the repository git clone git@github.com:i-am-Hive/Hive-agent-framework.

  2. Install dependencies yarn install --immutable && yarn prepare.

  3. Create .env (from .env.template) and fill in missing values (if any).

  4. Start the agent yarn run start:Hive (it runs /examples/agents/Hive.ts file).

➡️ All examples can be found in the examples directory.

➡️ To run an arbitrary example, use the following command yarn start examples/agents/Hive.ts (just pass the appropriate path to the desired example).

📦 Modules

The source directory (src) provides numerous modules that one can use.

Name
Description

agents

Base classes defining the common interface for agent.

llms

Base classes defining the common interface for text inference (standard or chat).

template

Prompt Templating system based on Mustache with various improvements.

memory

Various types of memories to use with agent.

tools

Tools that an agent can use.

cache

Preset of different caching approaches that can be used together with tools.

errors

Error classes and helpers to catch errors fast.

adapters

Concrete implementations of given modules for different environments.

logger

Core component for logging all actions within the framework.

serializer

Core component for the ability to serialize/deserialize modules into the serialized format.

version

Constants representing the framework (e.g., latest version)

emitter

Bringing visibility to the system by emitting events.

internals

Modules used by other modules within the framework.

To see more in-depth explanation see overview.

Roadmap

  • Hive agent performance optimization with additional models

  • Examples, tutorials, and docs

  • Improvements to building custom agents

  • Multi-agent orchestration

Open-source framework for building, deploying, and serving powerful agentic workflows at scale.The Hive Agent Framework makes it easy to build scalable agent-based workflows with your model of choice. The framework is Hiven designed to perform robustly with and models, and we're actively working on optimizing its performance with other popular LLMs. Our goal is to empower developers to adopt the latest open-source and proprietary models with minimal changes to their current agent implementation.

IBM Granite
Llama 3.x
Page cover image