Tuesday, April 21, 2026

OpenClaw Mastery: The Complete Knowledge Base Course

OpenClaw Mastery: The Complete Knowledge Base Course by Alex Lew
Complete Masterclass · 2026 Edition

OpenClaw & AI Knowledge Bases:
The Ultimate Mastery Guide

From zero to expert — learn how to build, structure, query, and supercharge your AI knowledge base to unlock recall that never forgets, answers that never hallucinate, and intelligence that grows with you.

10Deep Chapters
50+Prompt Templates
8Platform Reviews
Recall Power
Table of Contents
01
What Is OpenClaw? Architecture & Core Concepts
06
RAG vs. Long Context: Choosing Your KB Strategy
02
Setting Up Your First Knowledge Base
07
Business Use Cases That Transform Teams
03
KB Architecture: Formatting for Perfect Recall
08
Personal Productivity: Your Second Brain
04
Mastering KB Recall: 50+ Prompt Templates
09
Platform Comparison: Which KB Tool Wins?
05
Advanced Techniques: Audit, Update & Version KB
10
Memory Management & AI Consistency
01
Chapter One

What Is OpenClaw? Architecture & Core Concepts

OpenClaw is an open-source, local-first personal AI gateway that transforms how you interact with AI. Instead of logging into dozens of websites, OpenClaw acts as a central command layer — routing your messages from any app you already use (Discord, WhatsApp, iMessage, Telegram) to 35+ AI providers, while maintaining a persistent, growing knowledge base that remembers everything you tell it.

๐Ÿ—️

Gateway Architecture

Runs locally on your machine as a "Gateway" process. It intercepts messages from 20+ messaging channels and routes them to your chosen AI model — all without touching any third-party server.

๐Ÿ”€

Multi-Channel Routing

Connect Discord, WhatsApp, iMessage, Telegram, Slack, and 15+ more. One KB powers all conversations across every channel — your AI always knows who you are.

๐Ÿง 

Dual-Layer Memory

OpenClaw's KB uses Active Memory (semantic search + "Dreaming" synthesis) plus a Memory Wiki (structured claims with provenance tracking) for enterprise-grade recall.

๐ŸŽจ

Canvas (Live Collaboration)

Visual collaboration board accessible from mobile nodes. Co-create diagrams, flowcharts, and content with your AI in real time from iOS or Android.

๐ŸŽ™️

Rich Media Support

Voice transcription, image generation, and video understanding built in. Ask your AI to process a voice note and store the summary directly into your KB.

35+ AI Providers

Route to Anthropic Claude, OpenAI GPT, local Ollama models, vLLM servers, and more. Switch providers per task without losing your KB context.

๐Ÿ›️ The Dual-Layer Memory System Explained

๐ŸŒŠ Active Memory (Dynamic Layer)

The hot layer of your KB — processes incoming information in real time.

  • Semantic Recall: Finds related memories even if you phrase your query differently
  • Dreaming Synthesis: While you sleep, OpenClaw connects dots across all stored memories and generates new insight summaries
  • Grounded Backfill: Fills knowledge gaps by referencing its Memory Wiki before answering
  • Context Injection: Automatically surfaces the 3-5 most relevant memories for every new conversation

๐Ÿ“š Memory Wiki (Structured Layer)

The cold, permanent layer — structured facts with full provenance.

  • Claim Provenance: Every stored fact is tagged with its source, date, and confidence level
  • Contradiction Clustering: Automatically groups conflicting information for you to resolve
  • Entity Pages: People, projects, companies each get their own wiki page that auto-updates
  • Cross-References: Facts link to each other like a personal Wikipedia
โ„น️
OpenClaw vs. Claude Projects

OpenClaw is an orchestration layer — it can use Claude as its AI backbone while adding multi-channel routing, persistent cross-session memory, and a structured wiki layer on top. Think of it as "Claude + superpowers." You can run both simultaneously.

02
Chapter Two

Setting Up Your First Knowledge Base

Your KB is only as powerful as what you put into it. This chapter walks you through the complete setup — from installing OpenClaw to uploading your first documents, to making sure your AI can actually find the information when you need it.

๐Ÿš€ Step-by-Step: OpenClaw Installation & First KB

1

Install the OpenClaw Gateway

Download from docs.openclaw.ai and run the installer. OpenClaw runs as a background service on macOS, Windows, or Linux. It requires no internet connection for local processing.

2

Connect Your AI Provider

