Does Your AI Agent Need Live Web Search or a Local Knowledge Base?

Personal knowledge is the real AI edge

Foundation models default to average public practice or to whatever sits in the current repository. Those defaults often miss your writing voice, coding standards, and architecture choices. Project READMEs describe the system that already exists; they lag new use cases.

A local personal knowledge base fixes that gap. You turn curated mail, notes, books you have rights to keep, and style guides into searchable Markdown with stable IDs, priorities, and source attribution. Agents query that corpus through a skill, a CLI or API, and a standing policy that forces consult before invention. Shared personal context across coding agents stops each session from inventing new standards.

In outline, the portable part looks like a small repo: a catalog, Markdown documents the agent reads, skills that teach how to search, and optional local indexes you rebuild on each machine. Details and the query path come later; this is the shape.

Loading...

What you gain in daily work

  • Fewer taste regressions: the agent already knows your voice, practices, and architecture preferences.
  • Faster answers under pressure: import a resource, set its priority, and the next session can use it without updating every project README.
  • Compounding personal IP: notes, newsletters, references, and books form a portable operating layer for how you work with AI.
  • Clean multi-host portability: agent-essential Markdown and the manifest travel in version control; indexes and raw sources stay local.

Your notes for your agents, not a shared company product

Search results often mix two different problems. One is a personal collection of notes and standards you keep for your own coding agents. The other is a shared company knowledge base where many people (and their AIs) read and change the same documents under access control.

This essay is the first problem: git, cleaned Markdown, a simple catalog, a query skill, and a standing rule that the agent must consult your notes before inventing new standards. It is not a shopping list of hosted products. Team tools (shared wikis the AI can update, company search over internal docs, seat-based assistants) matter when a whole group shares one corpus and proposed edits must go live for everyone. That is the wrong buy if you only need a personal base on your own machines.

When do those team products earn a look? When several people own the same standards, when edits need review before they affect every coworker’s assistant, or when customers or tenants must stay isolated from each other. Until then, keep AI-proposed changes behind a human review (later in this article). A shared company product is a different category, not an automatic upgrade from this pattern.

Knowledge base architecture: ingestion, priority, and metadata

Gather documents, normalize them into agent-readable text, index them, and assign explicit priority so conflicts resolve in a predictable order. Highly curated opinion and style guides outrank background newsletters on the same topic.

Useful starting sources:

  • Newsletters and long-form mail: technical patterns, architecture notes, and domain references worth keeping.
  • Local files: Markdown notes, style guides, architecture references, PDFs, and books you have the right to keep privately.
  • Explicit opinion documents: short statements of how you want work done: coding style, writing voice, review rules, and operating constraints.

Concrete conflict: an agent asks how you write prose. A personal writing style guide (high priority, kind opinion) beats a newsletter that mentions writing tips (lower priority). Without priority, both look like "relevant text." With priority, the agent follows your IP.

Attribution stays built in. Agents cite document sources so answers remain traceable and original authors are not erased.

Formats that work for an agentic knowledge base

Keep the format split boring and strict. Agents need one primary body format; the catalog needs one structured metadata format. Everything else is ingest input or human viewing.

  • Agent body of truth: cleaned Markdown. Stable headings, explicit lists, and citable paragraphs beat pretty layout.
  • Catalog / manifest: JSON Lines (one JSON object per document) or equivalent structured rows for IDs, paths, topics, kinds, priorities, and source metadata.
  • Humans only: HTML or PDF when diagrams and layout matter. Generate or keep them beside the Markdown; do not make them the agent’s primary read path.

Poor primary inputs for agents: raw HTML with chrome and ads, screenshots without text extraction, and large binaries checked into git. Ingest those sources, extract text (and mirror assets locally), then store the cleaned Markdown the agent will cite. Good enough rule: one body format agents read + one catalog format for metadata. Indexes (keyword or embeddings) stay derived and rebuildable.

Humans browse HTML or PDFs when layout and diagrams matter. Agents read Markdown. Dual access keeps the same corpus useful for both audiences without forcing agents through browser-only formats.

Ingest covers more than plain notes. Attachments, PDFs, and diagrams enter as first-class ingest types. Mirror images and other assets locally when the original HTML depends on external URLs that later break. Keep raw backups of mail and source files so you can re-run extraction when transforms improve; the catalog Markdown stays the day-to-day source of truth for agents. For external web pages, RSS feeds, or news before you convert them to Markdown, a lightweight PyArrow Acero and Delta Lake ingestion pipeline can parse and store documents with ACID writes.

