← Back to Skills Marketplace
djc00p

Chat Learnings Extractor

by Deonte Cooper · GitHub ↗ · v1.0.3 · MIT-0
linuxdarwinwin32 ✓ Security Clean
126
Downloads
0
Stars
0
Active Installs
4
Versions
Install in OpenClaw
/install chat-learnings-extractor
Description
Extract structured learnings (lessons, decisions, patterns, dead ends) from AI conversation exports using a local Ollama model or any OpenAI-compatible API....
README (SKILL.md)

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

  1. Parse OpenAI/Anthropic JSON exports using bundled parsers (from sibling chat-history-importer skill)
  2. Deduplicate via .processed_ids file (skip already-processed chats)
  3. Summarize conversation to key excerpts (to fit model context)
  4. Extract structured learnings using your chosen model: lessons, decisions, patterns, dead ends
  5. Append results to memory/semantic/learnings-from-exports.md

Integration with chat-history-importer

This skill pairs with chat-history-importer:

  1. First, run chat-history-importer to ingest raw conversations into episodic memory (memory/episodic/YYYY-MM-DD.md)
  2. 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_KEY is set → defaults to gpt-4o-mini
  • If OPENAI_API_KEY is not set → defaults to gemma4: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 model
  • scripts/extract.py — Main script (reuses parsers from sibling skill)

Implementation Notes

  • Tracks processed chat IDs in .processed_ids to avoid re-processing
  • Workspace detection: checks OPENCLAW_WORKSPACE env var, falls back to ~/.openclaw/workspace
  • Automatically detects OpenAI vs Anthropic export formats
  • Truncates long messages for context efficiency
Usage Guidance
This skill appears to do what it says: parse chat export JSON files and call either a local Ollama instance or an OpenAI-compatible API to extract learnings, then append them to a workspace file. Before installing or running it: (1) run with --dry-run or on a small test directory first to inspect outputs; (2) check which workspace it will use (OPENCLAW_WORKSPACE or ~/.openclaw/workspace) so you know where files (.processed_ids, memory/semantic/...) will be created; (3) only set OPENAI_BASE_URL to a trusted API endpoint — supplying OPENAI_API_KEY grants that endpoint the ability to process your chat content; (4) if you plan to use a remote API, review network egress policies or run locally if you must keep exports offline; (5) note minor implementation bugs (e.g., the merge logic expects '*' bullets while prompts produce '-' bullets) — this is a correctness issue, not a security red flag. Overall, nothing in the code or instructions is disproportionate to the stated purpose.
Capability Analysis
Type: OpenClaw Skill Name: chat-learnings-extractor Version: 1.0.3 The skill is a legitimate utility for extracting structured insights (lessons, decisions, etc.) from AI conversation exports. The Python scripts (extract.py, parse_openai.py, parse_anthropic.py) use standard libraries to parse JSON files and interact with LLM APIs (Ollama or OpenAI) as described. There is no evidence of data exfiltration, command injection, or malicious prompt injection; the use of environment variables for API keys and base URLs follows standard development practices.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
Name/description match the implementation: parsers for OpenAI and Anthropic exports, local Ollama or OpenAI‑compatible API usage, deduplication via .processed_ids, and appending results to memory/semantic/learnings-from-exports.md — all are expected for a chat learnings extractor.
Instruction Scope
SKILL.md instructs the agent to parse JSON exports and call either a local Ollama endpoint or an OpenAI-compatible API. The scripts operate only on provided export files and local workspace files; they do not attempt to read unrelated system configuration or credentials beyond the optional API endpoint/env vars mentioned in the README.
Install Mechanism
There is no install spec (instruction-only for install), and the only runtime requirement is python3. No remote archives or third-party package installs are downloaded by the skill itself.
Credentials
Only optional environment variables are used: OPENAI_API_KEY (to enable OpenAI-compatible mode), OPENAI_BASE_URL, OLLAMA_BASE_URL, and OPENCLAW_WORKSPACE. These are proportionate and necessary for choosing model mode and workspace location. Note: if you enable OpenAI mode you will supply an API key that the script will send to the specified OPENAI_BASE_URL, so ensure that variable points to the intended provider.
Persistence & Privilege
The skill does not request always:true or modify other skills. It writes files into its own workspace (default ~/.openclaw/workspace) such as .processed_ids and memory/semantic/learnings-from-exports.md, which is expected behavior for its purpose.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install chat-learnings-extractor
  3. After installation, invoke the skill by name or use /chat-learnings-extractor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.3
Release v1.0.3
v1.0.2
Add chunking for large conversations (40-msg chunks, deduplicated merge), smarter parser scoring (picks best of OpenAI/Anthropic parsers), OLLAMA_BASE_URL env var support. OpenAI mode uses single-pass condensing; Ollama mode uses full chunked extraction.
v1.0.1
Fix metadata: remove ollama as required binary — Ollama is optional; skill works with any OpenAI-compatible API via OPENAI_API_KEY.
v1.0.0
Extract structured learnings from AI conversation exports. Pairs with chat-history-importer. Supports local Ollama or any OpenAI-compatible API.
Metadata
Slug chat-learnings-extractor
Version 1.0.3
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 4
Frequently Asked Questions

What is 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.... It is an AI Agent Skill for Claude Code / OpenClaw, with 126 downloads so far.

How do I install Chat Learnings Extractor?

Run "/install chat-learnings-extractor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Chat Learnings Extractor free?

Yes, Chat Learnings Extractor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Chat Learnings Extractor support?

Chat Learnings Extractor is cross-platform and runs anywhere OpenClaw / Claude Code is available (linux, darwin, win32).

Who created Chat Learnings Extractor?

It is built and maintained by Deonte Cooper (@djc00p); the current version is v1.0.3.

💬 Comments