Skip to content

Add default past-conversations skill for recalling previous chats #792

@benjaminshafii

Description

@benjaminshafii

Problem

OpenWork can’t reliably recall prior user conversations unless prompted with ad-hoc instructions. This hurts continuity and makes memory-dependent requests brittle.

Proposal

Add a built-in default skill named past-conversations that is strongly prioritized when the user asks to recall previous conversations. Triggering should be heavily biased toward recall-style prompts (e.g. “what did we discuss before?”, “find our earlier chat about X”).

Suggested skill content:

---
name: past-conversations
description: Find and inspect past conversations. Use when the user asks you to recall a previous conversation.
---

Discovery of past conversations

All past conversations exist in the sqlite database at ~/.local/share/opencode/opencode.db.

Use sqlite3 and query the part table:

CREATE TABLE `part` (
  `id` text PRIMARY KEY,
  `message_id` text NOT NULL,
  `session_id` text NOT NULL,
  `time_created` integer NOT NULL,
  `time_updated` integer NOT NULL,
  `data` text NOT NULL
);

Only search rows where data JSON has type = "text", and search within the text field. Sort by time_created, then group by session_id (conversation-level grouping).

Reference implementation notes: https://gist.github.com/jlongster/059741f0d2384eb9d41836dfffcb9cc7

Acceptance Criteria

  • past-conversations exists as a first-class default skill.
  • Skill trigger routing is biased toward recall/introspection prompts by default.
  • Skill queries only text message parts (type: "text") from part.data.
  • Results are ordered by time_created and grouped by session_id.
  • Output makes it easy to inspect relevant conversation snippets and sessions.
  • Add test coverage for trigger routing and query behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions