OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Feature]: Expose cross-session archive search in OpenClaw plugin tools

Open hhspiny opened this issue 5 months ago • 1 comments

Problem Statement

ov_archive_search is hardcoded to the current session only. The server's POST /api/v1/search/grep can already target viking://user/sessions/ for cross-session grep, but the plugin tools never expose it. Information that lives only in old session archives (not extracted into long-term memory) is invisible to the agent.

Proposed Solution

Two options: (A) Add a scope parameter to ov_archive_search — "current" (default, existing behavior), "all" (all agent sessions), "peer" or "agent" (all sessions of the same agent), (B) New standalone ov_grep tool that wraps POST /api/v1/search/grep with a user-settable uri.

Alternatives Considered

Direct HTTP (bypasses plugin routing), memory recall (doesn't cover non-extracted content), manual archive copying (cumbersome)

Feature Area

Retrieval/Search

Use Case

Recover exact commands, error messages, file paths, config values from past sessions that were never promoted to long-term memory

Example API (Optional)

ov_archive_search(query="terraform plan", scope="all") and ov_grep(query="git rebase", uri="viking://user/sessions/")

Additional Context

Server endpoint exists (POST /api/v1/search/grep), gap is purely in plugin tool registration. Tagged relevant maintainers from CONTRIBUTING.md (@Mijamind719, @wlff123).

Contribution

  • [ ] I am willing to contribute to implementing this feature

hhspiny avatar Jun 20 '26 21:06 hhspiny

Thanks for the detailed suggestion!

The current separation is intentional: session archives are treated as raw working-memory history for the current agent session, while cross-session retrieval is expected to go through long-term user/agent memory (memory_recall / ov_search). On session commit, OpenViking archives the session and extracts reusable memories for future sessions.

I agree that exact commands, paths, or error messages may sometimes live only in raw archives and not be promoted to memory. However, exposing ov_archive_search(scope="all") would make raw historical transcripts broadly searchable from an agent tool, which has different privacy/noise and behavioral implications than curated long-term memory.

So I would not extend ov_archive_search to cross-session scope by default. If we support this later, I would prefer making it an explicit opt-in diagnostic/search capability, for example a separate ov_grep tool with an explicit uri, guarded by config and documented as raw archive/resource grep rather than memory recall.

For normal cross-session recall, the intended path remains long-term memory. If specific important details are not being extracted, we should treat that as a memory extraction/recall-quality issue.

qin-ctx avatar Jun 23 '26 08:06 qin-ctx