In the Web Control UI, navigate to Settings → Providers. Add your Anthropic API key for Claude, or configure a local Ollama instance. For privacy-critical KBs, choose a local model — nothing leaves your machine.

3

Create Your First KB Project

Go to Knowledge → New Project. Name it clearly (e.g., "Work Notes Q2 2026"). Choose your storage backend — local filesystem for privacy, or cloud sync for cross-device access.

4

Upload Foundation Documents

Drag in your most important documents first. Prioritize: SOPs, style guides, project briefs, meeting notes. These become the "constitution" of your KB — the rules your AI will always follow.

5

Write Your KB System Prompt

This is critical. Write 200–500 words telling the AI who you are, what this KB is for, and how to behave. This lives in your Project Instructions and is injected into every conversation.

6

Test with the "Needle" Query

Ask the AI a very specific question about something buried deep in your documents. If it recalls correctly, your KB is working. If not, check chunking settings and document formatting.

๐Ÿ“„ Supported File Types for Claude.ai Projects KB

CategorySupported FormatsNotesRecall Quality
DocumentsPDF, DOCX, TXT, RTF, ODT, EPUBMax 30MB per file via UIExcellent
Structured DataCSV, XLSX, JSONXLSX requires analysis toolGood
Web & MarkupHTML, Markdown (.md)Markdown is strongly preferredExcellent
ImagesJPEG, PNG, GIF, WebPVision-model required for image KBModerate
Audio (New 2026)MP3, WAVTranscribed before indexingVaries
Pro Tip: Always Convert PDFs to Markdown First

PDF extraction introduces noise, broken URLs, and layout artifacts. Converting to clean Markdown before uploading saves ~70% tokens and improves recall accuracy by 16%. Use tools like Pandoc, Marker, or Mathpix for high-quality conversion.

⚠️
KB Size Limits You Need to Know

Claude Projects (UI): 20 files × 30MB, ~200,000 token context. Claude API: 500MB per file, 100GB workspace storage. Paid plans activate RAG scaling up to ~2M token equivalent. Beyond this threshold, switch to an external vector DB.

03
Chapter Three

KB Architecture: Formatting for Perfect Recall

The structure of your KB documents is the single biggest factor in recall quality. Most people dump raw text and wonder why their AI gives vague answers. The difference between 44% recall accuracy and 97% recall accuracy is entirely about how you format your documents.

๐Ÿ“ The 3-Tier KB Architecture

The most effective KB structure mirrors how humans organize knowledge — from global rules to specific details.

  • Tier 1 — Root (CLAUDE.md): <100 lines. Universal rules, your identity, how to always behave. Loaded in every single conversation.
  • Tier 2 — Skills (.claude/skills/): Task-specific playbooks. "When the user asks about X, do Y." Loaded on-demand.
  • Tier 3 — Reference Docs (docs/guides/): Deep factual content, data tables, appendices. Retrieved only when relevant.

๐Ÿ”ฌ Why Formatting Matters: The Numbers

70% Token savings: Markdown vs PDF
+67% Recall boost with context summaries
60.7% Key-value pair accuracy
44.3% Standard table accuracy

Source: 2025-2026 benchmarks by Anthropic, Firecrawl, NVIDIA

๐Ÿ“ The Golden Rules of KB Document Formatting

Optimal KB Document Template (Markdown)
# [Document Title] — [Category Tag] — [Version 1.2] **Last Updated:** 2026-04-18 | **Priority:** HIGH | **Owner:** Alex Lew ## ๐Ÿ“‹ Context Summary (≤100 words — READ THIS FIRST) This document covers [topic]. It applies when [trigger condition]. The most important fact is [key insight]. Supersedes [old document]. ## ๐ŸŽฏ Core Content ### Section 1: [Clear Descriptive Heading] **Key Point:** [Most important fact as a single sentence] Supporting details: - Fact A: value/detail - Fact B: value/detail - Fact C: value/detail ### Section 2: [Clear Descriptive Heading] [Content continues with consistent formatting...] ## ⚡ Quick Reference (Key-Value Format) Status: Active Applies To: Customer support team, SG region Last Review: 2026-Q1 Related Docs: [[Policy-001]], [[SOP-Customer-Refunds]] Exceptions: See Section 4.2 ## ๐Ÿ”— Cross-References - Related: [[Document-B]], [[Policy-X]] - Superseded By: N/A - Depends On: [[Foundation-Guide]]

