Before semantic search, I needed to know what I had indexed
Before asking my Markdown search tool a question, I need to know which documents it has read.

Copyright catalog at the Library of Congress, photographed by Michael Holley and released into the public domain.
That sounds simpler than semantic search. It still needs an answer. If I ingest the same directory twice, do I get a second set of chunks for every file? If a result looks wrong, can I find the file it came from?
The November 26 ingestion change in rag-mcp adds a check for files already in the vector store. It also makes the limits of that check fairly visible.
A filename that survives the checkout location
For each file, the ingester calculates a path relative to the selected directory:
filename = str(pth.relative_to(self.directory))
That gives a document a name such as guides/install.md, rather than a full path tied to my home directory. The code adds that filename as metadata when it sends the split document to the vector store.
The query response then uses the metadata to report its source alongside the retrieved content. That lets me go back from a search result to the document it represents.
The path has a scope: the directory I chose to ingest. Two different roots can each contain guides/install.md. A relative path is useful identity within that scope; it doesn’t make the name globally unique.
Already present isn’t the same as up to date
The new ingestion check looks for an existing document with matching filename metadata. In this revision it uses a filtered similarity search, asking for one result. If a match exists, it logs that the file is already in the vector store and skips it.
That avoids repeatedly adding an already recorded path. But it doesn’t compare the file’s contents with the contents previously indexed.
Here is a teaching manifest showing the distinction, not output produced by the program:
| File | Stored filename present? | Decision in this revision |
|---|---|---|
guides/install.md, unchanged | Yes | Skip. |
guides/install.md, edited | Yes | Skip this too. |
guides/new-topic.md | No | Split and add. |
The edited file needs an update policy if I want the search index to follow changes. The existence check alone can’t tell me that its stored chunks are current.
Finding files is another boundary
The crawler walks directories and reads files as UTF-8 text. In this early snapshot, it doesn’t restrict that walk to .md files. Calling the project a Markdown search tool doesn’t make every file it encounters Markdown.
That is another useful check to keep separate from retrieval quality. I can get an unexpected input into the pipeline before an embedding model ever sees it.
Once a file reaches the splitter, the code divides it at Markdown headers and then into smaller chunks. Searching those chunks is useful only if their metadata keeps enough context to identify the original document.
A path match can also find an older copy of a file I’ve since edited. I still need a way to recognize that case.