Skip to documentation
Docs navigation
Docs/OpenAI adapter
Adapter

OpenAI adapter

Connect MemoGrafter to OpenAI models.

Installation

terminal
npm install memo-grafter openai

Configuration

adapter.ts
const agent = new MemoGrafterAgent({
  db: { connectionString: process.env.DATABASE_URL! },
  llm: OpenAILLMAdapter,
  embedder: OpenAIEmbedAdapter,
});

Supported capabilities

Chat completion for response generation and memory extraction.
Embedding generation when the provider exposes a compatible embedding model.
Server-side authentication through environment variables.

Provider notes

Set OPENAI_API_KEY on the server.
Choose completion and embedding models independently.
Keep embedding dimensions consistent with the database index.

Troubleshooting

Confirm the API key is available to the server process.
Verify the configured model supports the requested operation.
Check rate limits when ingestion succeeds intermittently.