Skip to content

epic(discord-memory): native archive + recall integration to control token growth #74

@drpedapati

Description

@drpedapati

Problem

Discord thread/session context can grow unbounded, driving token cost up and eventually degrading reliability.

Goal

Implement native sciClaw Discord archive + recall so live prompt context remains bounded while preserving continuity via retrieved archived snippets.

Why this is separate from existing issues

Current open issues (#73, #71, #67) do not cover archive/trim/recall memory control for Discord token consumption.

Phased Delivery Plan

Phase 1 (Smallest Fully Functional Chunk) START HERE

Success criteria:

  1. Long Discord sessions stop unbounded growth.
  2. Archived context is retrievable by operators/users via recall command.
  3. End-to-end integration tests pass for archive->trim->recall path.

Phase 2 (Automatic Recall in Agent Loop)

Success criteria:

  1. Retrieved snippets are injected automatically with strict size caps.
  2. Fail-open behavior verified when recall/index fails.

Phase 3 (Quality and Ops Hardening)

Success criteria:

  1. Recall relevance improvements over lexical-only baseline.
  2. Operators have health checks and troubleshooting docs.

Child Issues

TDD/Integration Contract

This epic is blocked unless each phase includes:

  1. Deterministic integration fixtures using realistic Discord session histories.
  2. End-to-end tests for the exact phase behavior.
  3. Failure-mode tests proving fail-open chat behavior.
  4. Non-Discord regression coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions