Skip to main content

Hyperdimensional Computing SDK and Runtime

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Glyphh Runtime

Ada's cognitive brain — a hyperdimensional computing runtime that gives LLMs persistent memory, deterministic routing, and background reasoning.

Ada sits between the user and any LLM (Claude, Gemini, GPT). She absorbs everything, recalls what's relevant, and controls what the LLM sees. The LLM is Ada's language center — she is the information boundary.

Architecture

User input
    |
    v
+---------------------------------------------------+
|  Ada's Think Pipeline (per request, 1-3 cycles)   |
|                                                    |
|  1. PERCEIVE   CognitiveGlyph classification       |
|                 STORE | RECALL | FEEL | CONTRADICT |
|                                                    |
|  2. GUARD      Prompt injection firewall            |
|                 HDC cosine similarity, no LLM       |
|                 200+ attack patterns, 16 families   |
|                                                    |
|  3. RECALL     Cognitive gradient search            |
|                 Multi-step vector descent through    |
|                 thought space (see below)            |
|                                                    |
|  4. REASON     Brain router — which capability?     |
|                 HDC routing, sub-10ms deterministic  |
|                                                    |
|  5. ACT        Execute capability query             |
|                                                    |
|  6. EVALUATE   Confidence scoring                   |
|                 < 0.5 → retry or "I don't know"     |
|                 >= 0.5 → LLM synthesizes from facts  |
|                                                    |
|  7. RESPOND    Formulate response                   |
|                 STORE → "Got it."                    |
|                 FEEL → empathy                       |
|                 RECALL → grounded answer or fallback |
+---------------------------------------------------+
    |
    v
Absorb input + response → persist queue → SQLite
Record observation → dream loop

The Cognitive Gradient

The RECALL step is not one-shot similarity search. It's gradient descent through HDC vector space:

  1. Encode the query into a search vector
  2. Find the best matching thought in memory
  3. Compute the residual — the part of the query that wasn't answered
  4. Update the search vector toward the residual
  5. Search again with the updated vector
  6. Stop when the residual norm < 0.15 (converged) or 5 steps exhausted

This is how Ada thinks through a question rather than just pattern-matching. Example: "who am i?" first matches identity patterns broadly, then the residual captures the self-referential "me, not you" signal, and the next step finds the user's name.

The Hallucination Gate

Ada's confidence threshold (0.5) controls whether the LLM is involved:

  • confidence >= 0.5 — LLM synthesizes a natural response from grounded facts. The LLM only sees facts that survived the cognitive gradient. It cannot add information.
  • confidence < 0.5 — LLM is cut out entirely. Ada returns the top fact raw, or says "I don't have information about that in my memory." No confabulation possible.

The Dream Loop

Ada dreams continuously in the background while awake:

  • REM phase (every 3s) — Local pattern mining. Discovers connections between recent thoughts, reinforces frequently-accessed memories (Hebbian strengthening), decays unused ones.
  • Slow-Wave phase (every 30s) — Deep reasoning. Multi-hop inference, contradiction detection, knowledge gap identification. Can crystallize new compound primitives from discovered patterns.

Dreams produce insights — connections, contradictions, convergences, questions, crystallizations — that accumulate and can be drained via the CLI.

Memory

Ada's memory is a ThoughtGlyphSpace — an in-memory HDC vector store backed by SQLite for persistence:

  • Absorb — Natural language is encoded into 5-layer Thought Glyphs (perspective, semantic, relational, temporal, direction) with 2000-dimensional vectors
  • Recall — Three-signal search: content cosine (0.50 weight), per-layer role cosine (0.35), structural Jaccard overlap (0.15)
  • Persistence — Background worker flushes new thoughts to SQLite every 2 seconds. Strengths are flushed on shutdown.
  • Hebbian reinforcement — Recalled memories get stronger. Unused ones decay. Strength caps at 3.0, decay floor at 0.01 (archived, never deleted).

Capabilities

