POC: Integrate local document retrieval with skills via MCP#2002
Draft
oliverholworthy wants to merge 5 commits intoNVIDIA:mainfrom
Draft
POC: Integrate local document retrieval with skills via MCP#2002oliverholworthy wants to merge 5 commits intoNVIDIA:mainfrom
oliverholworthy wants to merge 5 commits intoNVIDIA:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a POC for document retrieval through a skill and MCP tool. The goal of this POC is to explore integration patterns for local document retreival:
What This Adds
retriever localCLI commands for local document indexing/search:initsearchaskstatusdoctorcleanretriever-local-mcplocal_document_asklocal_document_searchlocal_document_status.agents/skills/nemo-retriever-local-document-search.codex/config.toml.exampleSupported document types are currently:
The workflow is retrieval-only.
askreturns evidence and metadata, but does not generate a prose answer itself:The agent is expected to synthesize the final response from returned evidence.
Configuration
After installing/building the local NeMo Retriever environment, configure Codex with a project-local
.codex/config.tomllike:cwdis intentionally omitted so the MCP server inherits the active Codex project/session directory. This lets prompts likeIn ./docs, ...resolve relative to whichever project Codex is currently running in.For another project, copy the skill directory into that repo:
Then start Codex from that project root and ask a docs-grounded question such as:
Behavior
By default the tool uses local embedding inference with:
Remote embedding is available explicitly with
--inference remote/inference="remote"and an API key, but local is the default for the skill.When the MCP tool is called without an explicit
index, it derives a stable project-local index path from a hash of the resolved absolute input path, for example:This avoids collisions between
./docsin different repos and allows warm reuse across follow-up questions.What The POC Demonstrates
Tested this with the NeMo Retriever docs and the DataDesigner docs. The DataDesigner test showed the agent using the MCP retrieval tool first, creating/reusing a path-scoped local index, and answering a multi-part configuration question from retrieved docs without broad manual repo search.
This is the core outcome: the skill + MCP pattern working as as a portable way to wire local retrieval into agent behavior.
Known Gaps