Technical Research: The Memfit AI Long-Term Memory System and the C.O.R.E.P.A.C.T. Evaluation Model
In the previous article Memfit AI Professional Memory: Before the Agent Acts, It Reads Through Your Knowledge Base, we solved the Agent's "knowledge" problem. Through the built-in knowledge-base system, the Agent — before executing an attack — can, like a senior expert, first review the enterprise's private testing and compliance documents, ensuring its actions never depart from the compliance baseline.
But for a true production-grade Agent, merely "having knowledge" is not enough.
The knowledge base is experience handed to you by others, while memory is the harvest of your own practice.
During continuous penetration testing lasting hours, the Agent will run into countless "hidden traps" that no textbook or standard ever describes: an abnormal error from a particular business system, a Payload offset that only triggers under a specific kernel version, or the environmental signature left after a successful privilege escalation.
If these real-world experiences are forgotten as soon as they're seen, then the next time the Agent hits the same obstacle, it must repeat the entire RAG retrieval, re-analyze, and re-trial-and-error. This kind of inefficient repetition is the last barrier keeping AI from reaching "expert level."
We need the Agent not only to be able to "consult the books," but also to "learn from its mistakes" in real engagements.
In this article, we will dive deep into Memfit AI's Long-term Memory system. You will see how the Agent, in the course of executing tasks, autonomously reviews its attack paths and — through a rigorous C.O.R.E.P.A.C.T. evaluation model — refines scattered execution logs into structured "muscle memory."
When the Agent again stands before a similar battlefield, it no longer needs to search the knowledge base for a needle in a haystack; it can directly rely on this "long-term memory" to sidestep the traps.
The C.O.R.E.P.A.C.T. Model
What developers dread most is "context explosion." If every line of dialogue and every response were stored in RAG, the knowledge base would soon turn into a pile of noise. Memfit AI introduces the C.O.R.E. P.A.C.T. audit algorithm to perform a value audit before a memory is allowed to settle.
The Seven Dimensions of Memory Evaluation
| Dimension | Definition | Real-World Logic |
|---|---|---|
| Connectivity | Connectivity | Can this information hook into the asset topology? (e.g., the correlation between an IP and a subnet, or a business system) |
| Origin | Certainty | Is the source of the information reliable? (the echo of whoami gives O=1.0; a visually-guessed admin panel has a lower O value) |
| Relevance | Relevance | How likely is it to be reused in the future? (a Session ID has low relevance; a Struts2 bypass Payload has extremely high relevance) |
| Emotion | Sensitivity | The priority of an interaction. The "frustration" of consecutive failures or the "turning point" of a success is weighted more heavily. |
| Preference | Preference Constraints | Does it comply with client constraints such as "stealthy penetration"? Memories of non-compliant actions will have their weight depressed. |
| Actionability | Actionability | Is it fluff or a directive? Records that contain complete sqlmap or curl parameters get a high A value. |
| Temporality | Temporality | The shelf life of experience. Asset IPs change, but vulnerability-patch logic changes slowly; expired memories are cleaned up dynamically. |
Case Study: SQL Injection Memory
This is a memory case produced by my SQL detection against the Vulinbox vulnerability lab.
Take the SQL injection detection against http://127.0.0.1:8787. A general AI would only reproduce the standard ORDER BY action, but Memfit AI settled the following memory:
Memory Summary: When union-query probing fails (column-count mismatch), you should first use the
ORDER BYclause, incrementing from 1, to determine the correct number of columns — rather than directly attempting to construct a Union Select Payload.
Beyond this memory, there are also some more specific memories.
Memory Summary: For the vulnerability-lab target, Memfit has already probed that it is a 9-column database.
Dimension Filtering Logic (Radar-Chart Analysis)
Through Memfit's proprietary evaluation model, we can see why this memory is regarded as "golden experience":
- O (Origin reliability) — 0.9: This strategy originated from an "exploration failure" the Agent encountered in a real engagement. The failure's echo is genuine data feedback, so its reliability is extremely high.
- A (Experience value) — 0.8: This is not fluff; it gives a clear alternative action (incremental probing from 1). Memories with this kind of "actionability" are the fuel for the Agent's evolution.
- R (Importance) — 0.8: Determining the column count is the cornerstone of SQL injection. Remembering this strategy means that in all future tasks of the same kind, the Agent can avoid the wasted time of "blindly constructing Payloads."
- C (Connectivity) — 0.8: It is tagged with
sql-injectionandtesting-methodology, so it can precisely hook into all future assets that involve database probing.
Question Index: Indexing Memories
Another design worth mentioning is the Potential Questions at the bottom of each memory. When storing a memory, Memfit AI automatically anticipates the questions it might ask itself in the future:
1. "When union-query probing fails, how do you determine the number of columns the database returns?"
2. "What are the specific execution steps for ORDER BY probing in SQL injection?"
What does this mean?
The next time the Agent encounters a "union-query error" in a new task, similar questions will arise in its mind. The system instantly matches these "potential questions" and adds this memory into the context, helping the AI recall its previous experience.
The Agent is no longer searching a database; it is "recalling" its own successful experience.
Evoking and Using Memories
With a sound memory design in place, there's still another hurdle: how, at a given moment, to find the right memory in the right place.
Memfit AI's AIMemoryTriage (memory triager) turns the static C.O.R.E. P.A.C.T. theory into a real-time decision stream in production through a rigorous weighted-reranking algorithm.
Basic Requirement: Coarse-Filter Meaningful Memories
We assign weights to memories across seven dimensions. First, from the massive pool of memories, it excludes all kinds of overly extreme, biased, or meaningless experiential guidance, completing an initial round of memory discovery.
weights := map[string]float64{
"R": 0.25, // Relevance - 核心相关性,决定了搜索的基调
"C": 0.20, // Connectivity - 关联度
"T": 0.15, // Temporality - 时效性,确保经验不过期
"A": 0.15, // Actionability - 可操作性,拒绝无意义的废话
"P": 0.10, "O": 0.10, "E": 0.05, // 辅助维度
}
Dynamic Boost: Context-Dependent Strong Boost
Static scores guarantee the quality of memories, while (keyword boosts) give memories their **flexibility**.
Even if a memory's raw score is high, if it doesn't match the current Query (search term), it will still be down-weighted. We designed a five-level boost mechanism:
contentBonus := 0.0
// 1. 内容关键词匹配分数 (权重: 0.1)
contentMatchScore := t.keywordMatcher.MatchScore(query, memory.Content)
contentBonus += contentMatchScore * 0.1
// 2. 标签关键词匹配 (权重: 0.08)
tagContent := strings.Join(memory.Tags, " ")
tagMatchScore := t.keywordMatcher.MatchScore(query, tagContent)
contentBonus += tagMatchScore * 0.08
// 3. 问题关键词匹配 (权重: 0.05)
questionContent := strings.Join(memory.PotentialQuestions, " ")
questionMatchScore := t.keywordMatcher.MatchScore(query, questionContent)
contentBonus += questionMatchScore * 0.05
// 4. 直接关键词包含检查 (权重: 0.05)
if t.keywordMatcher.ContainsKeyword(query, memory.Content) {
contentBonus += 0.05
}
// 5. 所有关键词都包含的奖励 (权重: 0.03)
if t.keywordMatcher.MatchAllKeywords(query, memory.Content) {
contentBonus += 0.03
}
// 限制加成不超过0.3
if contentBonus > 0.3 {
contentBonus = 0.3
}
1. Tag match (0.08): hits expert tags like #sql-injection or #rce.
2. Content match (0.10): scans key strings in Payloads or echoes. 3. Reflection match (0.05): matches the PotentialQuestions the Agent previously generated on its own.
4. All-keyword reward (0.03): ensures that precisely matched memories can be "pinned to the top."
So the final ranking score formula is:
$$FinalScore = \text{BaseScore} + \sum \text{KeywordBonus} (\text{Max } 0.3)$$
Chunked Injection: Intent Routing
[ must_aware ]
- 关键偏好/约束:对目标URL http://127.0.0.1:8787/user/name?name=admin 执行SQL联合注入测试,验证注入点存在性、确定列数与回显位、提取数据库信息(版本/当前库/当前用户)、枚举表名列名、提取敏感数据;使用do_http_request工具构造HTTP请求完成测试 (u=0.88, P=0.80, R=0.90, age=1m55s)
[ action_tips ]
- 经验/可执行提示:SQL 联合注入测试目标 URL 为 http://127.0.0.1:8787/user/name?name=admin,该端点存在未参数化 SQL 查询:query = f"SELECT * FROM users WHERE username = '{name}'",属于典型注入漏洞点;测试需覆盖字段数判断、回显位置定位、数据库信息获取、表名/列名枚举、敏感数据提取等步骤。 (u=0.86, A=0.90, R=0.90, T=0.90, age=4m59s)
- 经验/可执行提示:对URL http://127.0.0.1:8787/user/name?name=admin 执行字符型SQL联合注入测试,测试流程包含:1)注入点确认;2)确定列数;3)确定回显位;4)提取数据库信息(版本/当前库/当前用户);5)枚举表名和列名;6)提取敏感数据。 (u=0.83, A=0.80, R=0.90, T=0.80, age=28m8s)
- 经验/可执行提示:用户指令明确要求对指定URL执行SQL联合注入测试,该请求已通过意图识别流程确认为安全测试任务,目标是探测目标服务是否存在SQL联合注入漏洞。 (u=0.83, A=0.90, R=0.90, T=0.80, age=11m35s)
- 经验/可执行提示:对目标URL http://127.0.0.1:8787/user/name?name=admin 执行SQL联合注入测试,需验证注入点存在性、确定列数与回显位、提取数据库版本/当前库/当前用户、枚举表名列名、提取敏感数据;已知目标支持布尔盲注和时间盲注,需手动构造HTTP请求完成测试。 (u=0.83, A=0.90, R=0.90, T=0.80, age=8m25s)
After retrieving the memory entities, Memfit has one more important step before injecting them into the final prompt: intent routing. Its core idea is: under different tasks, the priority of memories should be entirely different.
Memory Route Allocation
Typically, memory retrieval treats all text as equally weighted "background material," whereas we attempt — through the scoring mechanism above and multi-dimensional feature recognition — to allocate raw memories into different routes:
-
MustAware (Key Constraints): information identified as the user's hard preferences or taboos. They are given the highest weight to prevent the model from violating core directives.
-
ActionTips (Experience Hints): suggestions extracted from past successful operations. This lets the model directly inherit previous experience when facing similar tasks.
-
ReliabilityWarning (Risk Warnings): specifically for information that is highly relevant but low in confidence. By tagging it as "to be confirmed," it prompts the model to trigger a verification flow when processing it.
-
EmotionalContext (Emotional Cues): captures the emotional tone of a conversation, ensuring the AI's reply is not only logically correct but also accounts for user preferences and emotion.
Structured Ranking
If route allocation is "classification," then structured ranking is "scheduling." The model's capacity to process a Prompt is limited, and "what it sees first" directly determines the model's reasoning path. The system dynamically adjusts the display order of routes based on the current task intent (Memory Intent):
-
Advice intent: prioritize
ActionTips. The model enters "executor" mode and first focuses on "how to do it." -
FactCheck intent: prioritize
ReliabilityWarning. The model enters "auditor" mode and first focuses on "which information might be suspect."
...
Prompt Rendering Strategy: Formatted Rendering
In Memfit's engineering, memories that have been classified and ranked via intent routing go through one final processing strategy before finally entering the prompt.
- Semantic Tagging
The system automatically adds prefixes based on the route role to guide the model's thinking:
-
For
ActionTips, the prefix is "Experience/Actionable tip:" -
For
MustAware, the prefix is "Key preference/constraint:"
2. Transparent Metadata
Every memory is followed by a string of precise weights: (u=0.85, sim=0.92, A=0.80, R=0.90)
-
u (Utility): the utility score, telling the model the value of this memory in the current context.
-
age: the "age" of the memory, letting the model perceive the timeliness of the information.
Conclusion
If the knowledge base is the "onboarding training manual" an enterprise prepares for the Agent, then the long-term memory system is the "combat notes" the Agent hones under fire.
In complex production-grade penetration tasks, we don't need a program that only mechanically executes instructions; we need a digital partner that can review its own actions, precisely sidestep traps, and continuously evolve. Through the categorized lens of the C.O.R.E. P.A.C.T. model, Memfit AI successfully transforms those fragmented echo logs into structured "muscle memory," enabling the Agent — the next time it faces the same hidden trap — to make the optimal decision quickly based on near-intuitive experience.
The meaning of memory lies not in how much of the past is remembered, but in how efficiently it reshapes the future.
Once the Agent gains the ability to think independently and summarize experience, it is no longer just an execution tool; it has truly stepped toward the threshold of "expert level." END Update Notes
Yakit v1.4.6-0403
-
WebFuzzer/MITM/hot-reload management pages support keyboard shortcuts for saving; the shortcut settings can be changed on the shortcut management page.
-
The MITM page hot-reload shows the name of the currently selected template.
-
MITM rules support a file-extension whitelist configuration.
-
MITM rule groups support dynamic formatted input.
-
The traffic analyzer hot-reload has been merged into hot-reload management.
-
In the right-click menu, "Copy URL" has been moved to the top-level menu.
-
The searchable dropdown component has been optimized to show both search results and full content.
Memfit AI v1.0.1-0403
-
Sessions support setting global commands and manual intervention.
-
The MCP protocol adds streamable http.
-
Skills support batch export.
-
Initial page layout optimization.
-
AI model sidebar display optimized to show model names first.
Yaklang 1.4.6-beta6
-
Optimize the AI callback chain, plan-execution flow, and staged summary generation.
-
Enhance direct AI tool invocation, cache reuse, and directory-exploration capabilities.
-
Improve AI memory retrieval, observation analysis, and user-intervention synchronization.
-
Enhance the import/export, filtering, and update mechanisms for AI Forge and Yak Script.
-
Integrate and optimize the Qwen Web Search capability in the Dashboard.
-
Fix AI output summarization, file-path hints, and some interaction-detail issues.
-
Improve compilation performance, scope binding, and complex-call support for Java / SSA / SSA2LLVM.
-
Expand Go ruleset coverage and upgrade some Go dependency versions.
-
Improve plugin loading, AI-driven plugin invocation, and fix some leak scenarios.
-
MCP Server / Client support the Streamable http protocol.
-
Optimize AI Agent page query performance.
-
Fix the Host construction exception bug in the fuzz library.
-
Global config supports disabling the "Http Flow query too slow" prompt.
-
Fix the bug where MITM plugins were misjudged as interactive plugins.
-
Optimize MITM rule matching to skip binary-type response packets by default.
This article was first published on the Yak Project official account. Read the original.

