Skip to content

feat(core): background memory service for automatic skill extraction #24272

@SandyTao520

Description

@SandyTao520

What would you like to be added?

A background memory service that runs on session startup, scans past conversation sessions, and extracts reusable project-specific skills as SKILL.md files to ~/.gemini/memory/<project>/skills/.

Key design:

  • Index-based session selection — agent sees a compact listing of all sessions and uses read_file to inspect promising ones
  • Sub-agent with scoped context (auto-approve, ~/.gemini/-only workspace, no shell access)
  • Lock-file coordination for multi-instance safety
  • Per-run state tracking with skillsCreated metadata
  • Tiered confidence prompt to balance quality vs. recall
  • Awareness of all existing skills (global, workspace, extension, builtin) to prevent duplication
  • Gated behind experimentalMemoryManager flag

Why is this needed?

Currently, knowledge learned during a session is lost when the session ends. Users repeatedly encounter the same project-specific workflows, failure modes, and conventions across sessions, but each new session starts from scratch. This feature enables the CLI to automatically learn and remember reusable workflows, reducing repetitive discovery and improving agent efficiency over time.

Additional context

This is a single-phase approach that can evolve into a richer memory system (e.g., separating per-session extraction from global consolidation).

Sub-issue of #20062.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualityworkstream-rollupLabel used to tag epics and features that are associated with one of the three primary workstreams🔒 maintainer only⛔ Do not contribute. Internal roadmap item.

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions