OpenAI Extractor
The OpenAI extractor uses GPT models to identify and extract facts from conversations, and to make consolidation decisions (ADD, UPDATE, DELETE, or NONE) when new facts are extracted.
Installation
Section titled “Installation”npm install @youcraft/recall-extractor-openaiimport { createMemory } from '@youcraft/recall'import { openaiExtractor } from '@youcraft/recall-extractor-openai'
const extractor = openaiExtractor({ apiKey: process.env.OPENAI_API_KEY!,})
const memory = createMemory({ db, embeddings, extractor })Configuration
Section titled “Configuration”| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | required | Your OpenAI API key |
model | string | "gpt-5-nano" | Model to use for extraction and consolidation |
Examples
Section titled “Examples”Custom model
Section titled “Custom model”const extractor = openaiExtractor({ apiKey: process.env.OPENAI_API_KEY!, model: 'gpt-5-nano',})Implementation Details
Section titled “Implementation Details”The OpenAI extractor uses structured outputs with Zod schemas to ensure reliable JSON responses for both extraction and consolidation operations.