Skip to main content

Resources Graph

Remember public GitHub issues, pull requests, repositories, and lists your agent explored, so later sessions can read them from Memgraph.

An optional Context Graph component. Hooks record addresses; a separate sweep fetches public content; the resource tool reads the stored copy. Resources are shared, while each user's record of touching them stays private.

Setup

With a uv tool installation of Context Graph, enable the connector and rerun setup. Setup installs the missing package into the same tool environment and exposes its command:

memgraph-context-graph config set capture.connectors "skills-graph, actions-graph, sessions-graph, resources-graph"
memgraph-context-graph setup

For a Python virtual environment, install it there with pip install 'resources-graph[memgraph-context-graph]' and create the schema with resources-graph setup.

GitHub access

The Sweep fetches with your existing gh login (gh auth login) — the same access your agent reads GitHub with. GitHub's GraphQL API needs a token even for public data. On a machine without gh, set one instead: memgraph-context-graph config set github.token (it prompts; it also wins over the gh login when set). With no credentials at all the Sweep still fetches single issues, PRs and repositories over REST (60 requests an hour); listings wait until there are credentials.

Sweep captured resources

Restart the agent so its MCP server discovers the resource tool, then sweep captured touches:

resources-graph sweep

How it works

  1. Touch — when the agent fetches GitHub itself (WebFetch, gh issue|pr|repo view, gh issue|pr list, gh api repos/..., curl to api.github.com, a GitHub MCP tool) or a prompt mentions a GitHub link, the hook records an address-only Touch (FETCHED or PROMPTED). A listing is one Touch, not one per member. Hooks never call GitHub.
  2. Sweep — resources-graph sweep (out of band: after a session, or on a schedule) fetches what pending Touches name, at full depth and public-only, and stores it as Resources; a listing's members are fetched up to the limit the agent asked for. What it can't fetch stays as an Unresolved Touch with a reason (not_found, not_public, rate_limited).
  3. Cache Read — the model's resource tool (served by memgraph-context-graph mcp) returns a stored Resource with fetched_at and GitHub's updated_at; the model decides whether that is fresh enough. A listing comes back as a paged index; members are read one at a time. It never calls GitHub. Each call is recorded as a Touch with outcome hit, subsumed or miss.
  4. Nudge — just before the agent fetches something memory already holds, one line tells it so (with the same facts) — on Claude Code and Codex, the harnesses whose pre-tool hook can add context without touching the call. The fetch always runs.

Resources belong to no user and are shared; a Touch is private to the user whose session made it.

Listings

gh issue list -R memgraph/memgraph --label bug becomes one shared Listing, keyed by repository, kind and normalised filters (state, labels, author, assignee, milestone) or the exact search text. It is answered from memory when:

  • hit — the same Listing is stored and holds every member, or at least as many as asked (members keep GitHub's order, newest created first, so a shorter ask is a prefix);
  • subsumed — a fully expanded Listing of the same repository and kind filters at most as narrowly (all open issues answer --label bug), and the stored members are filtered locally.

Free-text searches only hit exactly. A truncated Listing (--limit 500 of 686) answers only shorter asks of itself.

Freshness

No TTL and no background crawl: a Resource is revalidated only when the agent really fetches it again (the model judged memory too stale). Then the Sweep makes one cheap check of GitHub's updatedAt — for a Listing, a light index of its members — and refetches at full depth only what changed; unchanged content just gets a new fetched_at. Reactions don't move GitHub's updatedAt, so reaction counts may be stale.

Closed wayfinder:map issues are served with a reading note: their build plans may already have shipped. A recent fetch does not make the source narrative current; check linked implementation PRs, current code and releases before proposing pending work.

When GitHub rate-limits, the Sweep stops; that Touch is kept as rate_limited and it and the rest are retried by the next Sweep.

A transferred issue gets a new GitHub id (the id embeds its repository). When a fetch finds an item somewhere new, the old Resource releases its Address and points at the new one with MOVED_TO.

Graph model

(:Session)<-[:IN_SESSION]-(:Touch)-[:TOUCHED]->(:Resource | :Listing)
(:Resource:Repository)-[:HAS_ISSUE|HAS_PULL_REQUEST]->(:Resource:Issue|PullRequest)
(:Resource:Issue|PullRequest)-[:HAS_COMMENT]->(:Comment)
(:Listing)-[:LISTS_FROM]->(:Repository), (:Listing)-[:HAS_MEMBER {position}]->(:Issue|PullRequest)
(:Resource)-[:REFERENCES]->(:Resource), (:PullRequest)-[:CLOSES]->(:Issue)
(:Resource)-[:MOVED_TO]->(:Resource)
(:Touch)-[:CAUSED_BY]->(:ToolCall), (:Touch)-[:BY_AGENT]->(:Agent)   -- actions-graph's nodes
  • Resource — keyed on GitHub's node_id; address (github:owner/repo#123) is a mutable lookup, fetched_at and updated_at are on every Resource. Issue/PR: title, body, state, author, labels, assignees, milestone, timestamps, comment count; PR adds merged, base ref and changed-file paths (no diff). Repository: description, README, stars, pushed_at.
  • Comment — one per comment, review comments with their file path; captured with its item, never touched on its own.
  • Listing — shared like a Resource but not one: key, limit, total_count, member_count, fully_expanded, fetched_at; a refetch replaces its members.
  • REFERENCES / CLOSES — drawn only between stored Resources, whichever end was stored first; references to anything not in memory are kept on the item as URLs (referenced_by_urls, closes_urls).
  • Touch — address, provenance (FETCHED / PROMPTED), served_from_memory, outcome (Cache Reads), status (pending / resolved / unresolved) and reason, tool_use_id, agent_name, at. The Sweep links it to the actions-graph ToolCall (same tool_use_id, same Session) and subagent Agent it came from, when actions-graph recorded them.

Which harnesses show the Nudge

Harness Nudge before a fetch Otherwise
Claude Code, Codex yes — PreToolUse additionalContext, no permission decision
Copilot CLI, Cursor, OpenCode, Grok Build, Antigravity CLI no — their pre-tool hooks can only allow, deny or rewrite the call the session-start hint about the resource tool

Development

From the repository root:

./scripts/dev-memgraph.sh test resources-graph

See the domain model for terminology and the design for the decisions behind it.

Metadata

Release files for resources-graph 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for resources-graph 0.3.2
File Size Uploaded Provenance Actions
resources_graph-0.3.2.tar.gz 138.9 kB Without provenance Details for resources_graph-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for resources-graph 0.3.2
File Interpreter ABI Platform Actions
resources_graph-0.3.2-py3-none-any.whl Python 3 none any Details for resources_graph-0.3.2-py3-none-any.whl

Total release size: 182.7 kB

Release files / resources_graph-0.3.2.tar.gz

Download URL resources_graph-0.3.2.tar.gz
Size 138.9 kB
Tags Source
SHA-256 checksum
How to use checksums
71f08799770297994f4b7bb664e3f4cbeda8251e89c305968c8d5abbab62d73b
BLAKE2b-256 checksum
How to use checksums
ac5576377586104c974442856de4f9b7392c299f12bd76742389c81e47d46f0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / resources_graph-0.3.2-py3-none-any.whl

Download URL resources_graph-0.3.2-py3-none-any.whl
Size 43.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
342b9a73ea33c8fc5c27d786c54ae6355dc0aa298ddaa487dba00dd586bec857
BLAKE2b-256 checksum
How to use checksums
14ab9abc48af16a0be0a56a4eb19afc3326498d4617877a44ef5fafe72889ecf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for resources-graph 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page