Text and code embeddings by contrastive pre-training
OpenAI just shipped unified text-code embeddings. Here's why that matters for your RAG pipeline.

Why it matters
OpenAI released a foundational embedding model trained via contrastive learning that unifies text and code representations—a capability shift that impacts search, retrieval, and downstream application performance across technical and natural language tasks.
The key facts
9 to knowContrastive pre-training approach for embedding models
Unified text and code representation capability
Published January 2022 (foundational model release)
Implications for retrieval-augmented generation (RAG) and semantic search
OpenAI releases text-and-code embedding model
Trained via contrastive pre-training methodology
Supports both natural language and source code in single embedding space
Published January 24, 2022
Foundational for semantic search and retrieval workflows
Go to the source
OpenAI Blogopenai.com