Validate ingest before you trust the corpus. Spot-check IDs, authors, topics, body text, and asset links after each pipeline run. A broken import that ships to every agent host is worse than a missing document.

A short build path

  1. Choose what is agent-essential versus local-only.
  2. Ingest: import mail, notes, PDFs, attachments, and references with explicit kinds and priorities. Confirm you have rights to keep private copies of books and mail you ingest.
  3. Validate ingest (IDs, bodies, metadata, assets) before agents rely on the corpus.
  4. Classify topics so search can narrow.
  5. Index for keyword search; add embeddings in the derived layer if semantic recall pays off.
  6. Ship a query skill that teaches search-then-cite, not guess-then-improvise.
  7. Expose the same operations through a CLI or API (search, topics, index rebuild).
  8. Install skill wiring and rebuild the local index on each machine where you run agents.
  9. Add a standing policy: before inventing coding or writing standards, consult the personal base.
  10. Run publish checks so raw sources and indexes never leave the machine via Git.

Human gates sit in front of destructive source cleanup. Analysis and filters can be automatic; bulk delete of mail or raw files stays under explicit human selection. False positives on billing or account messages are expensive. Trust retrieval more than bulk mutation.

How coding agents query the base (without indexing every source)

The agent does not need a map of every file on disk, and you do not need a separate full-text index of every upstream mailbox, wiki, or ticket system. You need a stable entry point that can search the catalog, open the chosen Markdown files, and return the source references used. Sources you never ingested simply are not in the catalog, on purpose.

What each part of the tree does

Going back to the layout from the intro, the roles split cleanly:

  • data/kb/manifest.jsonl: the catalog. One JSON object per document with stable ID, path, subject, topics, source kind, and priority. This is what search filters and ranking metadata come from.
  • data/kb/documents/: cleaned Markdown bodies. Path matches the document ID. This is what the agent actually reads and cites.
  • data/kb/html/ and assets/: optional human views and mirrored images. Local or offline; not the agent’s primary read path.
  • data/kb/index/: derived keyword (and optional embedding) indexes. Rebuild after ingest or after cloning on a new machine. Do not treat the index binary as source of truth in git.
  • .agent/skills/: procedures (when to search, how to filter, how to cite). Skills teach process; they do not replace a standing policy that forces consult.
  • src/: CLI or library that implements the same search, topic list, and index rebuild operations agents call as tools.

A concrete catalog and file layout look like this:

Loading...

Query path end to end

A query starts with the skill, CLI, API, or MCP server. That tool resolves the knowledge-base root, reads the manifest, searches the index, applies filters (topic, minimum priority, kind), opens the top Markdown hits, and returns a small set of cited sources. The agent answers from those sources instead of inventing a convention from memory.

Keyword full-text search fits exact terms, IDs, author names, and phrases you already know. It is cheap to rebuild and easy to inspect. Embeddings help when queries use different wording than the source text. A practical setup combines both: keyword recall, vector similarity, then a final rank that also boosts stored priority from the manifest.

Stored metadata lives in the manifest. Runtime relevance scores are computed during search. Embeddings live only in the derived index layer. Rebuild them after import or after pulling new documents on another machine, the same way you rebuild a keyword index. Content hashes in the manifest tell you which rows changed so you can refresh index entries without a full blind rebuild every time.

Skill, policy, and CLI (all three)

A skill file teaches procedure. It does not guarantee use. Without a standing instruction, agents fall back to training defaults and invent conventions you already wrote down. That is the core pain of missing persistent personal context: every coding agent rediscovers “your” style from scratch.

  • Query skill: resolve the knowledge-base root, search, filter, read top hits, cite document IDs and source metadata.
  • CLI or API: the same search, topic listing, and index rebuild operations for automation and for agents that call tools instead of reading a narrative skill alone.
  • Standing policy: editor rules or agent config that inject “consult the personal KB first” when the task touches style, architecture preferences, or how you usually work.

Editor and agent products wire this differently (Cursor Rules, Claude Code config, MCP servers, skill directories). The pattern stays the same: portable corpus and CLI; force-consult policy installed per product. Specialize beyond the query skill when a domain needs a fixed procedure (for example a review playbook). Keep those skills thin: they call into the corpus or encode a short workflow; they do not duplicate the whole library.

Live web search or a static personal knowledge base?

Use the personal knowledge base when the answer should follow your standards, taste, private notes, or IP you already curated. Use live web search when the facts change in public (vendor docs you do not own, release notes, APIs you have not ingested yet).

A practical hybrid: search the open web to find candidates, then ingest the pages worth keeping into the KB with an explicit priority. Next session, the agent cites your frozen copy instead of re-discovering a different blog post. If the source is still moving fast, leave it as live search until you are ready to pin a version.

Personal corpus vs company knowledge

This page is about a personal corpus on your machines. Coding agents at work often need company knowledge instead: tickets, standards, wikis, and systems that were never written down in one folder. Dumping every source into a personal Markdown tree is the wrong move. Company access needs connectors, a designed corpus, and access control so agents query live systems or curated company docs without building a second shadow index of everything. That design is a different project from the personal pattern here. For curation, drift between repos and central docs, approval gates, and the tech that tends to work now, see Company Knowledge Bases for AI Agents: Curation, Drift, and Live Access.

When agents write: human gates, not silent corpus edits

Agents should read the personal base freely. They should not silently rewrite it. Letting an agent “improve remediation scripts from past tickets” or invent new standards into the corpus without review is how taste and provenance rot.

Reindexing can be automatic. After you accept a document, rebuilding keyword or embedding indexes on a schedule or on content-hash change is fine. That is machinery. Adding to the knowledge base is not. On a personal KB, deciding what enters the corpus stays a curated process owned by you: draft if you want, then you set kind and priority and ingest. A review skill can checklist tone, duplication, and source attribution, but merge stays human. Destructive cleanup of mail or raw sources stays behind the same kind of gate.

The same rule scales to company knowledge bases. You do not want every ticket, every Confluence page, and every legacy Word doc in the retrieval path. You vet sources so assistants rely on company-approved, continuously updated material, not abandoned process docs that still rank in search. Keeping every document aligned with how the company actually works is hard even before AI. AI can draft updates and surface candidates, but it does not remove the risk of drift: projects and code repositories move, centralized KB pages lag, and agents start citing yesterday’s process as today’s rule.

That is why serious company setups need always-on monitoring and drift detection between living systems (repos, tickets, runbooks in use) and the curated corpus, plus review queues before agent-proposed edits go live for everyone. Shared company products earn their keep in that approval and governance layer. For a personal base, a PR or manual ingest is enough; the index rebuild can still be automatic once you have accepted the change.

Portability and easy setup

Portability depends on a clean split between durable source data and generated local artifacts. Git holds what agents need on every machine. Local storage holds heavy, private, or regenerable material.

Git-backed portable setup:

  • Manifest catalog: document IDs, kinds, priorities, topics, authors, paths, content hashes
  • Cleaned Markdown bodies (agent source of truth)
  • Query skill(s), install helpers, and CLI or API code

Local only (or offline backup):

  • Raw sources (mail payloads, original files before cleanup)
  • Human HTML views and mirrored assets
  • Generated search indexes (keyword and embeddings)
  • Sensitive identity or contact data, kept out of the coding-agent pack

Stored metadata lives in the manifest: stable IDs, source kinds, priorities, topics, authors, and content hashes. Runtime relevance scores are computed at query time. They do not belong in the catalog as frozen ranks.

Content hashes detect document change. When a body or metadata row changes, rebuild or refresh the affected index entries. Fresh clones rebuild the derived index from Markdown plus manifest; they do not need a checked-in index binary.

Publish checks block raw payloads, generated indexes, and private paths from entering Git. Prefer publishing what you can share publicly; keep the private KB as an edge, not as erasure of upstream sources.

Lessons and pitfalls

  • Start with provenance, not embeddings. Stable IDs, source kinds, authorship, and citation are harder to retrofit than search quality.
  • Dual access from day one. Humans get HTML or PDFs; agents get Markdown.
  • One body format, one catalog format. Do not make screenshots or raw HTML the agent’s source of truth.
  • Mirror visual assets. Diagrams that depend on external URLs disappear later.
  • Filter hard. A personal KB is an opinionated corpus, not a mirror of your inbox.
  • Keep raw backups; treat catalog Markdown as durable day-to-day text. Re-run extraction when transforms improve.
  • One priority score. Extra quality metrics slow conflict resolution.
  • Skill plus policy plus CLI. Narrative alone sits unused.
  • Read freely; write behind a gate. Agent drafts are fine. Silent corpus edits are not.
  • Do not over-engineer distribution. Markdown and manifest in normal Git beat heavy release packs for agent access.
  • Do not confuse personal and company corpora. Connectors and ACLs are a different design than a local Markdown tree.

Next step

Start small: one manifest, a few Markdown files with priorities, and a query skill that cites. Add search and indexes once the corpus earns them.

If you work on a shared company corpus instead, read Company Knowledge Bases for AI Agents: Curation, Drift, and Live Access.

Want a second opinion on either setup?

Get in touch