Skip to main content
helix-py is a Python library for interacting with helix-db, a powerful graph-vector database written in Rust. It provides both a simple query interface and a PyTorch-like front-end for defining and executing custom graph queries and vector-based operations. This makes it well-suited for use cases such as similarity search, knowledge graph construction, and machine learning pipelines.

Installation

Client

To setup a simple Client to interface with a running helix instance:
Python
The default port is 6969, but you can change it by passing in the port parameter. For cloud instances, you can pass in the api_endpoint parameter.

Queries

helix-py allows users to define a PyTorch-like manner, similar to how you would define a neural network’s forward pass. You can use built-in queries in helix/client.py to get started with inserting and search vectors, or you can define your own queries for more complex workflows. Pytorch-like Query Given a HelixQL query like this:
query.hx
You can define a matching Python class:
Python
Make sure that the Query.query method returns a list of objects.

Instance

To setup a simple Instance that manages and automatically starts and stops a helix instance with respect to the lifetime of the script:
Python
helixdb-cfg is the directory where the configuration files are stored.
and from there you can interact with the instance using Client. The instance will be automatically stopped when the script exits.

Providers

Helix has LLM interfaces for popular LLM providers. Available providers:
  • OpenAIProvider
  • GeminiProvider
  • AnthropicProvider
Don’t forget to set the OPENAI_API_KEY, GEMINI_API_KEY, and ANTHROPIC_API_KEY environment variables depending on the provider you are using.
All providers expose two methods:
  • enable_mcps(name: str, url: str=...) -> bool to enable Helix MCP tools
  • generate(messages, response_model: BaseModel | None=None) -> str | BaseModel
The generate method supports messages in the 2 formats:
  • Free-form text: pass a string
  • Message lists: pass a list of dict or provider-specific Message models
It also supports structured outputs by passing a Pydantic model to get validated results. Example:
To enable MCP tools with a running Helix MCP server (see MCP Feature):
  • OpenAI GPT-5 family models support reasoning while other models use temperature.
  • Anthropic local streamable MCP is not supported; use a URL-based MCP.

Embedders

Helix has embedder interfaces for popular embedding providers. Available embedders:
  • OpenAIEmbedder
  • GeminiEmbedder
  • VoyageAIEmbedder
Each embedder implements:
  • embed(text: str, **kwargs) returns a vector [F64]
  • embed_batch(texts: List[str], **kwargs) returns a list of vectors [F64]
Examples (see examples/llm_providers/providers.ipynb for more):

Chunking

Helix uses Chonkie chunking methods to split text into manageable pieces for processing and embedding:
You can find all the different chunking examples inside of Chunking Feature.

Loader

The loader (helix/loader.py) currently supports .parquet, .fvecs, and .csv data. Simply pass in the path to your file or files and the columns you want to process and the loader does the rest for you and is easy to integrate with your queries

More Information

For more information, check out our examples!