← 返回 Skills 市场
dq-stack

Cross-Platform Memory Bridge

作者 dan · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
104
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install cross-platform-memory
功能描述
Injects recent conversations from Telegram and Discord into the OpenClaw gateway session context. Enables the agent to remember and reference cross-platform...
使用说明 (SKILL.md)

Cross-Platform Memory

Reads recent user messages from Telegram and Discord session logs and injects them into the agent's memory context on every gateway request.

What It Does

When the agent receives a message (via any channel), this bridge reads:

  1. Telegram messages from the active session's JSONL log
  2. Discord messages from the same session log (filtered to user-only, excluding bot output)
  3. Local memory files (MEMORY.md, daily notes)

And prepends them as a system context block so the agent has full cross-platform awareness.

How It Works

User message → Gateway → Memory Bridge (reads JSONL) → System context → Agent
  • Telegram detection: Messages starting with "Conversation info (untrusted metadata):"
  • Discord detection: Entries with channel: "discord" and message.role: "user"
  • Bot filtering: Discord bot messages (where the message author is a bot) are excluded
  • Platform tagging: Each message prefixed with [telegram] or [discord] for clarity
  • Time sorting: Most recent messages prioritised, limited to last 8 per platform

Setup

1. Configure the session log path

The bridge reads from OpenClaw's session logs. Default path:

C:\Users\\x3Cuser>\.openclaw\agents\main\sessions\

The bridge auto-detects the most recent JSONL file in that directory.

2. Install the skill

clawhub install cross-platform-memory

3. Configure the bridge in your mission-control

Copy references/memory-bridge.ts to your mission-control's src/lib/ directory:

cp references/memory-bridge.ts /path/to/mission-control/src/lib/

4. Wire into your chat API

In your src/app/api/mc/chat/route.ts:

import { getMemoryContext } from '@/lib/memory-bridge';

// In your POST handler, before calling the gateway:
const memoryContext = await getMemoryContext();
const messages = memoryContext
  ? [{ role: 'system' as const, content: memoryContext }, { role: 'user' as const, content: message }]
  : [{ role: 'user' as const, content: message }];

Configuration

The skill uses environment variables for machine-specific paths (set these in your .env or system environment):

Variable Default Description
OPENCLAW_SESSIONS_DIR C:\Users\.openclaw\agents\main\sessions Path to OpenClaw session logs
OPENCLAW_WORKSPACE C:\Users\.openclaw\workspace Path to workspace files

In memory-bridge.ts:

Setting Default Description
MESSAGES_PER_PLATFORM 8 Max messages per platform to include
MAX_MESSAGE_AGE_HOURS 20 Only include messages from last N hours
SESSIONS_DIR C:\Users\...\.openclaw\agents\main\sessions Path to session logs

Output Format

MEMORY CONTEXT:

## MEMORY.md
[Curated long-term memories]

## Today's Notes
[Daily notes]

## Recent Telegram Conversation
[telegram] Dan: message 1
[telegram] Dan: message 2

## Recent Discord Conversation
[discord] Dan: message 1
[discord] Dan: message 2

IMPORTANT: You are Sancho — use the context above to inform your responses.

Known Limitations

  • Only reads from the most recent session log file
  • Discord bot messages are filtered out (only user messages included)
  • Messages older than 20 hours by default are excluded
  • If no session logs exist, falls back to MEMORY.md and daily notes only
