Skip to main content

Memory graph for AI agents that learns what to retrieve — and what to suppress.

Project description

🦀 CrabPath

Memory graph for AI agents. Learns what to retrieve — and what to suppress.

Why?

  • RAG loads by similarity. CrabPath loads by learned routes.
  • Positive outcomes strengthen paths. Negative outcomes create inhibitory edges.
  • The graph gets smarter with every query. Unused paths decay.

Install

pip install crabpath

Python 3.10+. Zero dependencies.

Quick Start

from crabpath import Graph, Node, Edge, traverse, TraversalConfig
from crabpath.learn import apply_outcome

g = Graph()
g.add_node(Node("a", "Deploy to production"))
g.add_node(Node("b", "Rollback procedure"))
g.add_edge(Edge("a", "b", 0.7))

result = traverse(g, seeds=[("a", 1.0)], config=TraversalConfig(max_hops=3))
print(result.fired)

apply_outcome(g, result.fired, outcome=1.0)

For AI Agents (CLI)

  • crabpath init --workspace <dir> --output <path>
  • crabpath query <text> --graph <path> --index <path> [--top N] [--json]
  • crabpath learn --graph <path> --outcome <float> --fired-ids <id1,id2,...>
  • crabpath health --graph <path>

How It Works

  • split_workspace scans markdown, creates nodes, and sibling edges.
  • VectorIndex stores caller-provided embeddings and performs cosine search.
  • traverse follows reflex/habitual/dormant tiers with edge damping.
  • apply_outcome applies policy-style updates and Hebbian co-firing.
  • apply_decay slowly forgets weak unused edges.
  • autotune suggests safe defaults from graph health metrics.

Links

Paper / GitHub / PyPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crabpath-3.0.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crabpath-3.0.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file crabpath-3.0.0.tar.gz.

File metadata

  • Download URL: crabpath-3.0.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for crabpath-3.0.0.tar.gz
Algorithm Hash digest
SHA256 e4c2efe5ce21f86ea7fc9424d398e0a508c2cf4416efc3831184a68a8b828092
MD5 be1c216b3bf6dc75bff16035ec84e5a9
BLAKE2b-256 be465e953c752e775bfba3db7db7bef0fbd02f6b7be44bdfc0a70fe7ebe09662

See more details on using hashes here.

Provenance

The following attestation bundles were made for crabpath-3.0.0.tar.gz:

Publisher: publish.yml on jonathangu/crabpath

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file crabpath-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: crabpath-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for crabpath-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36dedcad79e01d3a62ac051758696eb9ee68a27e1500f6375f97694e2cb7ab9f
MD5 3e2f30765026884c0f8823eef391ffba
BLAKE2b-256 dee35cc8a17fff420ad83f2e1fea446cbeaf86d7fc57f85f270401116bf649ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for crabpath-3.0.0-py3-none-any.whl:

Publisher: publish.yml on jonathangu/crabpath

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page