Skip to main content

Hermes is a lightweight, powerful abstraction layer over LlamaIndex that simplifies building production-ready AI agents with essential utilities and multi-agent capabilities.

Project description

Hermes AI Agent Framework

Current Version: 0.3.5

Hermes AI Logo

Python Version LlamaIndex OpenAI License Status

🚀 Smart LlamaIndex Abstraction for AI Agents

🌟 Hermes is a lightweight, powerful abstraction layer over LlamaIndex that simplifies building production-ready AI agents with essential utilities and multi-agent capabilities. 🚀

✨ Features

  • 🛠️ Automatic Tool Integration - Convert Python functions to tools effortlessly
  • 🤖 Multi-Agent Orchestration - Coordinate multiple specialized agents
  • 🧠 Enhanced Prompt Management - Built-in Chain of Thought and context awareness
  • 💬 Smart Memory Management - Automatic chat history handling with configurable limits
  • 🔌 Multi-Provider Support - OpenAI, Azure, Anthropic, and more
  • 📊 Text Processing Utilities - Keyword extraction, formatting, and enhancement

🚀 Quick Start

pip install hermes-ai
import asyncio
from hermes.core import Agent

async def main():
    # Create a simple tool
    def get_weather(location: str) -> str:
        """Get weather information for a location."""
        return f"Weather in {location}: Sunny, 25°C"

    # Initialize your agent
    agent = Agent(
        provider="openai",
        model="gpt-4o-mini",
        name="WeatherAssistant",
        description="Helps with weather information",
        prompt="Provide accurate and helpful weather updates.",
        tools=[get_weather]
    )

    # Execute the agent
    response = await agent.execute(input_data="What's the weather in Tokyo?")
    print(response)

asyncio.run(main())

Output:

Using the weather tool, I can see that the weather in Tokyo is Sunny with a temperature of 25°C. It's a beautiful day!

💬 Simple Chat Example

import asyncio
from hermes.core import Agent

async def main():
    # Initialize agent
    agent = Agent(
        provider="openai",
        model="gpt-4o-mini"
    )
    
    # Ask a question
    response = await agent.execute(input_data="Qual é a capital do Brasil?")
    print(response)
    # Output: A capital do Brasil é Brasília. Ela foi oficialmente 
    # inaugurada em 21 de abril de 1960...

asyncio.run(main())

🌐 Web Interface Example

import asyncio
from hermes.core import Agent
from hermes.web import serve_static_fastapi

async def main():
    agent = Agent(
        provider="openai",
        model="gpt-4o-mini"
    )

    await serve_static_fastapi(port=8000, agent=agent)

if __name__ == "__main__":
    asyncio.run(main())

🔗 Web Interface Repository: Hermes-Web

🖼️ Screenshots Web Interface

Main Interface Main chat interface with conversation history

Tools Used Visualization of tools used by agents

Message Input Message input interface with validation

Loading State Loading indicator during processing

🏗️ Multi-Agent System

import asyncio
from hermes.core import Agent

async def main():
    # Define specialist tools
    def get_market_info(query: str) -> str:
        """Get current market conditions and trends."""
        return "Market is bullish today with major indices up 2%. USD at R$ 5.10."
    
    def calculate_investment(amount: float, period: int) -> str:
        """Calculate investment returns with recommendations."""
        expected_return = amount * (1 + 0.12) ** (period / 12)
        return f"Investment of R$ {amount:,.2f} for {period} months: Expected return R$ {expected_return:,.2f}"
    
    # Create specialized agents
    market_agent = Agent(
        provider="openai",
        model="gpt-4o-mini",
        name="MarketAnalyst",
        description="Expert in market analysis and quotes",
        tools=[get_market_info]
    )

    investment_agent = Agent(
        provider="openai",
        model="gpt-4o-mini",
        name="InvestmentAdvisor", 
        description="Expert in investment planning",
        tools=[calculate_investment]
    )

    # Coordinator agent that delegates to specialists
    coordinator = Agent(
        provider="openai",
        model="gpt-4o-mini",
        name="Coordinator",
        description="Routes questions to appropriate specialists",
        prompt="""Analyze user questions and delegate to the right expert:
        - Market questions → MarketAnalyst
        - Investment questions → InvestmentAdvisor
        - Complex questions → consult both""",
        tools=[market_agent, investment_agent]
    )
    
    # Execute coordinated task
    result = await coordinator.execute(
        input_data="Should I invest R$ 10000 for 12 months? What's the market like?"
    )
    print(result)

asyncio.run(main())

🔧 Core Components

Agent Configuration

Agent(
    provider="openai",           # LLM provider
    model="gpt-4o-mini",        # Model name
    name="Assistant",           # Agent identity
    description="Helpful AI",   # Agent purpose
    prompt="Behavior guidelines", # System prompt
    tools=[function1, function2], # Available tools
    temperature=0.7,            # Creativity control
    max_chat_history_length=20  # Memory management
)

Built-in Utilities

  • Automatic tool conversion from Python functions
  • Enhanced prompt formatting with current context
  • Chat history management with configurable limits
  • Input enhancement with keyword extraction
  • Multi-provider LLM support

📁 Project Structure

hermes/
├── core.py          # Main Agent class
├── utils.py         # Text processing utilities
├── tools.py         # Tool creation helpers
└── providers.py     # LLM provider configurations

🎯 Use Cases

  • Customer Support Agents
  • Multi-Domain Expert Systems
  • Research Assistants
  • Data Analysis Tools
  • Content Generation Systems

🔮 Roadmap

  • Vector database integration
  • Advanced memory backends
  • Streaming responses
  • Plugin system
  • Web interface

💡 Contributing

We welcome contributions! Please see our Contributing Guide for details.

📄 License

MIT License - see LICENSE file for details.


Build intelligent agents faster with Hermes - The messenger of AI capabilities

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes_ai-0.3.5.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_ai-0.3.5-py3-none-any.whl (3.4 MB view details)

Uploaded Python 3

File details

Details for the file hermes_ai-0.3.5.tar.gz.

File metadata

  • Download URL: hermes_ai-0.3.5.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for hermes_ai-0.3.5.tar.gz
Algorithm Hash digest
SHA256 c76f7b878d9944bf227907cc7fa20b9df720fcbe4f456bb77eec6647df920dbe
MD5 5fa0c1c6f8d4fe0c8338ec49fb326523
BLAKE2b-256 995a97ff3e6aa584373cc47b6a89f748906e32deb3eaa9ad7e2031349a61a23a

See more details on using hashes here.

File details

Details for the file hermes_ai-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: hermes_ai-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for hermes_ai-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 feb926353feb36831d0e5b90cc69cddad59428ab140847070b7744c474e9ff9e
MD5 fe487c2c2aa6f73790ddb38bed27b9e5
BLAKE2b-256 df319f96e915a2fa58c29301a1e046e841e2c75acc529c1a67296cb59a7453b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page