Quick Start

Get up and running with hypergraph in 5 minutes.

Installation

uv add git+https://github.com/gilad-rubin/hypergraph.git
# or
pip install git+https://github.com/gilad-rubin/hypergraph.git

Your First Graph

1. Define Nodes

A node is a function wrapped with the @node decorator. Declare what it produces with output_name:

from hypergraph import node

@node(output_name="doubled")
def double(x: int) -> int:
    return x * 2

@node(output_name="result")
def add_ten(doubled: int) -> int:
    return doubled + 10

2. Build a Graph

Pass nodes to Graph. Edges are inferred automatically from matching names:

3. Run It

Complete Example: RAG Pipeline

How it connects:

  • embed produces "embedding"

  • retrieve takes embedding as a parameter → edge created

  • retrieve produces "docs"

  • generate takes docs as a parameter → edge created

  • generate also takes query → provided as input

What's Next?

Last updated