cross-channel-history-retrieval

Search cross-session chat history JSON files by channel, keywords, and time window.

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/DreamMacer/jiuwenswarm --skill cross-channel-history-retrieval-dreammacer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cross-channel-history-retrieval
Source: https://github.com/DreamMacer/jiuwenswarm/tree/main/resources/agent/workspace/skills/cross-channel-history-retrieval
Command: npx skills add https://github.com/DreamMacer/jiuwenswarm --skill cross-channel-history-retrieval-dreammacer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? When a user asks about past conversations that happened in other channels or sessions (e.g., "what did I ask on the web channel earlier today?"), the current conversation context has no record of it. This Skill retrieves the original chat messages from persisted session history files so the agent can answer with real evidence instead of guessing. ## Core Features & Use Cases - Cross-Session Search: Scans history.json files under ~/.jiuwenswarm/agent/sessions/ and filters by channel (feishu, dingtalk, web), exact session ID, keywords, and time range. - Flexible Time Windows: Supports explicit start/end times, a point-in-time with a configurable window, a default 24-hour lookback, and automatic expansion to 72 hours when no hits are found. - Context-Ready Output: Emits a HISTORY_SEARCH_SUMMARY block with scan statistics and a HISTORY_CONTEXT_BLOCK containing matched messages that can be pasted directly into the current conversation. - Use Case: A user asks in Feishu "what did I say about the reimbursement approval this morning on the web channel?" The agent runs the search script with the keyword and time window, then quotes the retrieved messages in its reply. ## Quick Start Ask the agent to search your chat history across all channels for a specific keyword within a time range, for example: "Find what I said about contract approval today in any channel."

Frequently Asked Questions about cross-channel-history-retrieval

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search chat history across multiple sessions or channels?▼

Run the search_history.py script with optional --channel, --session-id, --query, and time parameters. It scans history.json files under the sessions directory and returns matching messages sorted by timestamp, newest first.

How to filter chat history search by time range?▼

Pass --start and --end in formats like YYYY-MM-DD or YYYY-MM-DD HH:MM, or use --at with --window-minutes for a centered window. Without time arguments, the search defaults to the last 24 hours.

Does the history search work on Windows with cmd?▼

Yes, but cmd does not expand the tilde character, so use %USERPROFILE%\.jiuwenswarm paths instead of ~/.jiuwenswarm. In PowerShell the tilde expands normally, and all other arguments behave identically to Unix.

What happens when a chat history search returns no results?▼

If no explicit start or end time was given, the script automatically expands the window to the last 72 hours and retries once. If still empty, the report states the searched window, channel, and keywords so conditions can be relaxed.

What are the limitations of keyword-based history search?▼

All keywords must appear in a message for it to match, so overly specific queries may miss relevant messages. The scan is also capped by --max-sessions (default 200) and --limit (default 20 hits), which can truncate very large histories.