WhoBuilt

Beyond RAG: Build a Relational Context Engine from Scratch

Oct 11, 2026· 38 min· 5.9K views·Watch on YouTube

Speaker

Peter Werry of Unblocked presents an AI Engineer workshop on building a relational context engine for engineering data, with colleague Brandon assisting.

Why vector retrieval needs a structured counterpart

Engineering context lives across pull requests, review comments, issues, docs, and conversations, and it has structure as well as meaning. Vector search can find semantically related material, but a question like “PRs I merged last week” also requires checking authorship, merge state, and time.

Discover schemas and resolve identities

The workshop samples 300 documents to infer a schema, combining their fields and deriving types and enum values with procedural code. It then uses fuzzy matching, such as Levenshtein distance, to map a person’s name to a different GitHub login.

Generate and validate database queries

The model receives the schema and a tool, then generates a query plan; giving it the current date and time helps with temporal queries. The engine uses an allowlist of operators and can restrict fields, rejecting unsafe clauses such as regular expressions or JavaScript execution.

Retry failures and combine retrieval methods

When query validation or execution fails, the error can be sent back to the model for another attempt, up to a limit. Adding full-text search lets the system find terms such as authentication while applying author and state filters; semantic search remains useful for finding conceptually related starting points.

Scale the data and choose sources

For many collections, Werry suggests keeping short schema summaries and using an additional model step to select the relevant schema. Unblocked continuously ingests changes through webhooks. He identifies Slack as a key source for decision context and notes that pull request comments can also reveal organizational history.

Takeaways

  • Use database filters for questions that depend on state, identity, or time; vector similarity alone may return a related but incorrect result.
  • Give the model schema context and resolve people’s names to system identifiers before querying.
  • Validate generated queries with allowlists and enforce tenant or field restrictions in procedural code.
  • Feed validation and execution errors back into a bounded retry loop so the model can correct its query.
  • Combine semantic search with structured queries and full-text search to cover different retrieval needs.

Mentioned in this talk

Search inside this talk

What was claimed 6

  • feature
    Unblocked: Builds a context engine that delivers organizational context to humans and agents.
    “We build a context engine.”
    YouTube
    Unverified1 source· Talk
  • feature
    Context Engine: Turns natural-language questions into database queries that account for schema, relationships, identity, and time.
    “The model ... writes the query that accesses the database.”
    YouTube
    Unverified1 source· Talk
  • feature
    Context Engine: Uses allowlisted operators to reject unsafe query output and can retry after validation or execution errors.
    “We don't denylist these things; we allowlist them. It's deny by default.”
    YouTube
    Unverified1 source· Talk
  • feature
    Context Engine: Supports filtering, aggregations, time-scoped queries, and full-text search.
    “It's capable of filtering, providing aggregations, and handling time-scoped queries. It has full-text search.”
    YouTube
    Unverified1 source· Talk
  • feature
    Unblocked: Continuously ingests content and stores updates received through webhook events.
    “We're continuously ingesting content.”
    YouTube
    Unverified1 source· Talk
  • uses
    “Slack, for sure. A lot of the 'why' questions and decision-making happen in Slack.”
    YouTube
    Unverified1 source· Talk

Related talks