Skip to content

Workflow

How to Build a Local AI Knowledge Base from Markdown, PDFs, and Obsidian

Use supported document sources, repeatable sync, source-backed pages, and verification to build a local AI knowledge base for coding agents.

Qi-Xuan LuUpdated 5 min read

Article packet

01

Workflows

02

People building a local document knowledge base for Claude Code, Codex, Cursor, or another AI agent

03

5 min read

01

Start with one bounded folder or file instead of importing everything.

02

Use Markdown, text, text-extractable PDFs, or an Obsidian vault as inspectable sources.

03

Verify source sync and page citations before trusting generated answers.

01

Quick answer

Follow Wenlan's platform and client setup guide, then point `wenlan sources add <path>` at one Markdown or text file, a text-extractable PDF, a folder, or an Obsidian vault. Re-running the same command resyncs an already registered path. In a client with the Wenlan plugin, distill one repeated topic into a maintained Page; in an MCP-only client, use the Wenlan tools exposed by that client.

Wenlan keeps registered Sources separate from atomic Memories and maintained Pages. Regular files and folders can sync incrementally; an Obsidian vault remains read-only and resyncs on demand. The resulting Page stays readable as Markdown and keeps inspectable source support.

02

When this problem appears

A folder search is not yet a knowledge base, while a one-time AI summary becomes detached from the documents that support it. The useful middle is a small source boundary, repeatable sync, a maintained answer for one real question, and a check that every important claim can still reach its evidence.

03

Build one document-to-page loop

Use one topic and a small source set so failures stay visible.

  • Install the runtime for your operating system, connect the current AI client, and verify the connection before importing documents.
  • Choose one folder, file, or Obsidian vault that answers a repeated work question.
  • Keep supported inputs to `.md`, `.txt`, and text-extractable `.pdf`; put unrelated material outside the source boundary.
  • Run `wenlan sources add <path>` and inspect the found, ingested, skipped, and error counts.
  • Re-run the same command after a source changes; registration is idempotent and the path is resynced.
  • In Claude Code or Codex with the Wenlan plugin, use `/distill <topic>` only after the source set can answer the topic, then open it with `/pages <topic>`.
  • Run `/lint` and `/curate` in a plugin client, or use the equivalent Wenlan tools exposed by an MCP-only client, before relying on the Page.

After platform and client setup

wenlan status
wenlan sources add ~/Knowledge/project-docs

04

What to check next

Image-only or scanned PDFs need OCR before Wenlan can extract their text, and Directory Sources do not ingest arbitrary source-code files. Keep code, tests, and native project docs authoritative; use this workflow for supported documents and maintained synthesis.

Build one local knowledge-base loop

Install Wenlan, add one inspectable document set, then verify sync, Pages, citations, and review before expanding.

FAQ

Does Wenlan copy or rewrite my Obsidian vault?+
No. Wenlan reads an Obsidian vault as a source and keeps the original Markdown human-owned. Page export or a symlink into the vault is a separate choice.
Is this the same as uploading files to a chatbot?+
No. A chatbot upload is usually session-scoped. This workflow registers a reusable local source, resyncs it, and builds a maintained Page whose support can be inspected and reviewed.