A Guide to Building Personal AI Infrastructure
This article presents a systematic guide to building a personal AI digital assistant based on Daniel Miessler's Personal AI Infrastructure (PAI) framework. The core thesis: don't start with tools, start with yourself. It covers the TELOS identity system (10 Markdown files defining mission, goals, beliefs, etc.), a three-tier memory architecture (hot/warm/cold), a decision priority chain (goal → code → CLI → prompt → agent), a user/system separation directory design, and an event hook system. It emphasizes that architecture matters more than model choice—a good context management system with an ordinary model often outperforms a top model without context. Suitable for engineers and knowledge workers who want to build a personalized, continuously learning AI assistant.


Based on @DanielMiessler's Personal AI Infrastructure (PAI) framework. Start with yourself, not with tools. Before choosing any AI tool, take time to understand your goals, beliefs, and working style. Architecture design is far more important than model selection. A good context management system with an average model often outperforms a top-tier model without context.
Source: github.com/danielmiessler/Personal_AI_Infrastructure
基于 @DanielMiessler 的 Personal AI Infrastructure (PAI) 框架整理。不要从工具开始,从自己开始。 在选择任何 AI 工具之前,先花时间搞清楚自己的目标、信念和工作方式。架构设计远比模型选择重要。 一个好的上下文管理系统 + 普通模型,往往比一个没有上下文的顶级模型表现更好。
The starting point of the PAI framework is not "how to better use AI tools," but a deeper question—most people's creative potential has never been truly activated. The ultimate goal of an AI assistant is not to help you reply to emails or summarize documents, but to help you discover, clarify, and persistently pursue your life goals.
Ordinary AI chat tools (like ChatGPT, Claude) are stateless: each conversation starts from scratch, not remembering who you are, what you are doing, or where you want to go. PAI's core proposition is to upgrade AI from a "one-time Q&A tool" to a Digital Assistant (DA) that continuously learns and deeply understands you.
This digital assistant has three key characteristics:
- Goal-oriented: Always operates around your vision and goals, not around tools or technology
- Continuous learning: Extracts signals from every interaction, constantly improving its understanding of you
- Deep context: Understands your preferences, history, thinking patterns, and current challenges
PAI 框架的出发点并非"如何更好地使用 AI 工具",而是一个更深层的问题——绝大多数人的创造潜力从未被真正激活。AI 助理的终极目标不是帮你回复邮件或总结文档,而是帮你发现、厘清并持续追求你的人生目标。
普通的 AI 聊天工具(如 ChatGPT、Claude)是无状态的:每次对话从零开始,不记得你是谁、在做什么、想去哪里。PAI 的核心主张是将 AI 从"一次性问答工具"升级为一个持续学习、深度理解你的数字助理(Digital Assistant, DA)。
这个数字助理具备三个关键特征:
- 目标导向:始终围绕你的愿景和目标运作,而非围绕工具或技术
- 持续学习:从每次交互中提取信号,不断改进对你的理解
- 深度上下文:了解你的偏好、历史、思维方式和当前挑战
TELOS is the cornerstone of the entire PAI framework. It builds a complete personal profile through 10 Markdown files, allowing the AI to understand your full picture at any moment.
2.1 Ten Core Files
| File | Content | Sample Question |
|---|---|---|
| MISSION.md | Your life mission | "What is the meaning of my existence?" |
| GOALS.md | Current goals | "What do I want to achieve in the next 1-3 years?" |
| PROJECTS.md | Ongoing projects | "What specific things am I working on?" |
| BELIEFS.md | Core beliefs | "What do I believe is right?" |
| MODELS.md | Mental models | "What frameworks do I use to understand the world?" |
| STRATEGIES.md | Strategies for doing things | "What methods do I tend to use to solve problems?" |
| NARRATIVES.md | Stories that shaped you | "What experiences define who I am today?" |
| LEARNED.md | Lessons learned | "What have I learned from past mistakes?" |
| CHALLENGES.md | Current challenges | "What is hindering my progress?" |
| IDEAS.md | Ideas worth exploring | "What are some directions worth deep exploration?" |
2.2 Why This Matters
When your AI assistant reads these 10 files, it is no longer a generic chatbot but a "colleague" who understands your background. It knows what you are doing, what you want, and how you think. This means you don't have to re-explain your situation in every conversation—the AI already knows.
2.3 Practical Advice
You don't need to write perfectly from the start. Even 3-5 sentences per file is fine. Over time, you will continuously supplement and revise. The key is to first set up this framework and let iteration happen naturally.
TELOS 是整个 PAI 框架的基石。它通过 10 个 Markdown 文件构建一份完整的个人画像,让 AI 在任何时刻都能理解你的全貌。
2.1 十个核心文件
| 文件 | 内容 | 示例问题 |
|---|---|---|
| MISSION.md | 你的人生使命 | "我存在的意义是什么?" |
| GOALS.md | 当前目标 | "未来 1-3 年我想达成什么?" |
| PROJECTS.md | 正在进行的项目 | "我手上有哪些具体的事情?" |
| BELIEFS.md | 核心信念 | "我相信什么是对的?" |
| MODELS.md | 思维模型 | "我用什么框架理解世界?" |
| STRATEGIES.md | 做事策略 | "我倾向于用什么方法解决问题?" |
| NARRATIVES.md | 塑造你的故事 | "哪些经历定义了今天的我?" |
| LEARNED.md | 已学到的教训 | "我从过去犯的错误中学到了什么?" |
| CHALLENGES.md | 当前挑战 | "什么阻碍了我的前进?" |
| IDEAS.md | 值得探索的想法 | "有哪些值得深入研究的方向?" |
2.2 为什么这很重要
当你的 AI 助理读取了这 10 个文件,它就不再是一个通用的聊天机器人,而是一个了解你背景的"同事"。它知道你在做什么、想要什么、怎么思考。这意味着你不需要每次对话都重新解释自己的情况——AI 已经知道了。
2.3 实践建议
不需要一开始就写得很完美。每个文件哪怕只有 3-5 句话也好。随着时间推移,你会不断补充和修正。关键是先建立这个框架,让迭代自然发生。
TELOS defines "who you are," while the memory system records "what happened" and "what was learned." PAI adopts a three-layer memory architecture:
3.1 Hot Memory
Function: Captures immediate signals from recent interactions. Includes preferences in current conversations, decisions just made, recent feedback and evaluations. Hot memory is short-term, helping the AI maintain coherence within the current session.
3.2 Warm Memory
Function: Stores mid-term accumulated patterns and insights. For example, frequently used workflows, emerging interest directions, changes in work focus over recent weeks. Warm memory helps the AI identify trends and habits.
3.3 Cold Memory
Function: Preserves long-term knowledge and historical experience. Includes key decisions, major lessons, and long-term preferences from months or years ago. Cold memory ensures the AI does not lose the wisdom you have accumulated.
3.4 Signal Capture Mechanism
Every interaction generates signals, including your ratings and feedback, emotional changes, success or failure outcomes, and explicitly expressed preferences. These signals are classified and stored in different layers of memory, forming a continuous learning loop.
TELOS 定义了"你是谁",而记忆系统则记录了"发生了什么"以及"学到了什么"。PAI 采用三层记忆架构:
3.1 热记忆(Hot Memory)
作用:捕捉最近交互中的即时信号。包括当前对话中的偏好、刚刚做出的决策、最近的反馈和评价。热记忆是短期的,帮助 AI 在当前会话中保持连贯性。
3.2 温记忆(Warm Memory)
作用:存储中期积累的模式和洞察。比如你反复使用的工作流、新出现的兴趣方向、最近几周的工作重心变化。温记忆帮助 AI 识别趋势和习惯。
3.3 冷记忆(Cold Memory)
作用:保存长期知识和历史经验。包括过去几个月甚至几年的关键决策、重大教训、长期偏好。冷记忆确保 AI 不会丢失你积累的智慧。
3.4 信号捕捉机制
每次交互都会产生信号,包括你的评分和反馈、情绪变化、成功或失败的结果、明确表达的偏好。这些信号被分类存入不同层级的记忆,形成一个持续学习的闭环。
PAI has a very pragmatic judgment framework for "when to use AI."
4.1 Decision Priority Chain
Goal → Code → CLI → Prompt → Agent Skills
The core logic of this hierarchy is determinism first:
- Goal: First clarify what problem you are solving.
- Code: If it can be solved with deterministic code, use code—the result is 100% predictable.
- CLI tool: Package code into command-line tools for easy reuse.
- Prompt: Only introduce AI prompts when intelligent judgment is needed.
- Agent skills: The highest level, encapsulating prompts into reusable agent capabilities.
4.2 Why Not Use AI Directly?
AI models are probabilistic—the same prompt can produce different results. For problems with deterministic solutions (format conversion, data calculation, file operations), code is more reliable than AI. Only when understanding, reasoning, or creativity is required is it worth using AI's probabilistic capabilities.
4.3 Modular Design of Skills
Each skill is an independent module, following the UNIX philosophy—do one thing and do it well. Skills can be combined to form complex workflows.
PAI 对"何时使用 AI"有一个非常务实的判断框架。
4.1 决策优先级链
Goal → Code → CLI → Prompt → Agent 技能
这个层次的核心逻辑是确定性优先:
- 目标(Goal):首先明确你要解决什么问题
- 代码(Code):如果能用确定性代码解决,就用代码——结果 100% 可预测
- CLI 工具:把代码封装成命令行工具,方便复用
- Prompt:只有需要智能判断时才引入 AI prompt
- Agent 技能:最高层级,将 prompt 封装为可复用的 agent 能力
4.2 为什么不直接用 AI?
AI 模型是概率性的——同一个 prompt 可能产生不同结果。对于有确定性解决方案的问题(格式转换、数据计算、文件操作),用代码比用 AI 更可靠。只有在需要理解、推理、创意时,才值得动用 AI 的概率性能力。
4.3 技能的模块化设计
每个技能是一个独立的模块,遵循 UNIX 哲学——做一件事,做好它。技能之间可以组合使用,形成复杂的工作流。
5.1 Two Core Directories
PAI/
├── USER/ ← All your personalized content
│ ├── identity/ ← Name, voice, personality
│ ├── preferences/ ← Tech stack, tool preferences
│ ├── workflows/ ← Workflow definitions
│ ├── skills/ ← Custom skills
│ ├── hooks/ ← Event hooks
│ └── memory/ ← Memory data
└── SYSTEM/ ← PAI infrastructure code
5.2 Why Separate?
This design solves a key problem: when the system is updated, your personalized configuration will not be overwritten. Your identity, memory, and workflows are your assets, independent of the underlying tool's version iterations.
5.3 Six Layers of Customization
| Layer | Content | Description |
|---|---|---|
| Identity | Name, voice, personality | How the AI addresses you and what tone it uses |
| Preferences | Tech stack, tools | Your preferred programming language, editor, platform |
| Workflow | Execution patterns | Standard procedures for handling specific tasks |
| Skills | Available capabilities | Specific abilities the AI can invoke |
| Hooks | Event responses | Actions automatically triggered on specific events (session start, tool execution) |
| Memory | Signal capture | What information is worth remembering |
5.1 两个核心目录
PAI/
├── USER/ ← 你的所有个性化内容
│ ├── identity/ ← 姓名、声音、个性
│ ├── preferences/ ← 技术栈、工具偏好
│ ├── workflows/ ← 工作流定义
│ ├── skills/ ← 自定义技能
│ ├── hooks/ ← 事件钩子
│ └── memory/ ← 记忆数据
└── SYSTEM/ ← PAI 基础设施代码
5.2 为什么要分离
这个设计解决了一个关键问题:当系统更新时,你的个性化配置不会被覆盖。你的身份、记忆、工作流是属于你的资产,独立于底层工具的版本迭代。
5.3 六层自定义
| 层级 | 内容 | 说明 |
|---|---|---|
| 身份 | 姓名、声音、个性 | AI 如何称呼你、用什么语气和你说话 |
| 偏好 | 技术栈、工具 | 你偏好的编程语言、编辑器、平台 |
| 工作流 | 执行模式 | 你处理特定任务的标准流程 |
| 技能 | 可用能力 | AI 可以调用的具体能力 |
| 钩子 | 事件响应 | 在特定事件(会话开始、工具执行)时自动触发的动作 |
| 记忆 | 信号捕捉 | 什么信息值得被记住 |
Principle 1: User-Centric All design revolves around the user's goals and needs, not technological possibilities.
Principle 2: Scientific Method as the Fundamental Algorithm "Hypothesis → Experiment → Measurement → Iteration" is the meta-method for solving all problems. Don't guess; verify.
Principle 3: Clear Thinking First Good prompts come from clear thinking. Before writing a prompt, figure out what you actually want.
Principle 4: Architecture Over Model Don't obsess over GPT-4 vs. Claude—system design (context management, memory, workflow) is far more important than model choice. A good architecture can work with any model.
Principle 5: Deterministic Infrastructure Use templates, fixed processes, and structured outputs to reduce AI unpredictability. Let probabilistic AI run on deterministic rails.
Principle 6: Code Over Prompt If a problem can be solved deterministically with code, don't give it to probabilistic AI.
Principle 7: Spec/Test/Evaluation First First clearly define what you want (spec), how to judge success (test), and how to measure quality (evaluation), then implement.
Principle 8: UNIX Philosophy Each component does one thing and does it well. Components are combined through clear interfaces.
Principle 9: Engineering Discipline Treat AI infrastructure as production-grade software—with version control, tests, and documentation.
Principle 10: CLI as the Preferred Interface The command line is faster, more scriptable, and easier to automate than GUI.
Principle 11: Decision Hierarchy Goal → Code → CLI → Prompts → Agents, progressing from deterministic to probabilistic.
Principle 12: Skill Management Modular capabilities that automatically route to the appropriate skill based on context.
Principle 13: Memory System Capture everything worth knowing to form the basis of continuous learning.
Principle 14: Agent Personalization Different agents have different personalities and strengths, like different roles in a team.
Principle 15: Science as Meta-Loop Continuously run the "Hypothesis → Experiment → Measurement → Iteration" loop to keep the system evolving.
Principle 16: Allow Saying "I Don't Know" Explicitly allow the AI to admit uncertainty. This is far more valuable than making things up.
原则 1:用户中心 一切设计围绕用户的目标和需求,而非技术的可能性。
原则 2:科学方法作为基础算法 "假设 → 实验 → 测量 → 迭代"是解决一切问题的元方法。不要猜测,要验证。
原则 3:清晰思考优先 好的 prompt 来自清晰的思考。在写 prompt 之前,先搞清楚你到底想要什么。
原则 4:架构比模型重要 不要纠结于用 GPT-4 还是 Claude——系统的设计(上下文管理、记忆、工作流)远比模型选择重要。好的架构可以适配任何模型。
原则 5:确定性基础设施 用模板、固定流程和结构化输出来减少 AI 的不可预测性。让概率性的 AI 运行在确定性的轨道上。
原则 6:代码优先于 Prompt 能用代码确定性解决的问题,就不要交给概率性的 AI。
原则 7:规格/测试/评估先行 先写清楚你要什么(规格),怎么判断成功(测试),如何衡量质量(评估),然后再动手实现。
原则 8:UNIX 哲学 每个组件做一件事,做好它。组件之间通过清晰的接口组合。
原则 9:工程纪律 把 AI 基础设施当作生产级软件来对待——有版本控制、有测试、有文档。
原则 10:CLI 作为首选界面 命令行界面比图形界面更快、更可脚本化、更容易自动化。
原则 11:决策层次 Goal → Code → CLI → Prompts → Agents,从确定性到概率性依次递进。
原则 12:技能管理 模块化的能力,根据上下文自动路由到合适的技能。
原则 13:记忆系统 捕捉一切值得知道的信息,形成持续学习的基础。
原则 14:Agent 个性化 不同的 Agent 有不同的性格和擅长领域,就像一个团队中的不同角色。
原则 15:科学作为元循环 持续运行"假设 → 实验 → 测量 → 迭代"的循环,让系统不断进化。
原则 16:允许说"不知道" 明确允许 AI 承认不确定性。这比胡编乱造有价值得多。
7.1 Design Philosophy The goal of the security system is to protect users without hindering workflows. Good security design should be almost invisible while firmly blocking dangerous operations.
7.2 Permission Verification Every operation goes through permission checks. Dangerous operations (such as deleting files, sending sensitive information) require explicit confirmation. The system should avoid crude toggles like "skip all permission checks."
7.1 设计理念 安全系统的目标是在保护用户的同时不妨碍工作流。好的安全设计应该让你几乎感觉不到它的存在,但在危险操作面前坚定拦截。
7.2 权限验证 每个操作都经过权限检查,危险操作(如删除文件、发送敏感信息)需要显式确认。系统应避免出现需要"跳过所有权限检查"的粗暴开关。
8.1 What Are Hooks Hooks are actions automatically triggered when specific events occur, similar to "if... then..." rules.
8.2 Typical Events
- Session start: Load user context, check to-do items, show daily summary
- Before tool execution: Verify permissions, record operation intention
- After tool execution: Capture result signals, update memory
- Session end: Save learning outcomes, generate session summary
8.3 Value Hooks transform the AI assistant from "passive response" to "proactive service." Instead of only answering when asked, it proactively offers help at the right moments.
8.1 什么是钩子 钩子是在特定事件发生时自动触发的动作,类似于"如果...那么..."规则。
8.2 典型事件
- 会话开始:加载用户上下文、检查待办事项、显示今日摘要
- 工具执行前:验证权限、记录操作意图
- 工具执行后:捕捉结果信号、更新记忆
- 会话结束:保存学习成果、生成会话摘要
8.3 价值 钩子让 AI 助理从"被动响应"变为"主动服务"。不是你问它才回答,而是它在合适的时机主动提供帮助。
Phase 1: Build Identity Foundation (Week 1)
- Create a folder as the root of your "AI infrastructure"
- Create 10 Markdown files following the TELOS framework
- Write just 3-5 sentences per file, don't aim for perfection
- Focus on MISSION.md, GOALS.md, and PROJECTS.md
阶段一:建立身份基础(第 1 周)
- 创建一个文件夹作为你的"AI 基础设施"根目录
- 按 TELOS 框架创建 10 个 Markdown 文件
- 每个文件先写 3-5 句话,不求完美
- 重点投入 MISSION.md、GOALS.md 和 PROJECTS.md
Phase 2: Build Persistent Context (Weeks 2-3)
- Integrate TELOS files into system prompts or context files for AI conversations
- Create a simple log file to record key takeaways after each important interaction
- Start distinguishing hot/warm/cold memory—which information is temporary and which is long-term
阶段二:构建持久上下文(第 2-3 周)
- 将 TELOS 文件整合为 AI 对话的系统提示或上下文文件
- 建立一个简单的日志文件,每次重要交互后记录关键收获
- 开始区分热/温/冷记忆——哪些信息是临时的,哪些是长期的
Phase 3: Develop Common Skills (Weeks 4-6)
- Identify your 3-5 most frequent workflows
- Write a standardized prompt template for each workflow
- Automate parts that can be automated with scripts
- Encapsulate prompts + scripts into reusable "skills"
阶段三:开发常用技能(第 4-6 周)
- 识别你最频繁的 3-5 个工作流
- 为每个工作流编写一个标准化的 prompt 模板
- 能用代码自动化的部分就写成脚本
- 将 prompt + 脚本封装为可复用的"技能"
Phase 4: Establish Feedback Loop (Ongoing)
- Briefly evaluate result quality after each AI usage
- Regularly review TELOS files, update goals and projects
- Analyze which skills work well and which need improvement
- Iterate continuously—this is a never-ending process
阶段四:建立反馈循环(持续进行)
- 每次使用 AI 后简单评估结果质量
- 定期回顾 TELOS 文件,更新目标和项目
- 分析什么技能效果好、什么需要改进
- 不断迭代——这是一个永不结束的过程
Key Takeaways
- Start with yourself, not with tools. Before choosing any AI tool, take time to understand your goals, beliefs, and working style.
- Architecture design is far more important than model selection. A good context management system with an average model often outperforms a top-tier model without context.
- Determinism first, probabilistic supplement. Use code for what can be solved deterministically, only introduce AI when intelligent judgment is needed.
- Continuous learning is the core value. A static AI assistant is just a tool; a learning AI assistant is a partner.
- Start simple, allow iteration. Don't need to get it right in one go. First build a minimal viable TELOS framework, then refine it through use.
This document is compiled from Daniel Miessler's Personal AI Infrastructure project, combined with practical advice. The original project is built with TypeScript and Bun runtime, natively integrated with Claude Code.
关键启示总结
不要从工具开始,从自己开始。 在选择任何 AI 工具之前,先花时间搞清楚自己的目标、信念和工作方式。
架构设计远比模型选择重要。 一个好的上下文管理系统 + 普通模型,往往比一个没有上下文的顶级模型表现更好。
确定性优先,概率性补充。 能用代码解决就用代码,只在需要智能判断时才引入 AI。
持续学习是核心价值。 静态的 AI 助理只是工具,会学习的 AI 助理才是伙伴。
从简单开始,允许迭代。 不需要一步到位。先建立最小可用的 TELOS 框架,然后在使用中逐步完善。
本文档整理自 Daniel Miessler 的 Personal AI Infrastructure 项目,结合实践建议编写。原始项目使用 TypeScript 和 Bun 运行时构建,与 Claude Code 原生集成。