Skip to main content

High-performance graph library for the Kelvin Agentic OS — petgraph-backed engine, 40+ algorithms, RDF/SPARQL, knowledge-graph tools

Project description

kaos-graph

High-performance graph library for the Kelvin Agentic OS.

Backed by petgraph (Rust) with PyO3 bindings.

Features

  • String-keyed nodes with JSON-compatible properties
  • Directed, undirected, and optional multigraph semantics
  • Built-in algorithms: BFS/DFS, Dijkstra, Bellman-Ford, A*, PageRank, Tarjan SCC, topological sort, critical path, matching, cliques, bridges
  • JSON serialization and pickle support
  • Typed Python API with dataclass result types
  • Program/trace graph helpers for kaos-llm-core integration

Quick Start

from kaos_graph import Graph
from kaos_graph.algorithms import pagerank, shortest_paths, topological_sort

g = Graph()
g.add_node("alice", role="engineer")
g.add_node("bob", role="manager")
g.add_edge("alice", "bob", relationship="reports_to")

# Algorithms
ranks = pagerank(g)
costs = shortest_paths(g, "alice")
order = topological_sort(g)

Program And Trace Graphs

from kaos_graph.algorithms import critical_path
from kaos_graph.programs import program_to_graph, trace_to_graph

structure = program_to_graph(my_program)
runtime = trace_to_graph(my_trace)

# Static containment view of a Program
print(structure.to_json())

# Runtime bottleneck analysis over an ExecutionTrace
bottleneck = critical_path(runtime, weight="latency_ms")
print(bottleneck.path, bottleneck.cost)

program_to_graph() produces a containment graph from Program.named_calls(). trace_to_graph() produces a runtime execution graph with data_flow edges plus timing and cost metadata for critical-path analysis.

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

kaos_graph-0.1.0a1.tar.gz (155.5 kB view details)

Uploaded Source

Built Distributions

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

kaos_graph-0.1.0a1-cp313-abi3-win_arm64.whl (935.1 kB view details)

Uploaded CPython 3.13+Windows ARM64

kaos_graph-0.1.0a1-cp313-abi3-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.13+Windows x86-64

kaos_graph-0.1.0a1-cp313-abi3-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.13+musllinux: musl 1.2+ x86-64

kaos_graph-0.1.0a1-cp313-abi3-musllinux_1_2_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.13+musllinux: musl 1.2+ ARM64

kaos_graph-0.1.0a1-cp313-abi3-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13+manylinux: glibc 2.28+ x86-64

kaos_graph-0.1.0a1-cp313-abi3-manylinux_2_28_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.13+manylinux: glibc 2.28+ ARM64

kaos_graph-0.1.0a1-cp313-abi3-macosx_11_0_arm64.whl (982.4 kB view details)

Uploaded CPython 3.13+macOS 11.0+ ARM64

File details

Details for the file kaos_graph-0.1.0a1.tar.gz.

File metadata

  • Download URL: kaos_graph-0.1.0a1.tar.gz
  • Upload date:
  • Size: 155.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kaos_graph-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 1282850fcc46930c52263d6f3c4512b3cb468c9f4aebe4a18e7f15a062f60c5d
MD5 e6896ca29d504e3c045d3c859d51162c
BLAKE2b-256 91a0819c58a96ee75893ef3df556ef16cae6d79d736f3e04fdf882166f5b6891

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaos_graph-0.1.0a1.tar.gz:

Publisher: release.yml on 273v/kaos-graph

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

File details

Details for the file kaos_graph-0.1.0a1-cp313-abi3-win_arm64.whl.

File metadata

  • Download URL: kaos_graph-0.1.0a1-cp313-abi3-win_arm64.whl
  • Upload date:
  • Size: 935.1 kB
  • Tags: CPython 3.13+, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kaos_graph-0.1.0a1-cp313-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 53cbcbbc809ac6385d72e2d393960e88758496d019caf2467e49a2d559451500
MD5 046c1b368f2035b65e71fd1cc92fcc02
BLAKE2b-256 a35380c9d342ff1cdcac5e8f360543552de37fb01828b08894266047e81df78d

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaos_graph-0.1.0a1-cp313-abi3-win_arm64.whl:

Publisher: release.yml on 273v/kaos-graph

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

File details

Details for the file kaos_graph-0.1.0a1-cp313-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for kaos_graph-0.1.0a1-cp313-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e4b1b5510f2940b1183876f62901cdcc3a3e903ab27bd36e7ddeabf06664ac20
MD5 3224430812146106ebf20979ebda8d11
BLAKE2b-256 43b1df5196956dc95290801f4e8e6a7a13ac40a2ba464a608760b3252fd3e8c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaos_graph-0.1.0a1-cp313-abi3-win_amd64.whl:

Publisher: release.yml on 273v/kaos-graph

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

File details

Details for the file kaos_graph-0.1.0a1-cp313-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for kaos_graph-0.1.0a1-cp313-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b1e2b97dd87fdf41a4af0005eab9ec539bbd4839612a9c3e7dcf5b7df25a6804
MD5 97e1afbe22e84b221f0de276557091fd
BLAKE2b-256 846773e49031b82971e73bdf850912a308b137d6ae2047da3774d600e6836bfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaos_graph-0.1.0a1-cp313-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on 273v/kaos-graph

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

File details

Details for the file kaos_graph-0.1.0a1-cp313-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for kaos_graph-0.1.0a1-cp313-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 b75c65ec7677eba1a0ef79cee58a5dea7ab7964a1cfa09b379e5662539d0e0ab
MD5 b3a8b3119367f80ac11a400888c8fba8
BLAKE2b-256 4f084672d55938088ac0b724af8cf570e1ed8e6abce760b68d2d4c766a47b547

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaos_graph-0.1.0a1-cp313-abi3-musllinux_1_2_aarch64.whl:

Publisher: release.yml on 273v/kaos-graph

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

File details

Details for the file kaos_graph-0.1.0a1-cp313-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for kaos_graph-0.1.0a1-cp313-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 41ff71b4fdb5f67890cfde35c70833e93f5beb2579eda08191e73fc777616e25
MD5 713d2b268d79c4fcbe15e0e7d673e938
BLAKE2b-256 d70d6791c40b490b1e1500d717079feabbce4239aa013c2ef5e891f33e983db7

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaos_graph-0.1.0a1-cp313-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on 273v/kaos-graph

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

File details

Details for the file kaos_graph-0.1.0a1-cp313-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for kaos_graph-0.1.0a1-cp313-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 01698a937f79f0d78181399b53085ce48d3bfaaa528790fece349025dc00fa61
MD5 057a8b9db82779ca6a05856ef7f5bfc7
BLAKE2b-256 1f263d6f96df70a7f0851980c7f4cb5702142f60da1bf59727f3d2ced823680a

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaos_graph-0.1.0a1-cp313-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on 273v/kaos-graph

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

File details

Details for the file kaos_graph-0.1.0a1-cp313-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kaos_graph-0.1.0a1-cp313-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ffb0d0a9aeaacbca8bf980ab59a67a7b285a800e392ad632c2b762041101968
MD5 d2fb87c1a9fc2002584758748f9ba6f6
BLAKE2b-256 6f129de51324ddb5863bca3cbbf57d4a386ebf4df426f92e7cf2211079f4318a

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaos_graph-0.1.0a1-cp313-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on 273v/kaos-graph

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