Integrations

OpenAI

Build retrieval-augmented generation pipelines by combining Aether's vector search with OpenAI GPT-4o.

Aether handles document storage and semantic retrieval while GPT-4o generates grounded, context-aware answers from the retrieved content. This pattern keeps responses factual and traceable back to your source documents.


Prerequisites

Install the Aether SDK alongside the OpenAI SDK for your language of choice.

pip install aether-ai openai

Go

Go calls the OpenAI API directly via net/http — no third-party LLM SDK required.

Environment variables

Configuration

Set the following environment variables before running the examples below.

  • OPENAI_API_KEY — your OpenAI API key (required).
  • AETHER_API_KEY — your Aether API key, loaded and passed to the client below (optional for unauthenticated deployments).

Full working example

The pattern is straightforward: retrieve relevant documents from Aether, inject them as context into a GPT-4o prompt, and let the model synthesize a grounded answer.

import os

from aether import AetherClient
from openai import OpenAI

aether = AetherClient(api_key=os.environ.get("AETHER_API_KEY"))
results = aether.retrieve("What health insurance does the company offer?", k=3)
context = "\n\n".join(f"[{r.title or r.doc_id}]\n{r.content}" for r in results)

client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": f"Answer using only this context:\n\n{context}"},
        {"role": "user", "content": "What health insurance does the company offer?"},
    ],
)

print(response.choices[0].message.content)