Local Markdown Knowledge Base: A Practical Guide to AI-Assisted Curation

    This guide explains how to design a local Markdown knowledge base as a small data system, covering plain-text storage, YAML metadata, MOC indexes, a four-stage AI-assisted workflow, prompt and context engineering, automation, observability, common anti-patterns, and a four-week rollout plan. The focus is on preserving data ownership and human judgment while using AI to reduce the cost of cleaning, structuring, and linking knowledge.

    1. Starting Point: Plenty of Material, Little Knowledge

    Most people do not lack learning materials. The real problem is that their materials cannot be reused. A browser bookmarks folder may contain hundreds of long articles, a downloads folder may hold dozens of PDFs, and chat histories may contain useful conclusions scattered across conversations. Yet when it is time to write a proposal, conduct a retrospective, or answer an interview question, the search still starts from zero.

    There are three root causes:

    • Inconsistent storage formats: PDFs, screenshots, web pages, and chat records are mixed together and cannot be searched as a whole.
    • Missing structure: There are only files, without topic hierarchies or relationships. Knowledge remains in isolated silos.
    • No processing step: Saving is treated as learning, copying the original text replaces understanding, and notes have no second life.

    The solution is to design the knowledge base as a small data system: unify storage formats, define structural conventions, build indexes, and introduce an automated processing pipeline. AI plays the role of cleaning and structuring, not replacing human thinking.

    2. Selection Principles: Local-First, Plain Text, Portable

    Tools change; formats endure. When choosing tools, put data sovereignty first:

    1. Plain-text storage: Markdown is a universal format that any editor can open, with no dependency on a specific vendor.
    2. Local files as the single source of truth: Notes are .md files on disk. Synchronization, backup, and version control remain under your control.
    3. Version-control friendly: Text is naturally suited to Git and can track every change.
    4. Standardized links and metadata: Use common conventions such as relative links and YAML front matter, and avoid proprietary database formats.
    5. Pluggable AI capabilities: Models are external services called through interfaces and can be replaced at any time.

    A recommended directory skeleton:

    1. knowledge/
    2. ├── 00-inbox/ # Temporary collection area, unprocessed
    3. ├── 10-notes/ # Permanent notes, one idea per file
    4. ├── 20-moc/ # Map of Content index pages
    5. ├── 30-sources/ # Source excerpts and provenance
    6. ├── 40-output/ # Outputs: articles, proposals, retrospectives
    7. ├── 90-assets/ # Images and other attachments
    8. └── templates/ # Templates

    Use the naming pattern YYYYMMDD-topic-keywords.md to keep files time-ordered, semantically readable, and stably sorted.

    3. Metadata and Indexing: Making the Knowledge Base Machine-Readable

    Adding structured front matter to every note is the foundation for later automation and AI retrieval:

    1. ---
    2. title: Key Design Points for Idempotency Keys
    3. created: 2026-08-20
    4. updated: 2026-08-26
    5. tags: [architecture, distributed-systems, consistency]
    6. status: evergreen # inbox / draft / evergreen
    7. source: Project retrospective meeting
    8. refs: ["[[Distributed Transactions]]", "[[Retry Strategy]]"]
    9. ---

    Three practical recommendations:

    • Use tags as dimensions, not categories. Use directories for categories and tags for orthogonal attributes such as technical domain, status, and priority. This avoids tag explosion.
    • Build MOC index pages. Create one index file per topic and use relative links to collect related notes into a navigable map.
    • Let the status field drive the process. The three states inbox → draft → evergreen make the difference between “unprocessed” and “settled” immediately visible.

    4. A Four-Stage AI-Assisted Workflow

    The value of AI lies in reducing processing costs, not in generating conclusions. A fixed four-stage workflow is recommended, with clear input and output contracts at each stage.

    Stage 1: Collection (Inbox)
    Do only one thing: convert web page body text, PDF text, and meeting notes into Markdown and place them under 00-inbox/, preserving the original source link and capture time. AI is not required at this stage, which avoids contaminating the original material.

    Stage 2: Cleaning and Summarization
    Ask the model to produce a structured summary rather than free-form output:

    1. Role: You are a rigorous technical editor.
    2. Input: The following source material (enclosed in triple quotes).
    3. Task:
    4. 1. Extract the core conclusions, no more than five, one sentence each;
    5. 2. List key terms and their definitions;
    6. 3. Mark uncertain or missing information in the original; do not fill gaps;
    7. 4. Output JSON: {"summary":[], "terms":[], "gaps":[]}.
    8. Constraints: Use only the source material; do not introduce external knowledge.

    Stage 3: Structuring and Linking
    Split the summary into atomic notes with “one idea per file,” and ask the model to suggest related entries. A human must review the links; model-generated relationships are candidates only.

    Stage 4: Review and Output
    At a regular interval, such as weekly, create a topic-level summary starting from the MOC and synthesize multiple atomic notes into a proposal or article under 40-output/. This step is where knowledge becomes reusable output and should not be skipped.

    5. Prompt and Context Engineering Essentials

    High-quality output depends on four elements: role, context, constraints, and output format. Constraints are the most easily overlooked, yet they have the greatest impact on reliability.

    • Declare boundaries explicitly: Instructions such as “use only the given material” and “answer unknown when uncertain” can significantly reduce hallucinations.
    • Require structured output: JSON, tables, and fixed subheadings make results easier to parse and store programmatically.
    • Chunk and retrieve: Split long documents into semantic chunks first, for example by heading hierarchy, with each chunk around 500–1,000 characters and 10% overlap. During retrieval, feed only the relevant chunks to control context length.
    • Require citations and provenance: Ask the model to indicate which chunk a conclusion came from so humans can verify it.
    • Decompose prompts for style-transfer tasks: Break vague requirements into three parts: “preserve,” “variable,” and “global style.” For example: preserve the identity features of object A; make makeup, lighting, accessories, expression, and action variable while adapting them to the style of object B; take the color tone, texture, and atmosphere of object B as the global style; and explicitly state that “identity features must strictly follow A.” This pattern of “constraint priority plus enumeration of variable dimensions” also applies to text rewriting, code refactoring, and similar tasks.

    6. Automation and Observability

    Scripting repetitive actions is a prerequisite for a knowledge base to survive long term:

    1. # Pseudocode: inbox batch-processing pipeline
    2. for f in glob("00-inbox/*.md"):
    3. text = read(f)
    4. result = llm(structured_prompt, text) # Structured summary
    5. note = render_template(result) # Apply template
    6. write(f"10-notes/{slug(result.title)}.md", note)
    7. archive(f) # Archive original
    8. log.info("processed", extra={"file": f, "len": len(text)})

    Engineering recommendations:

    • Make failures replayable: Persist intermediate results at each step so that a failure only requires rerunning a single file.
    • Design for idempotency: Use content hashes as processing keys to avoid duplicate ingestion.
    • Control costs: Cache responses for identical inputs and limit the length of each input.
    • Make the system observable: Collect call volume, failure rate, and average latency through a logging service, with monitoring and alerts. Store source materials and attachments in object storage, and host the note repository itself in Git.
    • Back up regularly: Keep local and offsite copies, and perform a recovery drill every quarter.

    7. Common Anti-Patterns

    • Treating saving as learning: The inbox only receives items and never releases them, eventually becoming a digital dumping ground. Set a hard rule to “clear the inbox every week.”
    • Over-relying on links: The entire repository is built from backlinks without atomic notes, and links point to empty files.
    • Letting the model draw conclusions: Delegating judgment to the model causes incorrect conclusions to be cited repeatedly. The model should only extract and suggest.
    • Being tool-driven rather than process-driven: Constantly changing tools and repeatedly migrating formats means the processing workflow is never established.
    • Ignoring provenance: Without a source field, it becomes impossible to judge information credibility six months later.

    8. Implementation Roadmap

    • Week 1: Define the directory skeleton and naming conventions, and import existing materials into the inbox without processing them.
    • Week 2: Define templates and YAML fields, run the “clean—summarize” pipeline end to end, and produce 20 atomic notes.
    • Week 3: Build 3–5 topic MOCs, fill in tag dimensions, and manually review links.
    • Week 4: Produce one topic-level output, such as an article or proposal, review workflow bottlenecks, and formalize scripts and backup policies.

    The core conclusion is simple: unify formats, put structure first, let AI do only the processing, and keep judgment with humans. Only when the knowledge base becomes a system that is searchable, versionable, and automatically processable does AI truly become an amplifier rather than just another tool that sits unused.