The memory your Copilot chats leave behind.

VS Code writes thousands of Copilot Chat session files to disk — hard to search and scattered across workspaces. Engram turns that pile into one local, searchable SQLite database with full-text search. It ships as both an indexer and a built-in skill for chat interaction, with direct SQL available when needed.

Pure Python stdlib. Zero dependencies. Built-in Copilot skill. Sibling project to Anya.

1 · Install — one line · PowerShell
> irm https://raw.githubusercontent.com/aasis21/engram/main/install.ps1 | iex
2 · Use it — slash-command in VS Code Chat, Copilot CLI, or Anya
> /engram find me my chat about dotnet10 upgrade
> /engram search my Copilot history for service bus retry
> /engram show me what I did in session 769739be
01 · What it does

Every chat, every workspace,
in one queryable place.

VS Code stores chat sessions per-workspace under %APPDATA%\Code\User\workspaceStorage\<hash>\chatSessions\. Thousands of files, multiple formats, many GB. Engram consolidates everything into one local SQLite DB.

  1. 01

    Full-text search.

    FTS5 across user prompts and assistant responses, ranked by relevance with highlighted snippets.

  2. 02

    Incremental indexing.

    A watermark tracks the newest mtime seen. Subsequent runs reparse only the files that changed — typically a handful, in well under a second.

  3. 03

    Schema-compatible with Copilot CLI.

    Same tables as session-store.dbsessions, turns, session_files, session_refs — so any tool that reads one can read the other.

  4. 04

    Hidden, hands-off.

    A Windows Scheduled Task runs every 10 minutes (configurable) under pythonw.exe. No console windows, no surprises.

  5. 05

    Read-only & local.

    Engram only reads VS Code's chat files; your editor state is never touched. The database lives entirely under ~\.copilot\. Nothing uploaded, no telemetry.

  6. 06

    Copilot-skill bundled.

    The installer drops a user-level skill at ~\.copilot\skills\engram\ — invoke it anywhere via /engram <prompt> in Copilot CLI, VS Code Chat, or Anya. Ask "/engram find me my chat about dotnet10" and the agent searches both Chat and CLI stores in one go.

02 · Install

One line. That's it.

Requires Python 3.8+ and git on PATH. The bootstrap clones the repo to %LOCALAPPDATA%\Engram-src, copies the indexer to %LOCALAPPDATA%\Engram, runs the initial full index, and registers the scheduled task.

# PowerShell
irm https://raw.githubusercontent.com/aasis21/engram/main/install.ps1 | iex

# With arguments (faster polling, custom location)
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/aasis21/engram/main/install.ps1))) -Interval 5

# Uninstall (keeps DB)
.\uninstall.ps1
.\uninstall.ps1 -RemoveData  # also delete the DB
03 · Copilot skill

Just type /engram.

Installs a user-level Copilot skill to ~\.copilot\skills\engram\. Invoke it with the /engram slash-command in Copilot CLI, VS Code Copilot Chat, or Anya. The agent searches both stores in one pass and tags every hit as CHAT or CLI.

# Natural language — the agent picks the right query/filter
/engram find me my chat about dotnet10
/engram what did I work on in the ModernOrder repo this week
/engram show me what I did in session 769739be

# Or run the underlying script directly
python "$env:USERPROFILE\.copilot\skills\engram\scripts\engram_search.py" `
    list --query "net8 upgrade" --source chat -w ModernOrder --days 90 --json
python "$env:USERPROFILE\.copilot\skills\engram\scripts\engram_search.py" `
    show --session 769739be --query upgrade

Read-only, FTS5 + regex, stdlib-only. Works the same whether you have just the Chat store, just the CLI store, or both.

04 · Query

Plain Python, or plain SQL.

Use the bundled CLI for full-text search, or open the database with any SQLite tool and write your own queries.

# CLI — ranked FTS5 results with highlighted snippets
python engram.py query "service bus retry"
python engram.py status                    # last run, totals, watermark

# Or hit the DB directly
sqlite3 "$env:USERPROFILE\.copilot\session-store-vscode-chat.db" `
  "SELECT repository, COUNT(*) FROM sessions
   GROUP BY repository ORDER BY 2 DESC LIMIT 15;"
05 · Schema

Familiar shape.

Mirrors Copilot CLI's session-store.db, plus state and audit tables for incremental indexing.

TablePurpose
sessionsOne row per chat session — id, repository, cwd, summary, timestamps.
turnsOne row per request/response turn within a session.
session_filesFiles referenced or edited inside a session.
session_refsTool invocations and other refs.
search_indexFTS5 virtual table over user + assistant text.
index_stateSchema version, watermark, totals, last-run info.
index_runsPer-run audit log: scanned, changed, indexed, failed, duration.