Ada loads capabilities from capabilities/ at boot. Each capability is an HDC model with exemplars:

  • firewall — Prompt injection detection (200+ patterns, 16 attack families)
  • cognitive-router — Routes requests to the right capability
  • speaker-id — Voice identification via MFCC encoding
  • code-index — Semantic codebase search with 4-layer encoding

Ada can build new capabilities autonomously: "build a capability for X" triggers the capability builder, which generates exemplars via LLM, encodes them into HDC vectors, and hot-loads the new model.

MCP Interface

Ada exposes a single MCP tool:

think(input: string) → response

Available at http://localhost:8002/mcp via Streamable HTTP.

Connect from Claude Code

Create .mcp.json in your project root:

{
  "mcpServers": {
    "ada": {
      "type": "http",
      "url": "http://localhost:8002/mcp"
    }
  }
}

Connect from other tools

Any MCP-compatible client can connect to the same endpoint. Ada maintains shared memory across all connected tools — context flows between them.

Install

python3 -m venv .venv
source .venv/bin/activate
pip install glyphh[runtime]

Quick Start

# Start the interactive shell (boots Ada's brain)
glyphh

# Or start as a headless server
glyphh serve

Ada boots in sequence: validate config → load license → init database → load capabilities → encode exemplars → seed identity memories → load persisted thoughts → start dream loop → open MCP endpoint.

CLI Commands

The interactive shell (glyphh) accepts natural language — everything goes through Ada's think pipeline. Prefixed commands:

dream status          Background reasoning stats
dream start           Start the dream loop
dream stop            Stop the dream loop
dream insights        Show recent insights

memory reset          Clear all memory (in-memory + SQLite)

config show           Show current configuration
auth login            Authenticate with Glyphh platform
auth logout           Log out

Testing

pip install glyphh[dev]
pytest tests/unit/ -v

The brain pipeline test suite covers:

  • ThoughtGlyphSpace — absorb, dedup, recall ranking, user vs Ada identity isolation
  • AdaCognitive — StoredThought returns, sentence splitting, recall gating, dream lifecycle
  • ThoughtProcess — STORE/FEEL/RECALL paths, confidence gate, hallucination prevention
  • Brain — seed loading, user identity, persistence queue, end-to-end think

License

Glyphh AI Community License — Copyright (c) 2026 Glyphh AI LLC. All rights reserved.

See LICENSE for full terms. Patent pending (Application No. 63/969,729).

Project details


Release history Release notifications | RSS feed

This version

2.6.7

Download files

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

Source Distribution

glyphh-2.6.7.tar.gz (731.9 kB view details)

Uploaded Source

Built Distribution

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

glyphh-2.6.7-py3-none-any.whl (844.2 kB view details)

Uploaded Python 3

File details

Details for the file glyphh-2.6.7.tar.gz.

File metadata

  • Download URL: glyphh-2.6.7.tar.gz
  • Upload date:
  • Size: 731.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for glyphh-2.6.7.tar.gz
Algorithm Hash digest
SHA256 d7dd3ebd671dd0a921f9aa2615d9e38b9a9d3cb2ee338c20387863eb63bca236
MD5 03736c029c77ee2c0a5486bae2865e01
BLAKE2b-256 1299719e1749ffdc35713d06f373c8c960dfeba173f3b73897bcc5a4647c73f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyphh-2.6.7.tar.gz:

Publisher: release.yml on glyphh-ai/glyphh-runtime

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

File details

Details for the file glyphh-2.6.7-py3-none-any.whl.

File metadata

  • Download URL: glyphh-2.6.7-py3-none-any.whl
  • Upload date:
  • Size: 844.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for glyphh-2.6.7-py3-none-any.whl
Algorithm Hash digest
SHA256 52697789a036860b8901afa4ef3b70b47e3a7baef5bed4a535a1cc02ec882981
MD5 d3671c8ffc56a3592b4b0e47297e947a
BLAKE2b-256 77dbbfd4c1a2ac30567511562297b6ff856f21aacbaac430d5e8090feab05177

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyphh-2.6.7-py3-none-any.whl:

Publisher: release.yml on glyphh-ai/glyphh-runtime

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