Skip to content

Add optional context parameter to embedding-based grounding - #29

Closed
nicoloesch wants to merge 2 commits into
mainfrom
19-rag-context
Closed

Add optional context parameter to embedding-based grounding#29
nicoloesch wants to merge 2 commits into
mainfrom
19-rag-context

Conversation

@nicoloesch

Copy link
Copy Markdown
Collaborator

Summary

ground_term() gains an optional context: str | None parameter, folded into the text passed to the on-demand query embedding call, letting callers supply disambiguating context alongside the term being grounded. No change to existing callers that omit it.

@gkennos
gkennos self-requested a review July 15, 2026 06:45
Comment thread src/omop_graph/reasoning/grounding.py
@nicoloesch

Copy link
Copy Markdown
Collaborator Author

This now depends on AustralianCancerDataNetwork/omop-emb#46 to pass so it can be included nicely.

@nicoloesch nicoloesch added the feature New backwards-compatible functionality. MINOR: x.y+1.z label Jul 22, 2026
@nicoloesch

Copy link
Copy Markdown
Collaborator Author

Closing in favor of absorbing this into #34

The on-demand embedding path this PR touches (KnowledgeGraph.emb, ground_term()) is being restructured in that same work. Merging this first would mean redoing it again immediately after, for a release nobody would pull in between.

The context parameter design here is unchanged and lands as part of that PR, with credit to this branch. Reopen if there's a reason to decouple it.

@nicoloesch nicoloesch closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New backwards-compatible functionality. MINOR: x.y+1.z

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Increase Context for Grounding in RAG

2 participants