Personal RAG vs Context Files vs a Context Layer: Which Do You Actually Need?
If you want AI to work from your knowledge and your context, you've probably run into three approaches: build a perso...

If you want AI to work from your knowledge and your context, you've probably run into three approaches: build a personal RAG system, write context files, or use a context layer. They get discussed as if you have to pick one. You don't — they solve different problems, and the useful question is which problem you actually have.
Personal RAG vs context files vs a context layer: what's the difference?
In one line each:
- Personal RAG retrieves relevant pieces from your documents on demand, by meaning.
- Context files give a project static, written instructions an agent reads at the start.
- A context layer gives every tool portable, structured context about you, kept current.
RAG is about searching your knowledge. Context files are about a project's rules. A context layer is about who you are, everywhere. Different objects, different jobs.
What is personal RAG, and when is it right?
Personal RAG (retrieval-augmented generation) lets you chat with your own documents. You index your notes, PDFs, and files into a vector store; when you ask something, it retrieves the semantically relevant chunks and feeds them to the model. You can build one no-code with tools like NotebookLM or Obsidian Smart Connections, or roll your own with LangChain or LlamaIndex plus a vector database like Pinecone or pgvector.
It's the right tool when you have a large body of knowledge to query — a research corpus, a document archive, years of notes — and you want answers grounded in it with citations. "What did I save about pricing strategy last year?" is a perfect RAG question.
Its limit is what RAG fundamentally is: a retrieval primitive, not understanding. It fetches documents similar to your query — that's one function. As one analysis put it, an agent drawing its entire context from a vector store has wired up a single slot out of many; retrieving relevant chunks isn't the same as the model knowing who you are, what you're working on, or how you operate. RAG finds documents. It doesn't supply identity or current state.
What are context files, and when are they right?
Context files are Markdown files — AGENTS.md, CLAUDE.md — placed in a project to give an AI agent static, project-specific guidance: build commands, conventions, constraints. The agent reads the file at the start of a session so you don't restate the project's rules each time.
They're the right tool for project-scoped, relatively stable instructions — especially in coding. When "here's how this codebase works and what not to touch" needs to be consistent across every session in that repo, a context file is exactly right. (More on them in What Is a Context File?.)
Their limits are scope and upkeep. A context file describes a project, not you — it doesn't travel across your other work, and it lives in one repo read by one tool. And it's static: you maintain it by hand, so it drifts as things change. Great for the codebase in front of you; not built to carry who you are across everything you do.
What is a context layer, and when is it right?
A context layer holds structured context about you — your identity, role, current work, preferences — outside any single tool, and delivers it to all of them through MCP, kept current from your real sources.
It's the right tool when your problem is "every AI tool I use starts not knowing me." Not a specific document corpus (that's RAG), not one project's rules (that's a context file), but the portable who-you-are that should follow you across Claude, ChatGPT, Cursor, and whatever's next. You set it up once and every tool starts informed, without re-explaining yourself or maintaining a file per project.
Its job isn't to retrieve your documents or hold a repo's conventions — it's to be the consistent, current foundation of context that every tool can load. Different layer, different problem.
Which should you use?
Start from the problem, not the tool:
- Need to query a large body of your own documents? Personal RAG.
- Need an agent to follow a project's rules and conventions? Context files.
- Need your AI tools to know who you are, everywhere, without re-explaining? A context layer.
And often the answer is more than one. A realistic setup might use RAG to search a research archive, context files to govern a codebase, and a context layer so every tool knows the person behind both. They stack: retrieval for your knowledge, files for your projects, a layer for you. The mistake isn't picking the "wrong" one — it's assuming one of them does all three jobs. None does. Match the tool to the problem, and combine them where your work spans more than one.
→ The knowledge-retrieval angle: What Is Karpathy's LLM Wiki?
→ The project-file angle: What Is a Context File?
→ Set up your context layer with Unabyss →