A picture-perfect house outside the budget
Someone uploads a photo of a house and asks, “Can you find similar places in this area within my budget?” The top result matches the roofline, window layout and exterior finish. It costs more than the buyer can afford. How did a good image match make a poor recommendation?
The request contains two criteria. City and budget determine which listings qualify. The photograph ranks the eligible listings. City and price are values stored in columns. An embedding captures features of a photograph as a vector of numbers. For photos encoded by the same model, smaller distances indicate closer visual similarity according to that model. Embeddings and similarity search
The distinction matters when returning only a few results. Pick the two closest photos across all listings first, then check city and price, and both may disappear. A slightly less similar third listing never gets considered. In the four-listing example below, A, B, C and D are ordered from closest to farthest by photo similarity. Change when you apply the conditions and see which listings survive.
Why combine business constraints and vectors in one query?
If a listing identifier ties together city, price and photo embedding, one SQL query can express both criteria. Specify the eligible rows using city and price, then request a limited number ordered by their distance to the reference image. This defines the conditions the results must satisfy. The optimizer chooses the physical execution order of filters and index operations.
A separate vector store still needs both criteria. If a price changes or the property sells, when does the search copy reflect that change? Which key ties a search result to its authoritative record? Querying business data and vectors together reduces the need for that copy. In either architecture, if the photo changes, verify that its new embedding has been recorded.
Where to generate embeddings is a separate choice. You can load precomputed vectors, call a model service, or run a model in the application or database. Consider whether source documents may leave the system and who will refresh the vectors when documents change. Whichever path you choose, the query must use an embedding space compatible with the stored vectors.
Questions a single retrieval can answer
Retrieval-augmented generation (RAG) finds passages relevant to a question and supplies them to a language model as evidence for an answer. An internal IT assistant might retrieve an incident report with similar symptoms and cite the action an engineer took. When similar symptoms have different causes, one more similar document may do little to resolve the uncertainty.
Relationships already recorded in the system offer another kind of evidence. Follow a symptom to the incident where it was observed, then follow the incident to its documented remedy. A graph can represent those relationships and expand the context supplied to the model, an approach often called graph RAG. Its value depends on the relevant links actually being present in the data.
What result should trigger the next question?
A customer asks, “Does my policy cover this treatment, and if so, how much would I pay?” Several products mention the same treatment. A search across every policy can retrieve the closest paragraph from a different product. Increasing K cannot establish which product the customer holds. The enrollment record supplies that fact.
The first tool retrieves the product identifier and applicable policy from the enrollment record. The next searches that policy for passages about the treatment and returns their document locations. Evidence of coverage opens the cost question. If the retrieved passage already gives the calculation, use it. Otherwise search the same policy for the cost provision. An explicit exclusion can support an answer immediately. The next step depends on what the policy actually says.
In an operational system I would add a branch for insufficient evidence. If the search finds no passage, report what the search established: the available material did not confirm coverage. An explicit exclusion and a retrieval miss call for different responses. Check the document scope or request review. Cost questions also raise a separate issue about the difference between establishing applicable terms and having authority to decide.
What to specify in an agent builder
When reviewing a tool graph, I start with the values that cross each connection. The enrollment lookup must return the product and document identifiers, and the policy search must accept those same identifiers to preserve the retrieval scope. Next, specify the condition for a follow-up. Recording the passage that established coverage lets an operator later reconstruct why a cost lookup ran. An open specification for tools and conditional branches
I would test the same question against two products, using a clause that applies to only one. When the enrollment changes, the retrieved document and the tools called should change accordingly. If both answers cite the same clause after the applicable document changes, my first check is the handoff of the product identifier to the search tool.
How does the output of one lookup become the input to the next tool?
- Identify the subject and documentsRead the applicable document ID from the business record.
- Retrieve relevant passagesFind passages relevant to the question within that document.
- Decide on a follow-upCheck whether the passages establish the premise of the next question.
- Premise established, question open
- Look for the follow-up answer in the same document.
- Sufficient evidence
- Reply with the finding and its supporting passage.
- Insufficient evidence
- Explain what still needs verification.
Key concepts
- Relational lookup
- Filter rows using conditions and join records by identifier. This identifies listings within a budget or documents associated with an enrolled product.
- Vector search
- Compare distances between questions and passages, or between images, represented in the same embedding space. Rank eligible candidates by the similarity captured by the model.
- Agent builder
- Define a workflow by connecting tool inputs, outputs and branching conditions. At run time, the actual lookup results determine which path the workflow follows.
Design considerations
Review the route to the answer alongside the answer itself. Check which product documents contributed evidence, whether an explicit exclusion stopped a cost lookup, and what must be verified if the search finds no evidence.
Background and sources
- Event
- Oracle AI Summit 2026
- Event date
- Session title
- AI Vector Search: from search to intelligent agents
- Subtitle
- Vector Search, RAG and Agentic AI
- Session
- Track C
- Role at the event
- Oracle Korea · Principal Cloud Data Architect
