Semantic Memory & the OpenAI Embeddings Requirement
Semantic Memory & the OpenAI Embeddings Requirement
Sidekick's agent uses semantic memory search to recall relevant past context when handling tasks. This feature relies on vector similarity — comparing the numerical "meaning" of text snippets — to surface the most relevant memories from the agent's long-term store.
How It Works
- When the agent processes new information (messages, emails, events, etc.), it generates a vector embedding of that content using the OpenAI Embeddings API.
- These embeddings are stored in a vector index alongside the original content.
- At query time, the agent embeds the current context and performs a cosine similarity search to retrieve the most semantically relevant memories.
- Retrieved memories are injected into the agent's context window, giving it continuity across sessions and tasks.
Configuration
Semantic memory requires OPENAI_API_KEY to be set in the runtime environment:
OPENAI_API_KEY=sk-...
This key is used only for embedding generation (e.g. text-embedding-3-small or equivalent). It is not used for chat completion or other LLM inference.
Where to Get It
- Log in to platform.openai.com.
- Navigate to API Keys.
- Create a new secret key and copy it.
- Set it as
OPENAI_API_KEYin your Sidekick environment configuration.
Graceful Degradation
If OPENAI_API_KEY is not set or is invalid:
- Semantic memory search silently returns empty results — no error is thrown.
- The agent continues to operate normally for all other tasks.
- The agent simply has no access to long-term recall — it will not remember context from previous sessions.
This means the agent is still fully functional for stateless tasks (answering questions, taking single-turn actions, etc.) but will lose contextual continuity over time.
Recommended Setup
For any production deployment where agent quality matters, OPENAI_API_KEY should be treated as a required environment variable. While the absence of this key is not a hard blocker, it substantially reduces the agent's ability to:
- Remember user preferences and past instructions
- Recognise recurring tasks and patterns
- Maintain continuity across long-running workflows
- Provide personalised, context-aware responses
Summary
| State | Semantic Memory | Agent Function |
|---|---|---|
OPENAI_API_KEY set | ✅ Fully operational | ✅ Full quality |
OPENAI_API_KEY absent | ❌ Empty results (silent) | ⚠️ Degraded recall |