Im Wiki Extractor logo

Im Wiki Extractor

Community
cafe3310
im-wiki-extractor

将超长群聊日志转化为结构化知识图谱。采用滑动窗口增量提取,规避上下文限制,并确保实体与关系的沉淀与溯源

Overview

Publishercafe3310
Repositorypublic-agent-skills
Skill nameim-wiki-extractor
Stars
256
Forks
30
Bundled files
5
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by cafe3310 on GitHub. Read the source before you install it.

Installation

Install the Im Wiki Extractor AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/cafe3310/public-agent-skills/tree/main/skills_parked/im-wiki-extractor
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/cafe3310/public-agent-skills.git /tmp/public-agent-skills
mkdir -p .claude/skills
cp -r /tmp/public-agent-skills/skills_parked/im-wiki-extractor .claude/skills/im-wiki-extractor
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Im Wiki Extractor in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Im Wiki Extractor on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Im Wiki Extractor is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Agent Skill: im-wiki-extractor (群聊知识图谱提取器)

1. 概述 (Overview)

本技能旨在将非结构化的聊天记录(如群聊历史)转化为存储在 memories-off Agent Skill 生成的仓库中的结构化知识图谱。 它强调「逐渐增量」的处理方式,通过 100 行一个的「滑动窗口」来处理超长日志,从而规避模型上下文限制。 该技能通过动态注入工具的 help 信息来确保子代理生成 100% 正确的 CLI 指令。

外部依赖与规范说明

本 Skill 依赖 memories-off 库进行实体管理与长期记忆。在执行任何任务前,您必须先查阅并完整遵循当前目录下的 memories-off-declare.md 声明文档,以获取其定义的实体类型规范及封装的子过程操作细节。

2. 提取定义 (Schema)

提取任务应遵循用户给出的实体和关系规范。 在 templates/meta.md 中包含了一个示例定义,定义了实体的类型(Member, Opinion, Info 等)及其关系谓语(Propose, Discuss 等)。 用户可以根据实际需求进行调整。

3. 工作流阶段 (Workflow Phases)

第一阶段:准备与访谈

  1. 确认范围: 询问语料位置及目标知识库目录。
  2. Schema 确认: 引导用户确认 templates/meta.md。
  3. 目标定义: 确认 templates/prompt_template.md。

第二阶段:空间初始化

  1. 初始化 memories-off 仓库: 在用户指定的地方创建知识目录并执行 memocli init。
  2. 配置元数据: 用 cp 命令将 templates/meta.md 的内容写入知识库的 meta.md;或根据用户之前的输入动态生成 meta.md。
  3. 复制语料: 在 memocli init 创建的知识库中创建 chat_res 子目录,用于存储规范化后的原始语料;然后将原始日志复制到 chat_res,按顺序重命名为 YYYY-MM-DD_NNN_orig_name.md。
  4. 任务分解与状态追踪: 运行 python scripts/setup_workspace.py path_to_chat_res TASK_YYYY-MM-DD.md。该脚本会扫描语料并生成带有行号分片(100行)和前序上下文(50行)的 TASK 文件。

第三阶段:增量提取循环 (断点续传)

针对 TASK 文件中定义的每个未完成分片([ ]):

  1. 自动定位: 启动任务时,直接定位到 TASK 文件中第一个 [ ] 状态的分片开始处理。
  2. 生成提示词: 运行 python scripts/generate_prompt.py ...。该脚本现在会动态注入支持「组合操作」的 memocli 语法(如在追加内容的同时建立关系)。
  3. 执行提取子任务 (原子化操作):
    • 组合指令优先: 优先使用 append-update --add-rel-out 等组合指令,减少工具调用次数。
    • 路径自动探测: 默认在知识库根目录执行,无需显式传入 --path。
    • 失败处理: 若执行中断,直接在下一次尝试时重新处理该分片。
  4. 记录与提交:
    • 检查 TASK 文件,确认分片状态已更新为 [x]。
    • 标准化提交: 执行 memocli commit -r "processed chunk [ID]"。该命令会自动触发全库审计并生成标准的 Git 提交信息。
  5. 检查并继续: 进入下一个分片。

4. 执行原则 (Execution Principles)

  • 命名规范 (Identity): 实体名即文件名。严禁添加类型前缀。
  • 组合语义 (Combined Ops): 充分利用 memocli 的 --add-rel-out/in 参数。在 create-entity 或 append-update 时同步完成关系建模,提升提取效率。
  • 动态语法核验: generate_prompt.py 会实时调用 memocli --help 以确保子代理使用的语法与当前环境安装的版本 100% 匹配。
  • 最小化探测:
    • 识别到实体后直接 create-entity,通过 || true 忽略已存在错误。
    • 严禁冗余的 ls 或全局 search。
  • 溯源强制: 所有的 append-update 必须包含 filename:line_range。

5. 资源清单 (Resources)

脚本 (Scripts)

  • scripts/setup_workspace.py: 初始化分片任务清单。
  • scripts/generate_prompt.py: 动态组装包含权威 CLI 语法的子代理提示词。

模板 (Templates)

  • templates/prompt_template.md: 核心任务模板,包含元数据和工具操作占位符。
  • templates/meta.md: 图谱本体定义模板。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Im Wiki Extractor AI skill do?

将超长群聊日志转化为结构化知识图谱。采用滑动窗口增量提取,规避上下文限制,并确保实体与关系的沉淀与溯源

Why use Im Wiki Extractor on TypingMind?

Because you install it once and use it with any model. Im Wiki Extractor is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Im Wiki Extractor in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/cafe3310/public-agent-skills/tree/main/skills_parked/im-wiki-extractor. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Im Wiki Extractor?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Im Wiki Extractor?

As many as you like. As long as a model supports skills, you can use Im Wiki Extractor with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Im Wiki Extractor AI skill free?

Yes. It is published on GitHub by cafe3310 under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