← All projects
ai

Wisteria

Graph database library. Nodes, edges, traversal, multi-head activation, compressed awareness. Zero opinions about your application.

PythonGDScriptGraph TheoryPCA

Wisteria is Grimvane’s graph database library. Store typed nodes and directed edges with metadata. Query neighbors, find shortest paths, extract subgraphs, traverse to arbitrary depth. Three pluggable backends: in-memory, SQLite, PostgreSQL. Same API regardless of backend.

What sets Wisteria apart is what sits on top of the core graph engine.

Multi-Head Activation

Wisteria doesn’t just tell you what’s connected to something. It tells you what’s relevant to something, and the answer changes based on what you’re doing.

Each “head” is an independent perspective defined by edge-type families. A dependency head follows consumes and depends-on edges. An organizational head follows contains edges. A presentation head follows website-for and markets edges. Each head produces its own relevance map.

A query-context weight vector controls the mix. Debugging weights dependencies high and marketing low. Business planning inverts it. Same graph, different lens, different ranking.

Compressed Awareness

Derived from KVTC (KV Cache Transform Coding), Wisteria applies transform coding to graph node activation states. PCA decorrelation identifies redundancy in the activation space. Dynamic programming allocates precision per component. Nodes are stored in three tiers:

Decay is compression. Rejuvenation is decompression. Information is never destroyed, only stored at varying fidelity. When a compressed node becomes relevant again, it decompresses — no recomputation needed.

Why It Matters

An 8B parameter model cannot reliably reason through a multi-hop graph with weighted traversal. But it can call engine.activate("corvath") and read a ranked list. The library does the precise computation. The model interprets results and takes action.

Wisteria is cognitive infrastructure. Necessary for constrained models. Superior for capable ones.

Core API

from wisteria import Graph

g = Graph()
g.add_node("corvath", type="product", metadata={"name": "Corvath"})
g.add_node("wisteria", type="library", metadata={"name": "Wisteria"})
g.add_edge("corvath", "wisteria", type="consumes")

neighbors = g.neighbors("corvath")
path = g.shortest_path("corvath", "wisteria")
sub = g.subgraph(["corvath", "wisteria"])

Consumers

ProjectUsage
CorvathKnowledge graphs, tool dependency chains, session context linking
Project BlackboxNPC relationship graphs, faction networks, rumor propagation
KindlefallOverworld map generation, rival faction pathfinding, territory control (via GDScript port)