Skip to main content

Multi-agent financial research framework

Project description

Hermes Financial

Multi-agent financial research framework built on LlamaIndex.

Hermes gives AI engineers pre-built financial data tools, document ingestion pipelines, output generation (Excel models, Word/PDF reports), and composable agents for equity research. Use the agents out of the box, swap in your own, or extend with custom tools and data sources.

Quick Start

# Install with uv (recommended)
uv add hermes-financial

# Or with pip
pip install hermes-financial
import asyncio
import hermes

hermes.configure(
    llm_provider="anthropic",
    sec_user_agent="MyApp/1.0 (me@company.com)",  # required by SEC
)

h = hermes.Hermes()

# List available tools and agents
print(h.list_tools())
print(h.list_agents())

What's Included

Data Tools (35 total)

Module Tools Source
SEC EDGAR Company facts (XBRL), filing search, submissions, filing URLs, structured financial tables, labeled text sections (MD&A, Risk Factors, etc.), insider transactions, institutional holdings edgartools + efts.sec.gov — free, no key
FRED Economic time series, series search, metadata api.stlouisfed.org — free key
Market Data Quotes, historical OHLCV, batch quotes Yahoo Finance — free, no key
News Company news, general financial news Yahoo/Google RSS — free, no key
Excel Create, write, read, format, formulas, charts, save .xlsx openpyxl
Documents Create, headings, paragraphs, tables, images, save .docx, export PDF python-docx + LibreOffice
Charts Line, bar, waterfall, scatter, heatmap → PNG matplotlib

Specialist Agents (7)

Agent Type Role
SecFilingsAgent FunctionAgent SEC filing retrieval and analysis
MacroAgent FunctionAgent FRED macroeconomic data
MarketDataAgent FunctionAgent Quotes and historical prices
NewsAgent FunctionAgent Financial news and sentiment
ModelingAgent ReActAgent Excel financial model construction
ReportAgent ReActAgent Word/PDF report generation
ResearchOrchestrator ReActAgent Multi-agent coordination

Infrastructure

  • File-based cache with per-item TTL (filings cached permanently, quotes never cached)
  • Async rate limiter (token bucket) for SEC EDGAR, FRED, Yahoo Finance
  • Streaming events for real-time progress reporting
  • ChromaDB vector indices for semantic search over financial documents

Configuration

All settings can be passed to configure() or set via environment variables with the HERMES_ prefix:

hermes.configure(
    llm_provider="anthropic",           # or "openai"
    llm_model="claude-sonnet-4-5-20250514",
    sec_user_agent="MyApp/1.0 (me@company.com)",
    fred_api_key="your_key",
    output_dir="./output",
    verbose=True,
)

Environment variables: HERMES_LLM_PROVIDER, HERMES_FRED_API_KEY, etc.

Extending Hermes

Register a Custom Tool

from llama_index.core.tools import FunctionTool

def my_bloomberg_lookup(ticker: str) -> dict:
    """Look up data from Bloomberg."""
    ...

tool = FunctionTool.from_defaults(fn=my_bloomberg_lookup, name="bbg_lookup")

h = hermes.Hermes()
h.register_tool("bbg_lookup", tool, tags=["market_data"])

Register a Custom Agent

from hermes.agents import HermesAgent

class OptionsFlowAgent(HermesAgent):
    name = "options_flow"
    description = "Analyzes unusual options activity and flow data."
    system_prompt = "You are an options flow specialist..."
    agent_type = "function"

    def get_tools(self):
        return [...]

h = hermes.Hermes()
h.register_agent("options_flow", OptionsFlowAgent)

Using Tools Directly

You don't need agents to use the tools. Every tool module exposes async functions that work standalone:

from hermes.tools.sec_edgar import (
    get_company_facts,
    get_filing_urls,
    get_filing_financial_tables,
    get_filing_text,
)
from hermes.tools.fred import get_series
from hermes.tools.excel import excel_create_workbook, excel_write_cells, excel_save

# Fetch Apple's multi-period XBRL financial data
facts = await get_company_facts("AAPL")

# Discover recent 10-K and 10-Q filings
filings = await get_filing_urls("AAPL", filing_types="10-K,10-Q", limit=10)

# Extract XBRL-parsed, pre-classified financial statements from a filing
tables = await get_filing_financial_tables("AAPL", filings[0]["accessionNumber"])

# Extract labeled qualitative sections (MD&A, Risk Factors, Business, etc.)
text = await get_filing_text(filings[0]["url"])

# Pull GDP data from FRED
gdp = await get_series("GDP", start_date="2020-01-01")

# Build an Excel workbook
wb_id = excel_create_workbook("model", sheets=["Assumptions", "Income Statement"])
excel_write_cells(wb_id, "Assumptions", {"A1": "Revenue Growth", "B1": 0.12})
filepath = excel_save(wb_id, "my_model.xlsx")

Project Structure

hermes/
├── __init__.py              # Public API: Hermes, configure
├── config.py                # Pydantic configuration
├── registry.py              # Tool/agent registry
├── core.py                  # Hermes facade class
├── tools/
│   ├── _base.py             # HTTP client, rate limiter, cache helpers
│   ├── sec_edgar.py         # SEC EDGAR (XBRL, EFTS, submissions)
│   ├── fred.py              # FRED macroeconomic data
│   ├── market_data.py       # Yahoo Finance quotes and history
│   ├── news.py              # RSS-based news retrieval
│   ├── excel.py             # Excel workbook manipulation
│   ├── documents.py         # Word document generation + PDF export
│   └── charts.py            # matplotlib chart generation
├── agents/
│   ├── base.py              # HermesAgent abstract base class
│   ├── sec_filings.py       # SEC filings specialist
│   ├── macro.py             # Macroeconomic data specialist
│   ├── market.py            # Market data specialist
│   ├── news.py              # News/sentiment specialist
│   ├── modeling.py          # Financial modeling (Excel)
│   ├── report.py            # Report writing (Word/PDF)
│   └── orchestrator.py      # Multi-agent coordinator
├── ingestion/
│   ├── sec_parser.py        # SEC filing HTML → LlamaIndex nodes
│   ├── transcript_parser.py # Earnings transcript parser
│   └── index_manager.py     # ChromaDB index management
└── infra/
    ├── cache.py             # File-based cache with TTL
    ├── rate_limiter.py      # Async token bucket rate limiter
    └── streaming.py         # Streaming event types

Development

# Clone and install with dev dependencies
git clone https://github.com/hermes-financial/hermes-financial.git
cd hermes-financial
uv sync --all-extras

# Run tests
uv run pytest

# Lint
uv run ruff check hermes/

# Type check
uv run mypy hermes/

Requirements

  • Python >= 3.10
  • An LLM API key (Anthropic or OpenAI) for agent functionality
  • SEC EDGAR requires a User-Agent string identifying your application
  • FRED requires a free API key from fred.stlouisfed.org
  • LibreOffice for PDF export (optional, available in Docker image)

Professional Services

Need this deployed internally, integrated with your data sources, or extended with custom agents and models? joe@pital.dev

Acknowledgments

SEC EDGAR data retrieval is powered by edgartools (MIT), an excellent Python library by Dwight Gunning that provides high-level access to SEC EDGAR filings, XBRL-parsed financial statements, and structured document sections. If you find Hermes useful for SEC research, please consider starring the edgartools repo.

License

MIT

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_financial-0.1.10.tar.gz (538.2 kB view details)

Uploaded Source

Built Distribution

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

hermes_financial-0.1.10-py3-none-any.whl (95.1 kB view details)

Uploaded Python 3

File details

Details for the file hermes_financial-0.1.10.tar.gz.

File metadata

  • Download URL: hermes_financial-0.1.10.tar.gz
  • Upload date:
  • Size: 538.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hermes_financial-0.1.10.tar.gz
Algorithm Hash digest
SHA256 3c51a1aef727a442ec31711aca86297babc71645927623a1ecb17a956943fed8
MD5 94aeab1f4fbbae781c2c4b4d3a6996ee
BLAKE2b-256 4c9c409867998e4133dc8e5ee3118147df7334ac9ec764b70972f2013b82b3c5

See more details on using hashes here.

File details

Details for the file hermes_financial-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: hermes_financial-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 95.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hermes_financial-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 61b87b62f6be2922c4434a17c3d158710e26c25b2085f55406e7d73251418409
MD5 df8a0cd51c57bd394766c58923b813bb
BLAKE2b-256 d1158e673745c84688d5f357d01e305081fa98bed830e02a052f4b8c4d708de8

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