Onboarding: OpenAI

Add persistent memory to your OpenAI-powered application. Your agent will remember past conversations and use that experience to improve future responses.

Best path: Gateway (change one URL) or SDK (one import) Time: 2 minutes Reliability: ~99% (Gateway) / ~95% (SDK)


Option A: Gateway (Recommended)

No packages to install. Change your base URL and add one header.

Step 1: Get an API key

Sign up at dashboard.hippocortex.dev. Copy your API key (hx_live_...).

Step 2: Change your base URL

from openai import OpenAI

client = OpenAI(
    base_url="https://api.hippocortex.dev/v1",
    api_key="hx_live_...",
    default_headers={
        "X-LLM-API-Key": "sk-...",   # Your OpenAI key
    },
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
)

Step 3: Verify

Check dashboard.hippocortex.dev to see captured events. Your agent now has memory.


Option B: SDK

Step 1: Install

pip install hippocortex==1.2.1
# or
npm install @hippocortex/sdk@1.2.1

Step 2: Set your API key

export HIPPOCORTEX_API_KEY=hx_live_...

Step 3: Add one import

Python:

import hippocortex.auto
from openai import OpenAI

client = OpenAI()
# Every call now has memory. Done.

TypeScript:

import '@hippocortex/sdk/auto'
import OpenAI from 'openai'

const openai = new OpenAI()
// Every call now has memory. Done.

What to expect

After a few interactions, your agent starts receiving relevant context from past sessions. The more it captures, the better the context becomes. Compilation happens automatically in the background.