安全使用建议
This skill appears to do what it claims (pull recent Telegram/Discord user messages and local MEMORY.md/daily notes into agent context) and contains no network exfiltration code, but you should not install it blindly. Before adding it to your mission-control codebase: 1) Review the TypeScript file yourself (or have a developer review) to ensure it meets your redaction/privacy needs. 2) Be aware that copying the file into mission-control gives it the same filesystem and runtime privileges as your server — sensitive session logs and notes will be read and injected into agent context. 3) Consider adding explicit redaction rules (remove tokens, emails, PII) and stricter filters (shorter MAX_MESSAGE_AGE_HOURS, fewer messages) before use. 4) If you keep secrets or tokens in MEMORY.md or session logs, do not enable this in production without additional safeguards or running it in a tightly controlled/staging environment. 5) Note the minor metadata mismatch: SKILL.md references environment variables that the registry did not mark as required—set and audit those variables if you proceed. If you want higher confidence, ask the publisher for provenance (homepage/owner identity) or run the code in a sandboxed instance first.
功能分析
Type: OpenClaw Skill Name: cross-platform-memory Version: 1.0.0 The skill implements a cross-platform memory bridge by reading local OpenClaw session logs and memory files (MEMORY.md, daily notes) to provide context to the agent. The code in `references/memory-bridge.ts` uses standard file system operations to parse recent Telegram and Discord messages from JSONL files and formats them for injection into the LLM prompt. The behavior is clearly aligned with the stated purpose and lacks any indicators of malicious intent, unauthorized data exfiltration, or harmful prompt injection.
能力评估
Purpose & Capability
The name/description match the behavior: the bridge reads Telegram and Discord messages from OpenClaw session JSONL logs and local MEMORY.md/daily notes and returns a system context string. That capability legitimately requires filesystem access to session logs and workspace files. Minor mismatch: registry metadata lists no required env vars, but SKILL.md and the code reference OPENCLAW_SESSIONS_DIR and OPENCLAW_WORKSPACE as configurable environment variables (they have sensible defaults in code).
Instruction Scope
SKILL.md explicitly instructs you to copy references/memory-bridge.ts into your mission-control codebase and to call getMemoryContext() before gateway calls. The instructions direct the bridge to read session JSONL files and workspace files (MEMORY.md and daily notes) on every gateway request. While this matches the stated purpose, it also means the skill will automatically access potentially sensitive local logs and notes; the documentation does not include any built-in redaction or filtering beyond simple bot-message exclusion and age limits.
Install Mechanism
There is no automated install spec (instruction-only), and the skill includes a single TypeScript file that you must manually copy into your mission-control source. No network downloads or external packages are pulled by the skill. Manual code insertion is lower-risk than automatic downloads, but copying code into mission-control grants it whatever runtime privileges your mission-control process already has — this is an important privilege consideration.
Credentials
The skill requests filesystem access to session logs and workspace files (which may contain private conversations, tokens, or other secrets), but declares no credentials. The environment variables mentioned in SKILL.md are used only for configurable paths and have defaults; nonetheless the registry did not advertise them. No network/credential exfiltration is present in the code, but the code's access to local logs is proportionate for the feature and can expose sensitive data if those files contain secrets.
Persistence & Privilege
always:false (default) and autonomous invocation allowed (default). That is normal. The real persistence/privilege impact comes from integrating the code into your mission-control app: once added, it runs inside mission-control and inherits its filesystem/network privileges. The skill does not attempt to modify other skills or global agent settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install cross-platform-memory
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /cross-platform-memory 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of cross-platform-memory. - Injects recent Telegram and Discord user conversations into the OpenClaw gateway session context. - Enables agents to remember and reference conversations across Telegram, Discord, and other OpenClaw channels for improved context continuity. - Reads from session logs, local MEMORY.md, and daily notes; filters and tags messages by platform. - Limits to the most recent 8 messages per platform and filters out bot messages. - Configurable via environment variables and easy integration with mission-control and chat APIs. - Falls back to long-term and daily memory files if no session logs are present.
元数据
Slug cross-platform-memory
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Cross-Platform Memory Bridge 是什么?

Injects recent conversations from Telegram and Discord into the OpenClaw gateway session context. Enables the agent to remember and reference cross-platform... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 104 次。

如何安装 Cross-Platform Memory Bridge?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install cross-platform-memory」即可一键安装,无需额外配置。

Cross-Platform Memory Bridge 是免费的吗?

是的,Cross-Platform Memory Bridge 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Cross-Platform Memory Bridge 支持哪些平台?

Cross-Platform Memory Bridge 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Cross-Platform Memory Bridge?

由 dan(@dq-stack)开发并维护,当前版本 v1.0.0。

💬 留言讨论