Urgent.News

What's breaking now, across thousands of outlets.

AI

Why Vector Search Breaks Production: Building a 2-Hop Relational Context Engine in Sanity

This is a submission for the Sanity Challenge, Path Two: Build a Knowledge Base or Context Engine . What I Built The AI community has spent the last three years building Retrieval-Augmented Generation (RAG) on top of vector similarity search (Pinecone, Chroma, pgvector). For prose and chat applications, cosine similarity on text chunks works well. For engineering infrastructure, vector search is…

The AI community has been developing Retrieval-Augmented Generation (RAG) using vector similarity search techniques like Pinecone, Chroma, and pgvector for prose and chat applications. However, when applied to engineering infrastructure, vector search can lead to outages due to the loss of relational constraints, authority hierarchies, and multi-hop transitivity during the compression of text into high-dimensional vectors.

To address these issues, the Sanity team built a 2-hop relational context engine on top of Sanity Content Lake, which models organizational knowledge as a structured graph of microservices, version constraints, policies, and semantic relationships. This engine executes deterministic GROQ graph traversals to surface hidden dependency chains and resolve documentation contradictions with mathematical precision.

The Sanity team used Sanity to create 18 interconnected documents across three core schema types: Schema Graph, versionConstraint, and knowledgeEntry. The core GROQ query used by the context engine traverses three hops to resolve 2-hop dependency chains in a single database round-trip. The engine first identifies the target component, then the relational version constraint, and finally the active cluster state of the required dependency.

Authority resolution is handled by sorting conflicting specs by authorityLevel so the newest specification always wins.

In a live benchmark, the Sanity Context Engine was compared to a standard vector similarity search. The engine correctly detected a P0 outage caused by a version constraint mismatch between payment service and its SDK dependency, while the vector search failed to identify the issue. The Sanity Context Engine also supports in-memory graph mutation, allowing engineers to simulate fixes and immediately see the impact on constraints and overall document reliability.

This approach eliminates false positives and provides a more accurate, structured, and explainable context for AI coding assistants.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

SHIPCHECK: An Autonomous ReAct Agent That Stops Cloud Outages Before They Happen

This is a submission for the Sanity Challenge, Path One: Ship an Agent That Queries Real Content . What I Built Modern engineering teams increasingly rely on autonomous AI coding agents (Claude Code…

  • SHIPCHECK prevents cloud outages by checking code deployments.
  • Uses Sanity Content Lake and Model Context Protocol for dependency checks.
  • Systematically deconstructs proposed changes and provides remediation steps.

Your agent keeps guessing your conventions. Write the file it actually reads.

Every team I have watched adopt Cursor, Claude Code or Codex hits the same wall in week two. The agent writes plausible code that does not fit the repo. It invents a test command.

  • Cursor, Claude Code, and Codex share same issue after two weeks
  • Missing conventions file leads to agent's incorrect assumptions
  • ContextForge creates snapshot to generate accurate instructions

US court sides with Pentagon in Anthropic AI ban

The Pentagon had canceled Anthropic's military contracts in March following the AI startup's refusal to remove safeguards on its Claude model. The conflict was initially triggered when an Anthropic executive had questioned the use of Claude during the military operation that captured Venezuelan President Nicolas Maduro on January 3.

More from Saturday 26 September →