Knowledge

Hybrid retrieval over a directory of markdown.

Point an agent at a directory of markdown and it gets one extra tool: search_knowledge. Retrieval is hybrid — TF-IDF for exact terms, dense embeddings for meaning — and the results come back as context.

agents:
  support:
    knowledge:
      dir: ./knowledge

Why hybrid

Neither half is enough on its own. TF-IDF finds a part number or an error code that an embedding model will happily consider similar to a hundred other part numbers. Embeddings find the answer when the user's words and the document's words have nothing in common — "the payment failed" against a page titled "Declined transactions".

Running both and merging costs one extra index and removes both failure modes.

Keywords

A document can declare terms that should retrieve it even when they do not appear in its prose:

## Refund policy
#keywords: chargeback, dispute, money back, reversal

Refunds are issued to the original payment method within...

The #keywords: line is indexed and then stripped from what the agent reads, so it bridges vocabulary gaps without polluting the answer.

What it is not

This is retrieval over your own files, not a vector database. It loads a directory, indexes it in memory, and searches it. That is the right shape up to a few thousand documents and the wrong shape past it — at which point the Embeddings protocol lets you put something else behind the same tool.