k-kolomeitsev/data-structure-protocol logo

k-kolomeitsev/data-structure-protocol

Free

Graph-based memory for faster context and safer refactors

FreeFree tier
Type
Open Source

About k-kolomeitsev/data-structure-protocol

Data Structure Protocol (DSP) is an open-source, graph-based long-term memory skill for AI coding agents that provides a persistent, versionable map of a codebase — entities, dependencies, public APIs, and the reasons behind connections. Stored in a .dsp/ directory, DSP eliminates the need for agents to re-scan the entire codebase each session, reducing token usage and startup time. It supports agents like Claude Code, Cursor, and Codex, and is git-native for clean diffs and team collaboration. An honest trade-off: bootstrapping on a large project requires significant initial effort, but pays back over the project lifetime through lower per-task token consumption and more predictable agent behavior.

Key Features

Graph-based long-term structural memory stored in .dsp/
Persistent context across AI coding sessions — agent stops re-learning your project every session
Dependency discovery in seconds via graph traversal instead of full-repo scanning
Impact analysis before refactors — know what breaks before you touch it
Safer changes on brownfield codebases — hidden couplings become visible edges in the graph
Works with Claude Code, Cursor, Codex (agent-agnostic skill)
Git-native and versionable — .dsp/ is plain text, diffs cleanly, reviews like code
Each connection in the graph carries a 'why' — the reason it exists

Pros & Cons

Pros
  • Persistent long-term memory eliminates repetitive context rebuilding across sessions
  • Reduces token consumption by avoiding full-repo scans each session
  • Enables faster dependency discovery and impact analysis
  • Works with multiple popular AI coding agents (Claude Code, Cursor, Codex)
  • Git-native and versionable facilitates team collaboration and code review
  • Each connection includes a rationale ('why') for better understanding
  • Open source and free to use
Cons
  • Bootstrapping DSP on a large project takes real effort in time, tokens, and discipline
  • Requires initial setup and ongoing maintenance of the .dsp/ graph
  • Effectiveness depends on agent skill integration and consistency of use
  • Graph may become stale if not updated regularly with codebase changes

Best For

Reducing token usage and session startup time for AI coding agents on large projectsRefactoring impact analysis and safer changes on legacy codebasesPersistent codebase navigation and understanding for team-based AI developmentOnboarding new agents or team members to complex projectsDependency discovery and architectural visualization

FAQ

What is Data Structure Protocol (DSP)?
DSP is an open-source graph-based long-term memory skill for AI coding agents. It maintains a persistent structural map of a codebase (entities, dependencies, APIs, and reasons) in a `.dsp/` directory, allowing agents to avoid re-scanning the code each session.
How does DSP reduce token usage?
Instead of re-scanning the entire codebase, agents read the graph stored in `.dsp/`, which is more concise and structured, reducing the number of tokens needed for context in each session.
Which AI coding agents are supported?
DSP works with Claude Code, Cursor, and Codex. It is designed as an agent skill, not a platform-specific tool, so it can be integrated into various workflows.
Is DSP versionable and team-friendly?
Yes. The `.dsp/` directory contains plain text files that diff cleanly, can be reviewed like code, and are git-native, making them suitable for team collaboration.
What are the trade-offs of using DSP?
Bootstrapping DSP on a large project requires significant initial effort (time, tokens, and discipline). However, it pays back over the project lifetime through lower per-task token usage, faster discovery, and more predictable agent behavior.