惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Last Week in AI
Last Week in AI
D
DataBreaches.Net
腾讯CDC
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
罗磊的独立博客
月光博客
月光博客
MyScale Blog
MyScale Blog
U
Unit 42
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
G
Google Developers Blog
博客园 - 【当耐特】
D
Docker
I
InfoQ
雷峰网
雷峰网

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Your RAG Is Underperforming Because Your Embeddings Are T...
albe_sf · 2026-06-26 · via DEV Community

albe_sf

Most production RAG systems are built on a simple premise: convert documents into single vectors and find the ones closest to a query vector. This works for simple documents, but fails on the messy, multi-aspect data that defines enterprise reality. Cohere's Compass is a new embedding model designed for this specific problem, and it suggests a necessary evolution in how we build retrieval systems.

the single-vector problem

Standard embedding models, including powerful ones like Cohere's own Embed v3, map an entire document to a single point in semantic space. This is a lossy compression. If a document contains multiple distinct concepts—like an invoice with a specific sender, due date, and line items—the resulting vector is an average of all those concepts. The relationships between them are lost.

This leads to retrieval errors that are painfully familiar to anyone who has shipped a RAG product. A search for a "red T-shirt" might return "blue and yellow jeans" because the vector for colors is muddled with the vector for clothing type. In an enterprise context, a query for an invoice from a specific person might fail because the contextual link between the sender and the attached document was severed during the chunking and embedding process.

To compensate, engineers build brittle, complex classification layers and metadata filters on top of the vector search. This is a workaround, not a solution. It treats the symptom—poor retrieval quality—instead of the underlying disease: an embedding model that doesn't understand the structure of your data.

multi-aspect embeddings as a solution

Compass is designed to handle this multi-aspect data directly. Instead of feeding it a raw text chunk, you provide a JSON document that preserves the data's inherent structure. The model then creates a multi-aspect representation that can be stored in any vector database, capturing the relationships between the different concepts.

For example, a traditional RAG pipeline might index an email and its PDF attachment as two separate, unrelated chunks. The crucial context—that this specific PDF was sent by a particular person at a specific time—is lost. The Compass workflow uses an SDK to parse the email and its attachments into a single, structured JSON object. This JSON is then passed to the embedding model, which generates an output that understands the document's internal relationships.

This approach moves the complexity from post-retrieval filtering into the embedding model itself, where it can be handled more effectively. It allows for more precise, context-aware data retrieval without the need for manual classification layers.

what this looks like in practice

The workflow involves using a dedicated SDK to prepare and index your data. While the full system is in private beta, the open-source Python SDK shows the intended structure. You would use a parser client to convert your raw files into the structured JSON format, and then an index client to handle the embedding and storage.

Here is a conceptual look at how you might use the Python client to index documents:

from cohere_compass.clients.compass import CompassClient
from cohere_compass.clients.parser import CompassParserClient
from cohere_compass.models.config import MetadataConfig, MetadataStrategy

# Configuration for your Compass instance
COMPASS_API_URL = "<YOUR_COMPASS_URL>"
PARSER_API_URL = "<YOUR_PARSER_URL>"
BEARER_TOKEN = "<YOUR_API_TOKEN>"

# 1. Use the parser client to convert raw files into structured JSON
# This would point to a directory of your raw PDFs, DOCX, etc.
parser_client = CompassParserClient(parser_url=PARSER_API_URL)

# You can define strategies for how metadata is extracted and handled
metadata_config = MetadataConfig(
    metadata_strategy=MetadataStrategy.AUTO
)

parsed_docs = parser_client.parse_folder(
    folder_path="./path/to/your/data",
    metadata_config=metadata_config
)

# 2. Use the main client to create an index and add the parsed documents
compass_client = CompassClient(
    index_url=COMPASS_API_URL, 
    bearer_token=BEARER_TOKEN
)

index_name = "enterprise-document-index"

compass_client.create_index(index_name)

# The parsed_docs object contains the structured data ready for the 
# multi-aspect embedding model.
compass_client.add_documents(index_name, documents=parsed_docs)

This structured process ensures the model receives the rich, multi-aspect context that single-vector embeddings would otherwise discard.

the so-what for builders

The key takeaway is that the foundation of your RAG system—the retrieval model—deserves more attention. Simply using the largest, most powerful generative model won't fix a system that retrieves irrelevant documents. The future of enterprise AI isn't a single, monolithic model but a suite of specialized tools for specific jobs.

For builders working with complex, structured data, this means evaluating and adopting embedding models that are purpose-built for that data. A model like Compass, designed for multi-aspect retrieval, can be the component that elevates a system from a proof-of-concept to a production-grade tool that delivers genuinely relevant results.

Sources

https://cohere.com/