8000 GitHub - xkszltl/historian · GitHub
[go: up one dir, main page]

Skip to content
xkszltlPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

24 Commits

Folders and files

Repository files navigation

Historian

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.

Setup

  1. az login to allow auth for https://ai.azure.com/.
  2. Clone and add this repo to VSCode workspace.
    • Connect to Azure Foundry Memory with HISTORIAN_FOUNDRY="<foundry_name>/<foundry_proj>" scripts/setup.sh.
  3. 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-workspace file:
      "chat.hookFilesLocations": {
          "/abs/path/to/historian/.github/hooks": true
      }
      And optionally block unverified injections from other repos if this is your first time enabling the hook.
      "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.
  4. 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>/.
  5. Memory store will be auto-created with preset configs when missing.
    • Existing memory store will not be reconfigured.
  6. Check from Foundry Memory UX to confirm successful ingestion of memories.
  7. 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": 50000 to prefer inlining over spilling to file.

On-demand Retrival

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 pip and venv (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.json when 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

Configuration

  • HISTORIAN_FOUNDRY: Foundry account/project name in the form of my-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:50050 for local).
  • HISTORIAN_SCOPE: Memory isolation key.

See scripts/conf_def.sh for current defaults.

Privacy

Hooks see raw prompts and tool I/O, so we always take precautions:

  • scope defaults to {{$userId}} so memories are isolated by identity.
  • Every conversation transcript is passed through scripts/redact.sh to mask out known patterns of sensitive info before reaching memory store.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0