Skip to content

Repository files navigation

Source to Memory

An OCR-free evidence memory skill for AI coding agents.

source-to-memory does not turn books into long Markdown memories. It builds a small, verifiable routing graph that tells an agent which original source to inspect, exactly where, and why that location is trusted.

Why it is different

Content extraction memory Source to Memory
Copies or OCRs source text Stores no source text or OCR dump
Searches extracted prose Searches compact metadata and aliases
May lose page layout and figures Points to exact page, slide, timestamp, cell, or code line
Becomes stale silently Detects source changes with SHA-256 fingerprints
Mixes notes and facts Tracks verified, draft, stale, superseded, and excluded
Often duplicates copyrighted material Keeps originals in their authorized private location

This makes it useful for books, scanned worksheets, videos, spreadsheets, repositories, policies, research, answer audits, and long-running projects. OCR can still be used by another tool as a search hint, but it is never required and never treated as proof.

The memory circuit

request
   |
   v
small catalog metadata  -- no original content loaded
   |
   v
verified record + exact locator + source fingerprint
   |
   v
open only the required original page / slide / timestamp / cell / line

Install as a skill

Copy skill/source-to-memory into your agent's skill directory.

On Windows, install it globally for Codex, Claude Code, and agents that use the common .agents directory:

.\install-global.ps1

On macOS or Linux:

./install-global.sh

Global installation makes the skill available from every repository. Each repository should keep its own .source-memory/source-memory.json so project evidence stays isolated.

Codex (PowerShell)

Copy-Item -Recurse -Force .\skill\source-to-memory "$HOME\.codex\skills\source-to-memory"

Claude Code (PowerShell)

Copy-Item -Recurse -Force .\skill\source-to-memory "$HOME\.claude\skills\source-to-memory"

Quick start

python skill/source-to-memory/scripts/source_memory.py init source-memory.json \
  --name "My verified sources" --root "D:/private/sources"

python skill/source-to-memory/scripts/source_memory.py add-source source-memory.json \
  "D:/private/sources/manual.pdf" --id manual-v1 --title "Manual v1" \
  --kind pdf --sensitivity private

python skill/source-to-memory/scripts/source_memory.py add-record source-memory.json \
  --id manual.approval --title "Approval flow" --summary "Current approval sequence" \
  --tag approval --alias "승인 절차" --status verified \
  --pointer "manual-v1|source|p. 18, table 2|Checked against the original page"

python skill/source-to-memory/scripts/source_memory.py check source-memory.json
python skill/source-to-memory/scripts/source_memory.py query source-memory.json "승인 절차"
python skill/source-to-memory/scripts/source_memory.py bundle source-memory.json "승인 절차"

Commands

  • init: create an empty catalog.
  • locate: find the nearest repository catalog, then the optional global fallback.
  • add-source: register a file identity and SHA-256 fingerprint without extraction.
  • add-record: add aliases, tags, status, and exact evidence locators.
  • check: validate schema, pointers, files, fingerprints, and forbidden payloads.
  • refresh: detect changed source files; --write accepts new fingerprints after review.
  • query: rank records without opening originals.
  • bundle: emit a bounded retrieval plan containing paths and locators, not content.

Run check --public before sharing a catalog. It rejects private metadata and absolute paths. Never publish copyrighted pages, private transcripts, answer keys, or sensitive originals with a catalog.

Repository layout

skill/source-to-memory/
  SKILL.md
  agents/openai.yaml
  references/
  scripts/source_memory.py
tests/

The skill is domain-neutral. Keep each project's knowledge in a separate source-memory.json catalog instead of modifying the skill.

License

MIT. Source documents and catalogs retain their own access and copyright restrictions.

About

OCR-free evidence memory skill for routing AI agents to exact verified sources

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages