Knowledge
Markdown Knowledge Base
Learn how to use Markdown files in your knowledge base.
The MarkdownKnowledgeBase reads local markdown files, converts them into vector embeddings and loads them to a vector database.
Usage
We are using a local PgVector database for this example. Make sure it’s running
knowledge_base.py
Then use the knowledge_base
with an Agent:
agent.py
MarkdownKnowledgeBase also supports async loading.
We are using a local Qdrant database for this example. Make sure it’s running
async_knowledge_base.py
Params
Parameter | Type | Default | Description |
---|---|---|---|
path | Union[str, Path] | - | Path to md files. Can point to a single md file or a directory of md files. |
formats | List[str] | [".md"] | Formats accepted by this knowledge base. |
reader | MarkdownReader | MarkdownReader() | A MarkdownReader that converts the md files into Documents for the vector database. |
MarkdownKnowledgeBase
is a subclass of the AgentKnowledge class and has access to the same params.
Developer Resources
- View Sync loading Cookbook
- View Async loading Cookbook