# 第四章 上下文写入与存储

上下文窗口是有限的，但应用往往需要处理的信息远超窗口容量。**写入策略** 解决的核心问题是：如何在上下文窗口之外持久化存储信息，并在需要时加载到上下文中？

本章会深入探讨外部记忆系统、多层次记忆架构、知识库构建方法，以及向量数据库的实践应用。这些是构建长期记忆和大规模知识管理系统的基础技术。

## 本章内容

* [4.1 外部存储与记忆系统](/context_engineering_guide/di-er-bu-fen-he-xin-ji-shu-yu-ce-le/04_write/4.1_external_storage.md)
* [4.2 记忆架构设计](/context_engineering_guide/di-er-bu-fen-he-xin-ji-shu-yu-ce-le/04_write/4.2_memory_architecture.md)
* [4.3 知识库构建与管理](/context_engineering_guide/di-er-bu-fen-he-xin-ji-shu-yu-ce-le/04_write/4.3_knowledge_base.md)
* [4.4 向量数据库实践](/context_engineering_guide/di-er-bu-fen-he-xin-ji-shu-yu-ce-le/04_write/4.4_vector_database.md)
* [本章小结](/context_engineering_guide/di-er-bu-fen-he-xin-ji-shu-yu-ce-le/04_write/summary.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yeasy.gitbook.io/context_engineering_guide/di-er-bu-fen-he-xin-ji-shu-yu-ce-le/04_write.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
