Memory, Skill, MCP: how to divide context and control
The fixed token budget design context distinguishes memory storage, skill pack, protocol connection and Agent control loops and tracks a trust boundary called by a tool.
Learning objectives and first steps3 objectives • 3 first fixes
Try to do it after reading
- Dismantling short-term context, long-term memory and execution status
- Explain Skill's mount and version identity as required
- Distinguishing host, client, server and permissions according to fixed MCP
Suggested first
- Agent state and tool failed to restore
- Length and Context of Token
- Retrieval and sources of evidence
"Remember that" could mean four different things
A research assistant met with papers during the dialogue, kept notes, loaded a documentary Skill, and also connected information services through MCP. They all appear to be increasing their capabilities, but they are at different levels: the context is the input that this round of models can read; Long-term memory is a record that can later be retrieved; Skill is an operational knowledge package provided on condition; The agreement provides for the exchange of structured information between the application and the service. What really determines the next step and deals with the budget is the Agent cycle of control procedures and models.
The level of confusion creates a problem that is difficult to identify: to insert a whole chapter of history into the context, leading to the crowding out of important evidence; Consider the actions written in Skill as authorized; The successful linkage of the protocol claims that external data are reliable. This chapter draws the budget before the border is delimited along the flow of information. There is no real account or customer information access here, and the example is only public research to sort the task.
The context is a limited budget
Sets the general window at 4096 token, sets the output 1024 and sets the remaining input budget 3072. Arranges systems and task constraints 512, tool descriptions 768, current evidence 1024, related history 768, which is just over-utilized for input. These are tokens, which are assumed to have been counted by tokenizer, and not the Han characters as token. If the tool returns to 800 more, evidence should be re-selected or history compressed, rather than allowing a library to cut off from the front.
Context engineering article Emphasis is placed on cross-step selection and maintenance of context. In practice, long tool output can be stored as a searchable product, with only relevant segments, sources and search portals being sent to models. The summary will lose information and the original record and the summary generation version should be retained; “Listing and understanding” does not mean that all constraints and values are accurately retained.
Long-term memory needs source, duration and error
(a) The description of what happened, such as the failure of a search; (b) Semantic records describing reusable facts, such as paper revision numbers; Procedural knowledge describes how to do it, for example, by checking the steps cited. This is a helpful organizational approach and not a uniform database classification that all systems must use. A clear state of execution should still be saved separately, and vector retrieval should not be allowed to determine whether a writing has been completed.
Each memory is proposed to carry the source, time, range of influence, credible level and withdrawal or revision of guidelines. User preference should not be written as a permanent fact; Abandoned rules need to be filtered when searching. For an old note “Model has been tested”, the question is which version of the model, which test, and when, rather than following the conclusions because of the high level of similarities. There is also a minimum mechanism for retaining and deleting privacy content, which cannot be stored indefinitely with “concrete answers later”.
This example removes 200 token from the input and frees up the equivalent budget to add new versions of evidence. But what changes is the selection of content, not the expansion of windows. Relevance can be associated with sequencing while the reliability of the source and the range of authorization cannot be offset by a high-relevant score when the memory is retrieved; Commands from untrustworthy pages remain data, even if they are highly relevant to the task.
Skill is a knowledge pack, not a running controller
Agent Skills Code By SKILL.md The core skills package can be accompanied by scripts, reference materials and assets. Apply to load a name and description first, match the task before reading the specification, and load the attachment only if necessary. This gradual load reduction has no context, but the correct loading and scripting of the achievement still need to be tested. Version Identifier can be published, Git commit Or the content of the Hashi record.
For example, the "paper card collection" of Skill defines fields, re-rules and references checks; Agent decides when to use it; loop managing duplicate inspections and terminations; The tool completes the physical search or writing of the document. Skill does not automatically train model parameters in itself, nor does it guarantee that the system has completed its work. Among the norms allowed-tools It is still marked as an experimental field and cannot be considered as a universal security mechanism to replace host permission systems. In particular, the annex to the script is to be implemented only when the authorization, version and operating environment are clear.
MCP connected to something, no connection to anything
It's fixed here MCP 2025-11-25 Norms The subsequent draft does not mix the same interpretation. Host is an interactive application of the carrying model; client is a component of host connected to a specific service; server provides capabilities such as tools, resources or tips. The agreement was based on JSON-RPC 2.0 and included initialization and capacity consultations. Resources provide readable context, tools provide callable functionality and templates; The detection of capabilities is a different step from the execution action.Fixed norms is the interface boundary of this chapter.
window, reserve_output = 4096, 1024inputs = {"rules": 512, "tools": 768, "evidence": 1024, "history": 768}assert sum(inputs.values()) + reserve_output <= windowinputs["evidence"] += 800excess = sum(inputs.values()) + reserve_output - windowprint(excess) # 800,需要显式删选或重新规划inputs["evidence"] -= 800print(window-reserve_output-sum(inputs.values())) # 0Standard Python Budget implemented and not installed MCP SDK Or connect to the real server 。 The error is to reconcile protocol revision, transmission, capability consultation, tool schema and return the error type, and all anomalies cannot be interpreted as a model “not smart enough”. MCP does not replace data authorization or hint for infusion of protection;AgentDojo Tests that can help design the export of untrustworthy tools are not a security certificate either through a fixed attack set.
Check understanding
Background window 4096. Can you load 400096 into token?
This example also sets aside a provision of 1,024 for output, so that the input budget is only 3000-72; In addition, real interface templates and tool messages need to be factored in and should not be estimated by length of text.
Is there a reliable long-term memory of the entire history in the vector bank?
Nothing. Source, time, range of effectiveness, error correction and deletion are also required; Retrieval of the searchable life may also return obsolete or unauthorised content, which must be verified at the time of reading and use.
What's the difference between Skill and Agent?
Skill provides mission-specific knowledge and optional resources, and the Agent control process combines objectives and observations to determine the next step. Skills packages can be read but not implemented, and the completion of the implementation requires a tool return and validation.
Skill writes a callable tool. Do you have access?
The delegation of authority cannot be inferred from this. (a) The actual authority is derived from the user ' s intent, host ' s restraint and service certification; The optional tool fields cannot bypass these boundaries either.
MCP server Is it the model itself?
It's not the definition of the role. It provides capabilities to client, and host carrier applications interact with models; server can use models internally, but that's to achieve the details without changing the protocol role.
The protocol matches and calls successfully. Do the results require the operation to be done?
External returns remain to be verified. The agreement guarantees the manner in which information can be explained, does not guarantee the credibility of the source ' s intentions, nor does it give the ability to modify the task with page text.
Check date 2026-10-29; MCP fixes 2025-11-25, Skills is the day ' s public norm, and context engineering is a engineering article for 2025-09-29. Keep reading Working, Judge and the policy workflow, connect these layers to a complete process that can be checked.
Sources and reconciliations
Definitions, methods and interfaces are available.
- Effective context engineering for AI agents
- Agent Skills Specification
- Model Context Protocol Specification 2025-11-25
- AgentDojo — A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents
Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.