Chat Learnings Extractor
/install chat-learnings-extractor
Conversation Learnings Extractor
Extract structured learnings (lessons, decisions, patterns, dead ends) from exported AI conversations using either a local Ollama model or any OpenAI-compatible API. This skill is designed to work with exports from OpenAI and Anthropic, and pairs well with the chat-history-importer skill for a complete conversation analysis workflow.
Quick Start
Using Ollama (default)
python3 scripts/extract.py --dir /path/to/exports --limit 3 --dry-run
python3 scripts/extract.py --file single-conversation.json
python3 scripts/extract.py --dir /path/to/exports --since 2026-04-01
Using OpenAI-compatible API (e.g., OpenAI, Anthropic Bedrock, etc.)
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://api.openai.com/v1 # optional, defaults to OpenAI
python3 scripts/extract.py --dir /path/to/exports --model gpt-4o-mini
How It Works
- Parse OpenAI/Anthropic JSON exports using bundled parsers (from sibling
chat-history-importerskill) - Deduplicate via
.processed_idsfile (skip already-processed chats) - Summarize conversation to key excerpts (to fit model context)
- Extract structured learnings using your chosen model: lessons, decisions, patterns, dead ends
- Append results to
memory/semantic/learnings-from-exports.md
Integration with chat-history-importer
This skill pairs with chat-history-importer:
- First, run
chat-history-importerto ingest raw conversations into episodic memory (memory/episodic/YYYY-MM-DD.md) - Then, run this skill to extract structured learnings into semantic memory (
memory/semantic/learnings-from-exports.md)
This workflow keeps raw conversation logs separate from actionable insights, enabling better knowledge organization.
Configuration
Using Ollama (Local)
Prerequisites: Ollama running at http://127.0.0.1:11434 (default)
# Use default model (gemma4:26b)
python3 scripts/extract.py --dir /path/to/exports
# Use a different local model
python3 scripts/extract.py --dir /path/to/exports --model llama2
# Custom Ollama endpoint
export OLLAMA_BASE_URL=http://ollama.example.com:11434
python3 scripts/extract.py --dir /path/to/exports
Environment Variables:
OLLAMA_BASE_URL— Ollama API endpoint (default:http://127.0.0.1:11434)
Using OpenAI-compatible API
Any API supporting the OpenAI /chat/completions endpoint (OpenAI, Bedrock, LM Studio, etc.)
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://api.openai.com/v1 # optional
python3 scripts/extract.py --dir /path/to/exports --model gpt-4o-mini
Environment Variables:
OPENAI_API_KEY— API key (required to enable this mode; if set, OpenAI mode is used instead of Ollama)OPENAI_BASE_URL— API base URL (default:https://api.openai.com/v1)
Model auto-selection:
- If
OPENAI_API_KEYis set → defaults togpt-4o-mini - If
OPENAI_API_KEYis not set → defaults togemma4:26b(Ollama)
Flags
--dir DIR— Process all JSON files in directory--file FILE— Process single file--limit N— Process only first N conversations (useful for testing or limiting API costs)--since YYYY-MM-DD— Skip conversations before this date--model MODEL— Override default model name--dry-run— Print output without writing to disk or updating dedup state
Output Format
Results are appended to memory/semantic/learnings-from-exports.md with this structure:
## Chat Title (YYYY-MM-DD)
### Lessons Learned
- [bullet points]
### Decisions Made
- [bullet points]
### Patterns Noticed
- [bullet points]
### Dead Ends
- [bullet points]
Each category is optional — if a conversation doesn't have notable insights for a category, it will show "None".
References
references/prompt-template.md— The extraction prompt sent to the modelscripts/extract.py— Main script (reuses parsers from sibling skill)
Implementation Notes
- Tracks processed chat IDs in
.processed_idsto avoid re-processing - Workspace detection: checks
OPENCLAW_WORKSPACEenv var, falls back to~/.openclaw/workspace - Automatically detects OpenAI vs Anthropic export formats
- Truncates long messages for context efficiency
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install chat-learnings-extractor - 安装完成后,直接呼叫该 Skill 的名称或使用
/chat-learnings-extractor触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Chat Learnings Extractor 是什么?
Extract structured learnings (lessons, decisions, patterns, dead ends) from AI conversation exports using a local Ollama model or any OpenAI-compatible API.... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 126 次。
如何安装 Chat Learnings Extractor?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install chat-learnings-extractor」即可一键安装,无需额外配置。
Chat Learnings Extractor 是免费的吗?
是的,Chat Learnings Extractor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Chat Learnings Extractor 支持哪些平台?
Chat Learnings Extractor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux, darwin, win32)。
谁开发了 Chat Learnings Extractor?
由 Deonte Cooper(@djc00p)开发并维护,当前版本 v1.0.3。