DeepSHPlugins
dsh-plugin-asmemory 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-plugin-asmemory

記憶與知識PythonMIT

動作-狀態時序記憶:記錄型別化的狀態與動作,做趨勢、異常與因果關聯分析。

0 StarsXplore-LAB 更新時間 2026-08-14
訪問 GitHub 倉庫
dsh-plugin-asmemory 專案預覽

專案介紹

中文

動作-狀態時序記憶:記錄型別化的狀態與動作,做趨勢、異常與因果關聯分析。

English

Action-state time memory: record typed states and actions, then analyze trends, anomalies, and causality.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
Xplore-LAB
倉庫
Xplore-LAB/dsh-plugin-asmemory
GitHub Stars
0
Forks
0
開發語言
Python
許可證
MIT
最近推送
2026-08-14
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

38/ 100
維護活躍
81
文件與實用資訊
100
生態關注度
0
安裝便捷訊號
100
專案宣告訊號
100

README 含完整安裝與使用說明;標準命令一鍵安裝。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

dsh plugin --profile web add github:Xplore-LAB/dsh-plugin-asmemory

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

asmemory — Action-State Memory Engine

Give your agent a time memory: record what *happened* and what *changed*, then analyze trends, anomalies, and causality — not just what was said.

Language: English | 简体中文

License: MIT DSH Plugin Zero dependencies Verified on DSH

⭐ If this helps you, a star is the best way to say thanks — it keeps the project visible to others.

What it does

asmemory stores two kinds of typed events, not raw text:

  • State — a value of some entity/metric at a point in time (gpu.temperature = 78°C)
  • Action — something that happened (agent ran training, operator adjusted a valve)

On top of this memory it provides four analyses:

AnalysisQuestion it answers
TrendIs my metric going up or down? (slope + direction)
AnomalyWhich readings are outliers? (z-score)
CausalDid action X move metric Y? (before/after delta)
SummaryWhat's in my memory? (counts + entities)

Why asmemory

Most memory plugins store conversations or documents, so they answer *"what did you say"*. asmemory stores *actions and states*, so it answers *"what happened, and why"*:

"Did GPU temperature rise after training started?" → causal
"Is my sleep trending down this week?" → trend
"Which readings are outliers?" → anomaly

It is the memory layer for the *physical and operational* world — agents observing themselves, industrial processes, and personal metrics.

Example: agent self-tracking

Record your agent's own actions and resource states, then ask *why* the GPU got hot:

from asmemory import StateEvent, ActionEvent, MemoryStore, analysis

store = MemoryStore("memory.db")
store.add_state(StateEvent("gpu", "temperature", 78.5, "celsius"))
store.add_action(ActionEvent("agent", "run_training", "qwen3.6", ts=1723500000))

# Did training actually heat the GPU?
causal = analysis.causal_effect(store, "run_training", "gpu", "temperature")
print(causal["before_mean"], "->", causal["after_mean"], f"(Δ={causal['delta']})")

Real output (24h simulated agent, 72 states + 20 actions):

【因果】run_training → gpu.temperature:  45.3 → 78.7  (Δ=33.4, up)   ← significant
【因果对照】git_commit → gpu.temperature: 53.7 → 56.4  (Δ=2.7, up)    ← no effect
【异常】ram.usage: 1 outlier (z=-2.4)

The engine cleanly separates *real causality* (training) from *coincidence* (git commits) — no LLM guessing involved, just time-series math.

Example: industrial monitoring → DataLens

Air-separation plant: oxygen purity (monitored metric) vs. valve opening (control action). asmemory remembers the causality, then exports to DataLens for over-control optimization:

from asmemory.export import export_datalens

export_datalens(store, entity="oxygen", metric="purity",
                action_verb="valve_adjust",
                pollutant="氧纯度", regulator="导叶开度",
                regulatory_limit=99.5)
# → data_datalens.csv + data_datalens.config.json

Real output (240 min, 240 states + 240 actions):

【因果】valve_adjust → oxygen.purity: Δ=0.0009 (up)
✅ CSV → data_datalens.csv          (时间,指标值,控制量,整点标记)
✅ config → data_datalens.config.json (pollutant/regulator/limit)

Open data_datalens.csv in DataLens to visualize the "still over-controlling in the safe zone" savings space.

Tools

Seven MCP tools, exposed to the model as mcp__asmemory__<tool>:

ToolWhat it does
memory_store_stateRecord a state event (entity / metric / value / unit / tags)
memory_store_actionRecord an action event (actor / verb / object / amount)
memory_trendTrend direction + slope of a metric
memory_anomalyz-score outlier detection
memory_causalMean change of a metric before/after an action
memory_summaryLibrary statistics
memory_export_datalensExport CSV + config for DataLens visualization

Installation

The server runs from the asmemory-mcp command (or an absolute path via ASMEMORY_MCP_PATH). Install the command first, then register the MCP bridge with DSH.

  1. Install the asmemory-mcp command:
   pip install .

(Or skip the install and set ASMEMORY_MCP_PATH=/path/to/bin/asmemory-mcp instead.)

  1. Launch DSH with the plugin patch:
   dsh web --patch "$PWD/cordis.yml"

(Once published, you can also run dsh plugin add dsh-plugin-asmemory.)

  1. Done. The server is a single stdio process using only the Python 3.10+ standard library.

Persistence defaults to ~/.asmemory/memory.db (override with ASMEMORY_DB_PATH).

Verified

The full loop is tested end-to-end on a real DSH instance (headless profile + a local Qwen3.6 model): the agent called memory_store_state, memory_store_action, and memory_summary, and the events landed in SQLite — exactly the data it was asked to record.

Quick start

python3 examples/demo_agent_self_tracking.py   # agent self-tracking demo
python3 examples/demo_datalens_export.py       # industrial → DataLens export demo

Use cases

  • Agent self-tracking — record the agent's own actions and resource states
  • Industrial monitoring — process variables and operator actions (air separation, emission control)
  • Personal data — sleep, weight, spending, exercise trends

License

MIT — use it, fork it, ship it. And if it earns you a star-shaped reward in return, all the better. ⭐

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案