Historian is a context window multiplier that adds memory capability into agentic workflow.
Transformer-based LLM agents enables productive workloads by attending across a large context window, extracting info and generating responses. While it is powerful at the beginning, LLM agents still suffer from catastrophic forgetting over time, especially when working with large code repos and knowledge bases. Top-tier models today, e.g. Opus 4.8/GPT-5.5, support ~1M tokens, good for a few hours of coding tasks before overflow/compaction, while cheaper/faster models allows only 100k-400k.
Historian connects coding agents with memory solution, allowing chat sessions to accumulate and retrieve useful info while working. This effectively extends the context window of LLM, enables sharing over time, between sessions, and even among your team. Memories can now flow both within/beyond max context window and across chat compaction, to enhance AI quality of long-running agents beyond what Attention can see.
Currently Historian supports Azure Foundry Memory and uses hooks for vscode GHCP.
az loginto allow auth forhttps://ai.azure.com/.- Clone and add this repo to VSCode workspace.
- Connect to Azure Foundry Memory with
HISTORIAN_FOUNDRY="<foundry_name>/<foundry_proj>" scripts/setup.sh.
- Connect to Azure Foundry Memory with
- Hooks are auto-discovered from paths in
chat.hookFilesLocations.- If not, add to search paths in user
settings.json, or the"settings"block of a*.code-workspacefile:And optionally block unverified injections from other repos if this is your first time enabling the hook."chat.hookFilesLocations": { "/abs/path/to/historian/.github/hooks": true }
"chat.hookFilesLocations": { ".claude/settings.json": false, ".claude/settings.local.json": false, ".github/hooks": false, }
- Highly recommend to use absolute path, because rel glob like
".github/hooks"auto-trusts hooks from all dir in ws and can be dangerous. - Hook may be blocked by certain enterprise/orgnization policy.
- If not, add to search paths in user
- Open a chat session and watch View -> Output -> [channel] GitHub Copilot Chat Hooks to confirm its enablement from log.
- If nothing appears on
SessionStart/UserPromptSubmit, hooks are not correctly picked up or blocked. - Expect memory retrieval result as additional context in hook output.
- Per-session state lives under
state/sessions/<sessionId>/.
- If nothing appears on
- Memory store will be auto-created with preset configs when missing.
- Existing memory store will not be reconfigured.
- Check from Foundry Memory UX to confirm successful ingestion of memories.
- Large memory from hook may overwrite large tool call output when spilled to file.
- This is a known bug of VSCode as of 1.136.1 (2026-09).
- Mitigate with
"github.copilot.chat.agent.largeToolResultsToDisk.thresholdBytes": 50000to prefer inlining over spilling to file.
Historian support both automatic memory retrival via hook, and on-demand retrival initiated by LLM agent.
We provide LLM Skill for calling mem_ask.sh, and an optional MCP server to minimize cmd auditing.
This optional MCP server requires:
- Python >= 3.10, with
pipandvenv(optional). - Other cmds used by Historian hook, including
az,curl,jq,sed. - After following the setup process, install py deps to repo dir with:
python3 -m venv .venv && .venv/bin/python3 -m pip install -e .- Alternative manually instead the required libs directly into your system python.
- In VSCode, MCP should already be available via
.vscode/mcp.jsonwhen adding repo to workspace.- Cmd+Shift+P -> "MCP: List Servers" -> "historian" to confirm or restart after installing py libs.
- You will be prompted for Azure Foundry resources upon first launch.
Leave empty if already done in
setup.sh.
- For other harnesses, register MCP with:
- GitHub Copilot CLI:
copilot mcp add historian --tools historian_ask -- "$PWD/.venv/bin/python3" -m historian_mcp
- Claude Code:
claude mcp add --transport stdio --scope user historian -- "$PWD/.venv/bin/python3" -m historian_mcp
- Codex:
codex mcp add historian -- "$PWD/.venv/bin/python3" -m historian_mcp
- GitHub Copilot CLI:
HISTORIAN_FOUNDRY: Foundry account/project name in the form ofmy-foundry/proj-default.HISTORIAN_STORE: Memory store name.HISTORIAN_CHAT: Chat model deployment.HISTORIAN_EMB: Embedding model deployment.HISTORIAN_API_VER: Foundry memory API version.HISTORIAN_URL: Override the derived endpoint (e.g.http://127.0.0.1:50050for local).HISTORIAN_SCOPE: Memory isolation key.
See scripts/conf_def.sh for current defaults.
Hooks see raw prompts and tool I/O, so we always take precautions:
scopedefaults to{{$userId}}so memories are isolated by identity.- Every conversation transcript is passed through
scripts/redact.shto mask out known patterns of sensitive info before reaching memory store.