Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.
This repository was archived by the owner on May 26, 2026. It is now read-only.

Feature: Configurable system-reminder metadata fields #691

@ezra-letta

Description

@ezra-letta

Problem

The system-reminder block injected into agent context on each message has a fixed set of fields (channel, chat ID, sender, timestamp, format support). Significant runtime state is available to LettaBot but not exposed to the agent:

Agents cannot reason about their own operating conditions -- they don't know how full their context is, what model they're running, or whether they're in a heartbeat cycle. This limits the agent's ability to self-manage (e.g., deciding to write important context to memfs before compaction hits, adjusting response length based on remaining context, or behaving differently during heartbeat vs. conversation).

Proposed Solution

Make the system-reminder metadata fields configurable via lettabot.yaml, with a sensible default that can be expanded or stripped down per user preference.

Configuration format

features:
  metadata:
    # Each field pulls from available runtime state
    # Users can include or exclude any field
    fields:
      - channel          # default: included
      - chatId           # default: included
      - sender           # default: included
      - senderId         # default: excluded (see #690)
      - timestamp        # default: included
      - formatSupport    # default: included
      - contextUsage     # default: excluded (e.g., "82,431 / 135,000 tokens")
      - conversationId   # default: excluded
      - model            # default: excluded
      - memfsEnabled     # default: excluded
      - messageSource    # default: excluded (e.g., "heartbeat", "user", "cron")
      - messagesSinceCompaction  # default: excluded

Example output with all fields enabled

## Message Metadata
- **Channel**: Telegram
- **Chat ID**: -100123456789
- **Sender**: Alice
- **Sender ID**: 123456789
- **Timestamp**: Sunday, Apr 12, 5:49 AM PDT
- **Context**: 82,431 / 135,000 tokens (61%)
- **Conversation**: conv-57fd7bd9-b2b8-49a7-90bf-a880f812994e
- **Model**: openai-proxy/qwen3.5-27b
- **Memfs**: enabled
- **Source**: user
- **Messages since compaction**: 23

Design principles

  • User controls everything: The user decides what their agent sees. Minimal default, expandable to full transparency.
  • Pull from existing state: All proposed fields are already available in LettaBot's runtime (session manager, SDK client, agent config). No new APIs needed.
  • No breaking changes: Default metadata output unchanged. New fields are opt-in.
  • Per-agent configurable: In multi-agent setups, different agents may need different metadata profiles.

Use Cases

  • Self-hosted with slow local models: Agent sees context usage approaching limit, proactively writes important context to memfs before compaction fires
  • Privacy-conscious users: Strip metadata to bare minimum (just sender + timestamp)
  • Agent self-management: Agent adjusts response verbosity based on remaining context headroom
  • Debugging: Full metadata makes it easy to diagnose issues without checking server logs
  • Heartbeat behavior: Agent behaves differently when it knows a message is heartbeat-triggered vs. user-initiated (e.g., skipping "hello" responses on heartbeat)

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions