Building a Personal Knowledge Base for AI: A Memory Layering Approach That Actually Understands You
This article explains why loading more skills into an AI assistant fails to make it feel personalized, and how a layered memory architecture solves the problem. You will learn the three memory layers—user profile, domain facts, and operational workflows—along with a fixed retrieval order, context budget rules, a four-stage implementation plan, and regression metrics for ongoing evaluation.
1. Skills First or Memory First: A Common Setup Mistake
In the early stage of building a personal knowledge base, most people take the same wrong turn: they load as many skill plugins as possible—document generation, chart drawing, coding assistance, device control, schedule management—until dozens are installed and it feels like “all capabilities are complete.” The problems surface as soon as real usage begins.
The first typical scenario is generating a weekly report. The assistant produces output with clean formatting and a standard structure, but it does not match the template you have used for a long time: heading font size, line spacing, numbering style, and section order are all “correct but wrong.” What it gives you is not your weekly report, but a generic one that could belong to anyone.
The second typical scenario is querying a commonly used parameter. The assistant first replies “searching,” waits tens of seconds, then says “no relevant information found in memory.” A simple lookup takes longer than manually searching through your notes.
The two problems look unrelated, but the root cause is identical: the information that should be remembered is not remembered, and the information that is remembered is not categorized correctly. Skills solve “can it be done”; memory solves “does it understand you.” When memory is missing, more skills mean more generic output, longer retrieval paths, and a worse experience.
2. Root Cause Analysis: Not a Memory Failure, a Classification Failure
Take weekly report generation as a full retrospective. Suppose the required information is actually scattered across three places: one stores personal preferences, one stores structured factual data, and one stores project process records. Retrieval must visit all three sources in sequence, and each covers only one facet of the information, so the full context is assembled piece by piece. Three copies are stored, yet queries become slower.
The essence of the problem is mixing three types of semantically different information into the same memory space:
- Who you are (user profile): for example, “use Heiti 18pt for top-level headings,” “zero tolerance for fabricated product features,” “organize weekly reports by project rather than timeline.”
- What you know (domain facts): for example, device qualification numbers, interface parameter ranges, version release dates, internal terminology mappings.
- How you work (operational workflows): for example, the step sequence for generating a weekly report, review checklists, pre-release validation steps, exception rollback paths.
The three types differ in change frequency, trust requirements, and retrieval timing. The user profile changes very slowly but affects every output; domain facts change moderately and demand high accuracy; operational workflows are relatively stable but must be loaded completely by step. Once mixed together, every retrieval performs a full match against noise—slow and inaccurate.
3. Target Architecture: Three Memory Layers and One Retrieval Chain
The recommended memory layering is as follows, with single responsibility and no overlap between layers.
| Layer | What it stores | Change frequency | Loading strategy |
|---|---|---|---|
| L1 User Profile | Expression preferences, formatting rules, prohibitions, default output length | Very low | Always in context, highest priority |
| L2 Domain Facts | Parameters, IDs, terminology, versions, structured data | Medium | Retrieved on demand, with source and timestamp |
| L3 Operational Workflows | Task steps, validation checklists, rollback strategies | Low | Loaded as a whole by task type |
A reliable retrieval chain follows a fixed order: read L1 first to determine “how to express,” match L3 by task to determine “how to do it,” then retrieve L2 to fill in “what data to use.” The value of a fixed order is reproducibility—when output does not meet expectations, you can quickly locate whether a preference is missing, a workflow is missing, or data is outdated.
A sample memory entry structure (pseudocode, only expressing field design intent):
memory_entry:id: unique identifierlayer: L1 | L2 | L3scope: applicable scope (global/project/task type)content: body textsource: source descriptionupdated_at: last update timeconfidence: confidence level (required for facts)ttl: expiration time (recommended for volatile facts)
The confidence and ttl fields are the most easily overlooked, yet they directly determine the reliability of the fact layer: low-confidence entries should not go directly into answers, and expired entries should trigger re-confirmation rather than silent use.
4. Context Budget: The Key to Fixing “Verbose and Slow”
Long-winded answers and slow responses are usually not a model capability problem but a context loading strategy problem. Introduce budget constraints and allocate limited context to the highest-value information:
- Keep L1 always loaded but concise, on the order of a few hundred words, containing only actionable preferences rather than background stories.
- Load L3 once per task, avoiding repeated explanation of the same workflow across multiple conversation turns.
- Recall L2 strictly on demand, cap the number of entries per recall, and prioritize the latest version with a timestamp.
- Define explicit behavior for “no match”: state the gap directly and request input, rather than filling it with general knowledge. This significantly reduces answers that sound fluent but are untrustworthy.
5. Implementation: Four Stages from Zero to Usable
Stage 1: Clear and rebuild. Stop installing more skills. Export and review existing memory, delete duplicates and expired items, and re-archive into the three layers. The goal of this stage is not “more” but “clean.”
Stage 2: Solidify preferences. Write repeatedly corrected points into explicit rules, such as maximum output length, heading levels and font size, numbering style, unit and date formats, and content types where guessing is prohibited. Rules must be testable; avoid unexecutable phrasing like “make it more concise.”
Stage 3: Structure facts. Organize parameters, IDs, and terminology into structured entries with sources and update times, and set expiration times for volatile items. The fact layer should never “state conclusions without sources”—entries without sources cannot be adjudicated when conflicts arise.
Stage 4: Template workflows. Write high-frequency tasks as step lists with clear inputs, outputs, validation points, and failure rollback. Once templated, the result shape of the same task becomes stable and easier to automate later.
6. Iteration and Evaluation: Making the Knowledge Base More Accurate Over Time
A knowledge base is not a one-time project; it needs closed-loop evaluation. Maintain a set of fixed regression questions covering several entries from each of the three memory types, rerun them after every adjustment, and record three metrics: first-pass hit rate, average response time, and number of manual corrections. The number of manual corrections is the most honest metric—it directly reflects “whether it understands you.”
Also establish a regular governance routine: clear conflicting entries weekly, verify the validity of fact-layer sources monthly, and review quarterly whether the preference layer has become stale as habits change. Conflict resolution follows three principles: newer timestamp wins, sourced entries win, higher confidence wins.
7. Advanced: Working with General Cloud Capabilities
As the knowledge base grows to the point of cross-device, cross-scenario use, general cloud capabilities can serve as the carrier: object storage holds memory archives and version snapshots, and message queues decouple