⚡ Chunking Strategy: Choose Your Weapon

StrategyChunk SizeBest ForAccuracyCost
Fixed Character Split400–512 tokens + 10% overlapGeneral purpose documentsModerateLow
Page-Level Chunking1 page = 1 chunkPDFs, Reports, ManualsHigh (0.648)Medium
Semantic ChunkingTopic-boundary basedLong-form prose, narrativesHigh (+9%)High
Late ChunkingFull doc → then chunkPolicies, contracts, legalHighestVery High
Parent-Child RAGSmall retrieve → large generateAll types (recommended)HighestMedium
๐Ÿ’ก
The Contextual Summary Trick (Anthropic's Secret Weapon)

Prepend a 50–100 token "context summary" to every chunk before it gets embedded. This single technique reduces retrieval failure by 49–67%. The summary explains what the chunk is about in plain English, so the embedding model places it correctly in vector space.

04
Chapter Four

Mastering KB Recall: 50+ Prompt Templates

Knowing how to ask is everything. These prompts are your extraction tools — each one is battle-tested against real knowledge bases to maximize what you get out of every query. Bookmark this chapter. You'll come back to it every day.

๐Ÿ” Pattern 1: EXTRACT — Pull Specific Facts

Use when you need precise, citable information from your KB. Forces the AI to be specific rather than vague.

EXTRACT — Basic
Extract all mentions of [SPECIFIC TERM] from the documents in this project. For each mention: provide the exact quote, document name, and page/section. Format as a numbered list. If none found, say "Not found in KB."
EXTRACT — Structured Data Pull
From the documents in this project, extract the following fields and return as a JSON object: { "key_dates": [...], "responsible_parties": [...], "monetary_values": [...], "action_items": [...] } If any field cannot be found in the KB, return null for that field. Do not guess.
EXTRACT — Pattern Matching
Extract all instances matching this pattern from the knowledge base: Pattern: Any commitment, promise, or deadline made to [CLIENT/PERSON NAME] Format: [Date] | [Who made commitment] | [Exact commitment] | [Document source] Sort by date, most recent first.

⚖️ Pattern 2: COMPARE — Contrast Across Documents

COMPARE — Two Documents
Compare [Document A] and [Document B] from this knowledge base. Structure your comparison as: • Points of agreement (cite both sources) • Points of contradiction (flag these clearly with ⚠️) • Information in A not in B • Information in B not in A • Your recommendation on which source to trust and why
COMPARE — Policy Version Diff
I have uploaded the old and new versions of [POLICY NAME]. Identify every change between them. For each change: 1. What was the old rule? 2. What is the new rule? 3. Who is affected? 4. Does this create any conflict with other policies in this KB?

๐Ÿ”ฎ Pattern 3: SYNTHESIZE — Generate New Insights

SYNTHESIZE — Research Synthesis
Act as a research analyst with access to all documents in this project. Investigate: [TOPIC] Task: Identify the top 5 most counter-intuitive or non-obvious findings. For each finding, provide: - The Finding: A clear, specific claim - The Evidence: Cite at least 2 documents that support it - The Quote: 1-2 verbatim excerpts that anchor this finding - The Implication: What action should I take based on this? Only use information from this knowledge base. Do not add external knowledge.
SYNTHESIZE — Decision Brief
Based on all documents in this knowledge base, create a decision brief for: Decision: [WHAT YOU NEED TO DECIDE] Format: ## Recommendation [One-sentence answer] ## Evidence Supporting This [3-5 bullet points with document citations] ## Evidence Against This [Honest counterarguments from the KB] ## What We Don't Know [Gaps in the KB that affect this decision] ## Confidence Level: [High/Medium/Low] [Explain why]

๐Ÿ”Ž Pattern 4: AUDIT — Check Your KB's Health

AUDIT — KB Quality Check
Analyze the structure and content of this knowledge base. Evaluate for: 1. Content fragmentation (are ideas split across too many documents?) 2. Contradictions (do any documents conflict with each other?) 3. Staleness (are there dated claims that may no longer be accurate?) 4. Gaps (what important topics are NOT covered?) 5. Redundancy (what could be consolidated?) Output: - Severity score 1-10 for each dimension - Top 3 immediate fixes - Long-term structural improvements - Questions I should add to fill gaps
AUDIT — Citation Verification
I will provide you with a response you generated earlier. Verify every factual claim against this knowledge base. For each claim: ✅ VERIFIED — [exact quote from KB that confirms it] ⚠️ PARTIALLY SUPPORTED — [what's confirmed vs. inferred] ❌ NOT IN KB — [claim that cannot be traced to any document] [PASTE RESPONSE TO VERIFY HERE]

๐Ÿ”„ Pattern 5: UPDATE — Keep Your KB Fresh

UPDATE — Ingest New Source
I am adding this new source to the knowledge base: [PASTE NEW DOCUMENT OR DESCRIPTION] Compare it against the existing KB and: 1. List claims in the NEW source that CONTRADICT existing KB entries 2. List new facts that should be ADDED to the KB 3. List existing KB entries that are now SUPERSEDED 4. Suggest which existing document pages need to be updated 5. Draft the updated KB entry for the most important change
UPDATE — KB Gap Finder
Based on the documents in this knowledge base about [TOPIC]: 1. What are the 5 most important questions someone would ask that this KB cannot answer? 2. What external sources should I add to fill these gaps? 3. What internal documents am I probably missing (based on what you can infer)? 4. Rate the completeness of this KB for [USE CASE] from 1-10 with justification.

๐Ÿงฉ Pattern 6: Chain-of-Thought KB Recall

CHAIN-OF-THOUGHT — Deep Recall
Before answering my question, analyze the knowledge base step by step. Use this format inside <thinking> tags: <thinking> Step 1: What documents are most relevant to this question? Step 2: What specific passages address this directly? Step 3: Are there any contradictions I should flag? Step 4: What's missing that would improve my answer? Step 5: Draft my response, grounded only in KB content </thinking> Now provide your final answer. My question: [YOUR QUESTION]
CROSS-REFERENCE — Multi-Document Synthesis
My knowledge base contains multiple documents about [TOPIC]. Read ALL relevant documents before answering. Question: [YOUR QUESTION] Requirements: - Cite every document you draw from using [Doc: filename] - If documents agree, state the consensus - If documents disagree, show both views and state which you find more credible and why - Highlight anything that seems outdated or uncertain
๐Ÿ†
The "Quote-First" Instruction That Eliminates Hallucinations

Add this line to your Project Instructions: "For every factual claim you make, provide a direct verbatim quote in [quote] tags from the KB document, then state your interpretation. Never make a claim without a quote." This single instruction reduces hallucinations by an estimated 60-80% in domain-specific KB queries.

05
Chapter Five

Advanced Techniques: Audit, Update & Version Your KB

A KB that isn't maintained becomes a liability. Stale information gets recalled as fact. Contradictions confuse your AI. This chapter covers enterprise-grade techniques to keep your KB accurate, growing, and conflict-free — automatically.

๐Ÿค–

Auto-Generation with GraphRAG

Microsoft's GraphRAG extracts entities and relationships from raw text to build a structured knowledge graph automatically. Instead of manually creating KB entries, feed GraphRAG your raw notes and it generates community summaries at multiple granularity levels.

Best for: Large unstructured document sets (100+ files)

๐Ÿ”„

Incremental KB Updates (MD5 Hashing)

Hash every source document with MD5. When a document changes, only re-index modified chunks. This maintains vector consistency while saving 90% of re-indexing compute cost. Use DVC (Data Version Control) to track KB snapshots like Git tracks code.

Best for: Frequently updated policy/procedure KBs

๐Ÿ•ต️

Conflict Resolution Framework (ICR)

When two KB documents say different things, you need a priority rule. The ICR framework uses Direct Preference Optimization to teach your AI: "prefer the most recent source," "prefer the regulatory document over internal notes," or "flag all conflicts for human review."

Best for: Multi-source KBs with overlapping content

๐Ÿงช

KB Recall Testing (RAG Triad)

Test your KB with the RAG Triad: Faithfulness (is the answer grounded in KB?), Answer Relevance (did it actually answer the question?), and Context Precision (was the right chunk retrieved?). Use RAGAS or DeepEval for automated scoring.

Best for: Monthly KB health checks

๐Ÿ”ง The Andrej Karpathy LLM Wiki Workflow

This is the gold standard for self-maintaining KBs. Originally designed for AI research notes, it works for any domain.

The 3-Operation KB Maintenance System
# OPERATION 1: INGEST (run when adding new source) INGEST PROMPT: "Analyze [New Source] and the existing KB index. 1. Extract key takeaways from the new source 2. Update the master index entry for [Topic] 3. Update relevant entity pages ([Person], [Project], [Company]) 4. Identify claims that supersede existing KB entries — rewrite those entries 5. Log this ingestion: date, source, key changes made" # OPERATION 2: QUERY (run when seeking information) QUERY PROMPT: "Question: [YOUR QUESTION] Step 1: Read the master index to identify which pages are relevant Step 2: Drill into the specific pages Step 3: Synthesize across pages to form your answer Step 4: If the answer is new knowledge, offer to file it as a new KB entry" # OPERATION 3: LINT (run monthly as KB health check) LINT PROMPT: "Audit the entire knowledge base for: - Contradictions between pages (flag with source docs) - Stale claims superseded by newer sources - Orphan pages with no inbound cross-references - Missing links between related concepts Generate a prioritized fix list with suggested actions."
⚠️
The Janitor Agent Pattern

Set up a recurring "Janitor Agent" in OpenClaw that runs every Sunday night. It performs semantic drift detection — comparing your current KB against a 90-day-old snapshot to find entries where the world has changed but your KB hasn't. Auto-flags entries for your review each Monday morning.

06
Chapter Six

RAG vs. Long Context: Choosing Your KB Strategy

The two dominant approaches to AI knowledge bases — Retrieval-Augmented Generation (RAG) and Long Context Loading — each have distinct strengths. Choosing wrong will cost you in accuracy, speed, or money. Here is exactly when to use each.

DimensionLong Context (Claude Projects)External Vector RAG
KB Size✅ Best for <100 docs / <100K tokens✅ Best for 100K+ tokens, terabyte-scale
Recall Quality✅ Very high — all context visible at once⚠️ Variable — depends on chunk quality
Latency❌ Slow (30–60s for full context load)✅ Fast (<2s per query)
Cost per Query❌ High (pays for every token in context)✅ Low (only pays for retrieved chunks)
Real-Time Updates❌ Requires re-upload✅ Instant re-indexing
Global Reasoning✅ Can synthesize across all documents❌ May miss cross-document connections
Setup Complexity✅ Zero — just upload files❌ Requires vector DB setup and maintenance
Best ForPersonal KBs, research synthesis, small teamsEnterprise KBs, customer-facing chatbots, large orgs

๐Ÿ› ️ Top RAG Tools for Personal KB Systems

๐Ÿฆ™

LlamaIndex

Best for connecting to external data sources. Comes with pre-built connectors for Obsidian, Notion, Slack, Google Drive, Confluence. Use it as your data ingestion layer.

Data-Centric
๐Ÿ”—

LangChain

Best for orchestrating multi-step KB workflows. Build "chains" that retrieve, reason, and act. Use for complex agentic KB workflows with conditional logic.

Workflow-Centric
๐ŸŽฏ

AnythingLLM

Best for non-technical users. All-in-one desktop app with built-in vector DB, document parser, and local LLM support. Zero configuration required.

Beginner-Friendly
๐Ÿ—„️

Chroma

The best local vector database. Open-source, runs entirely on your machine, integrates with LangChain and LlamaIndex. Start here for private KBs.

Local-First
๐ŸŒฒ

Pinecone

The best managed cloud vector DB. High performance, fully managed, scales to billions of vectors. Use when you need production-grade reliability without infrastructure work.

Cloud / Paid
๐Ÿ”ฎ

Weaviate

Best for hybrid search (vector + BM25 combined). Open-source with a managed tier. GraphQL-style queries make it powerful for complex KB retrieval logic.

Hybrid Search
๐ŸŽฏ
The Decision Rule: 100K Token Threshold

If your total KB content is under 100,000 tokens (~75,000 words), use Claude Projects long-context. It's simpler, more accurate, and requires zero infrastructure. Only switch to external RAG when your KB exceeds this threshold or when you need real-time updates and sub-2-second query latency.

07
Chapter Seven

Business Use Cases That Transform Teams

These are not hypothetical. Every use case below is backed by verified enterprise case studies with measurable productivity gains. Your industry is here — find it, steal the workflow, adapt the prompts.

360KLegal hours saved/yr (JPMorgan COiN)
75%HR tickets reduced (IBM AskHR)
50%Queries auto-resolved (Intercom Fin)
40%Dev productivity boost (Palo Alto)
95%Contract review time cut (Signifyd)
64%GTM productivity gain (Anthropic)
๐ŸŽง

Customer Support: Instant Answer Machine

Used by: Intercom, Unity, Zendesk customers

The Setup: Upload your entire help center, product documentation, FAQ database, and escalation procedures into a Claude Project. Use this as the backbone for your support AI.

Support KB Prompt Template
You are a customer support specialist for [COMPANY]. The knowledge base contains our complete product documentation, policies, and troubleshooting guides. Customer message: [CUSTOMER MESSAGE] Respond by: 1. Identifying the core issue from the message 2. Finding the exact answer from the knowledge base (cite the source document) 3. Providing a clear, friendly response in plain English 4. If the answer isn't in the KB, say: "I'll escalate this to our specialist team" — do not guess
+50% auto-resolution-80% response timeZero hallucinations
⚖️

Legal: Contract Intelligence

Used by: JPMorgan COiN, Signifyd, Spellbook

The Setup: Upload all active contracts, NDAs, SLAs, and vendor agreements. Build a KB that answers "what does our contract with X actually say?"

Legal KB Prompt Template
Find all active contracts in this knowledge base that contain 'Change of Control' clauses. For each contract: - Contract name and party names - Exact quote of the Change of Control clause - Notice period required - Any carve-outs or exceptions - Whether this contract has a liability cap, and the exact amount Flag any contract where the notice period is less than 30 days — these are high risk.
95% faster review360K hrs saved/yrZero missed clauses
๐Ÿ‘ฅ

HR: Policy Navigator

Used by: IBM AskHR, Johnson Controls

The Setup: Upload the employee handbook, benefits guide, leave policies, performance review processes, and compensation bands for each region. Employees query instead of emailing HR.

HR KB Prompt Template
You are an HR policy assistant. All policies in the knowledge base are current as of [DATE]. Employee question: [QUESTION] Answer using only the policy documents in this KB. For each policy you cite: - Name the specific policy document - Quote the relevant section verbatim - Explain what this means in plain language - If different policies apply to different regions (SG, MY, ID), show each separately Never give generic HR advice. Only cite what the actual policy documents say.
-75% HR tickets-40% operational cost24/7 availability
๐Ÿ’ป

Software Dev: Codebase Navigator

Used by: Palo Alto Networks (Sourcegraph Cody), Harness (GitHub Copilot)

The Setup: Upload your CLAUDE.md, architecture docs, API specs, coding standards, and key service READMEs. Create a KB that every developer on your team queries before writing code.

Developer KB Prompt Template
Based on the codebase documentation in this knowledge base: Task: [WHAT I NEED TO BUILD] Before writing any code: 1. Identify existing patterns/utilities in our codebase that I should use (cite the doc) 2. Flag any coding standards that apply to this task 3. List any API endpoints or services I should integrate with (cite the spec) 4. Warn me about any known pitfalls or deprecated patterns I should avoid 5. Suggest the correct file location for this new code based on our architecture Then write the implementation following all identified patterns.
+40% productivity-3.5h cycle timeZero regressions
08
Chapter Eight

Personal Productivity: Your Second Brain

The most underused application of AI knowledge bases is personal — your own notes, research, life context, and experiences. This is where AI stops being a generic tool and becomes your personal cognitive extension.

๐Ÿง 

The Second Brain KB Setup

Build an AI that knows everything about you — your projects, goals, relationships, and history.

Life Context Prompt
I'm meeting with [NAME] tomorrow. Based on my notes: - What did we last discuss? - What commitments did I make? - Any personal details I should remember? - What should I follow up on?
๐Ÿ“–

Research & Writing KB

Maintain a "vetted sources" KB for your research domain. Only AI-hallucination-free writing.

Research Synthesis Prompt
Based ONLY on articles in my 'Climate Tech' folder, write a 500-word summary of challenges in solid-state battery manufacturing. Do not use outside knowledge.
๐Ÿ“š

Study & Learning KB

Turn your study notes into an active recall system with AI-generated quizzes.

Active Recall Prompt
Act as my tutor. From my Quantum Physics notes, generate 5 challenging recall questions. Wait for my answer before revealing the next. Grade me at the end.
๐Ÿ’ฐ

Personal Finance KB

Upload 3 months of spending logs and let AI identify patterns and savings opportunities.

Finance Analysis Prompt
From my spending logs, compare Dining vs. Groceries over the last 3 months. Where is the biggest reduction opportunity? Give specific amounts, not percentages.

๐Ÿฅ Health Diary KB — Your Medical Memory

HEALTH DIARY — Monthly Synthesis for Doctor Visit
Summarize my health notes from the past 3 months. Create: 1. SYMPTOM FREQUENCY CHART: Which symptoms appeared most often? On which dates? 2. TRIGGER PATTERNS: What activities, foods, or stressors preceded each symptom cluster? 3. MEDICATION RESPONSE: How have I responded to each dose change? Quote my own entries. 4. PROGRESS SINCE LAST VISIT: What improved? What got worse? 5. QUESTIONS FOR MY DOCTOR: Based on patterns in my notes, what 5 questions should I ask? Format this as a 1-page document I can hand to my doctor.
๐ŸŒŸ
The "Relationship Memory" KB (Game Changer)

Create a dedicated KB of notes about every important person in your life — what they care about, past conversations, commitments made, their preferences. Before every meeting, run the "I'm meeting with [NAME]" prompt. Users report this dramatically improves relationship quality and eliminates the embarrassment of forgetting important details.

09
Chapter Nine

Platform Comparison: Which KB Tool Wins in 2026?

Eight major platforms, one comprehensive comparison. Updated for April 2026 with current pricing, actual KB limits, and honest recall quality assessments from independent benchmarks.

PlatformKB LimitFile TypesRecall QualityPrice/moBest For
๐ŸŸฃ Claude Projects 20 files × 30MB
API: 100GB workspace
PDF, DOCX, MD, CSV, XLSX, MP3, WAV Very High $20–30 Research synthesis, nuanced reasoning, personal KB
๐ŸŸข Google NotebookLM 50–600 sources
500K words/source
PDF, Docs, Slides, YouTube, URL, Audio Highest (grounded) Free – $250 Fact-checking, source-specific recall, podcast generation
๐Ÿ”ต ChatGPT GPTs 20 files × 512MB
Pro: "unlimited"
All major formats, ZIP, code Moderate (RAG) $20–200 Broad task GPTs, code, image+document together
⬛ Notion AI Unlimited pages
50MB/upload
PDF, CSV, MD, HTML, DOCX Moderate $18 + AI add-on Teams already on Notion, project + KB in one place
๐Ÿ”ท Obsidian + AI Unlimited (local)
Hardware only limit
Markdown, PDF, Images Variable (plugin) Free + API cost Privacy-first power users, local-only knowledge
๐ŸŸก Mem.ai Unlimited auto-index MD, TXT, Email, Calendar High (semantic) $14.99 Personal second brain, zero-organization note takers
๐Ÿ”ด Perplexity Spaces 50–5,000 files/Space
25-50MB each
PDF, CSV, TXT, Images High + Web $20–325 Research needing web + internal KB combined
๐Ÿ”ต Microsoft Copilot 512MB/file
2,048 row list limit
SharePoint/OneDrive all types Variable (metadata) ~$20–30 add-on Microsoft 365 organizations with good SharePoint hygiene
๐Ÿ†
Winner for Recall Accuracy: NotebookLM

NotebookLM's source-grounded architecture tops every independent "faithfulness" benchmark. Every answer cites its source inline. If you need zero-hallucination recall, this is your tool.

๐ŸŽฏ
Winner for Reasoning Quality: Claude Projects

For nuanced synthesis, multi-step reasoning, and acting on complex KB content, Claude's 200K token context window with full reasoning capability is unmatched by any RAG-based competitor.

10
Chapter Ten

Memory Management & AI Consistency

The final frontier — making your AI consistent across time. Without memory management, every conversation with your AI starts from zero. With it, your AI remembers your preferences, style, decisions, and context across hundreds of sessions.

๐Ÿ’ญ

ChatGPT Memory

Auto-extracts facts from conversations ("I prefer Python") and stores them for future sessions. Agentic — the AI decides what to remember. You can view, edit, or delete memories. Best for personal preference persistence.

๐Ÿ—‚️

Claude Project Instructions

Static KB system prompt that loads in every conversation within a project. Best practice: write it in XML tags for maximum parsing clarity. Update it when your context or role changes.

๐Ÿ““

Mem0 (Hybrid Architecture)

Combines vector DB (semantic search) + knowledge graph (relationships) + key-value store (preferences). Extracts salient facts from conversation streams with importance scoring, recency weighting, and intelligent decay.

๐Ÿ”ง Writing the Perfect System Prompt KB

Your Project Instructions (system prompt) is a lightweight but powerful KB layer. Here is the gold standard template used by AI power users:

Master System Prompt KB Template
<identity> You are [NAME]'s personal AI assistant. [NAME] is [ROLE] at [COMPANY]. Current date: [DATE]. Current focus: [CURRENT PROJECT/GOAL]. </identity> <knowledge_base> The documents in this project contain [NAME]'s [WHAT THE KB COVERS]. When answering, always search the KB first. Never answer from general knowledge if the KB contains relevant information. </knowledge_base> <behavior_rules> 1. Always cite your source document before making factual claims 2. If information is not in the KB, say "Not in KB" — do not guess 3. Format responses as: [PREFERRED FORMAT — bullets/prose/tables] 4. Response length: [SHORT/MEDIUM/COMPREHENSIVE] 5. Tone: [PROFESSIONAL/CASUAL/TECHNICAL] </behavior_rules> <important_context> - [KEY FACT 1 about your situation] - [KEY FACT 2 about your preferences] - [KEY FACT 3 about ongoing projects] - [KEY RELATIONSHIP or constraint to always remember] </important_context> <memory_instructions> If I share new information that updates existing KB content, acknowledge it and remind me to update the relevant KB document. Never silently incorporate new information without flagging the update needed. </memory_instructions>

๐Ÿงฉ Token Window Management for Large KBs

✂️

Context Pruning

Remove low-importance tokens from conversation history. Use the "Compress and Continue" prompt: "Summarize our conversation so far in 200 words, then continue from where we left off."

๐Ÿ“

Recursive Summarization

Automatically summarize old conversation turns as the context window fills. The AI sees a summary of past turns rather than the full text, freeing space for new KB queries.

Just-In-Time Loading

Don't load your entire KB upfront. Use the "Context Rotation" pattern — load only the KB documents relevant to the current task. Rotate in new documents as the task shifts.

๐Ÿ”ฎ
The Future: Mem0 + OpenClaw Integration

The 2026 frontier for personal KB is combining OpenClaw's multi-channel routing with Mem0's hybrid memory architecture via MCP (Model Context Protocol). This creates an AI that observes all your conversations across every app, extracts salient facts, stores them in a personal knowledge graph, and surfaces relevant memories in future conversations — automatically, without any manual KB maintenance.

Bonus Chapter

The Master Cheat Sheet

Everything you need in one place. Copy this. Pin it. Use it daily.

๐Ÿ“‹ KB Setup Checklist

  • Convert all PDFs to Markdown before uploading
  • Add 50-100 word Context Summary at top of every doc
  • Use Key: Value format for structured data
  • Create CLAUDE.md as your Tier 1 root instruction
  • Add cross-reference links between related documents
  • Tag every document with date, owner, and priority
  • Write a "Needle" test query to verify KB is working
  • Run AUDIT prompt monthly to find conflicts and gaps

⚡ Highest-Impact Prompts

  • EXTRACT: "Extract all [X] with exact quotes and document sources"
  • COMPARE: "Compare [A] and [B], flag all contradictions with ⚠️"
  • SYNTHESIZE: "Find the 5 most non-obvious insights, cite every source"
  • AUDIT: "Find contradictions, stale claims, and gaps in this KB"
  • UPDATE: "Compare new source against KB, list what changed"
  • VERIFY: "For each claim in this response, find the KB quote or flag ❌"
  • GAPS: "What 5 important questions can this KB NOT answer?"
  • DECIDE: "Based only on KB evidence, recommend [decision]"

๐Ÿ† Format Rankings (by Recall Quality)

  • ๐Ÿฅ‡ Markdown with Key-Value pairs — 60.7% accuracy
  • ๐Ÿฅˆ Clean Markdown prose — ~55% accuracy, 70% fewer tokens vs PDF
  • ๐Ÿฅ‰ Structured XML tags — excellent for system prompts
  • 4th Plain TXT — good fallback, no formatting overhead
  • 5th CSV/JSON — 44.3% accuracy, needs prose conversion
  • Raw PDF — worst recall, fragmented extraction, URL breakage

๐Ÿšฆ Platform Decision Guide

  • Personal KB, <100 docs → Claude Projects
  • Need source citations always → NotebookLM
  • Microsoft 365 org → Copilot + SharePoint
  • Research + web combined → Perplexity Spaces
  • Zero-org personal notes → Mem.ai
  • Privacy-first, local-only → Obsidian + Khoj/Ollama
  • Enterprise scale RAG → Pinecone + LlamaIndex
  • Team workspace + KB → Notion AI