Metadata-Version: 2.4
Name: glyphh
Version: 1.2.5
Summary: Hyperdimensional Computing SDK and Runtime
Author-email: Glyphh AI <support@glyphh.ai>
License: Proprietary
Project-URL: Homepage, https://glyphh.ai
Project-URL: Repository, https://github.com/glyphh-ai/glyphh-runtime
Project-URL: Documentation, https://docs.glyphh.ai
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: click>=8.0.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: pyjwt[crypto]>=2.8.0
Provides-Extra: runtime
Requires-Dist: fastapi>=0.100.0; extra == "runtime"
Requires-Dist: uvicorn[standard]>=0.23.0; extra == "runtime"
Requires-Dist: python-multipart>=0.0.6; extra == "runtime"
Requires-Dist: sqlalchemy[asyncio]>=2.0.0; extra == "runtime"
Requires-Dist: asyncpg>=0.28.0; extra == "runtime"
Requires-Dist: pgvector>=0.2.0; extra == "runtime"
Requires-Dist: alembic>=1.12.0; extra == "runtime"
Requires-Dist: aiosqlite>=0.19.0; extra == "runtime"
Requires-Dist: pydantic>=2.0.0; extra == "runtime"
Requires-Dist: pydantic-settings>=2.0.0; extra == "runtime"
Requires-Dist: email-validator>=2.0.0; extra == "runtime"
Requires-Dist: psutil>=5.9.0; extra == "runtime"
Requires-Dist: mcp>=1.26.0; extra == "runtime"
Provides-Extra: telemetry
Requires-Dist: prometheus-client>=0.17.0; extra == "telemetry"
Requires-Dist: opentelemetry-api>=1.20.0; extra == "telemetry"
Requires-Dist: opentelemetry-sdk>=1.20.0; extra == "telemetry"
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.41b0; extra == "telemetry"
Requires-Dist: opentelemetry-exporter-otlp>=1.20.0; extra == "telemetry"
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: hypothesis>=6.82.0; extra == "dev"
Requires-Dist: black>=23.7.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Requires-Dist: ruff>=0.0.285; extra == "dev"
Dynamic: license-file

# Glyphh Runtime

Hyperdimensional computing runtime for deterministic, explainable AI.

Glyphh encodes natural language into high-dimensional vector representations using Vector Symbolic Architecture (VSA). No LLM in the loop — just math. Same input, same output, every time.

## Features

- **MCP Server** — Model Context Protocol interface for LLM sidecar integration
- **GraphQL API** — Query knowledge graphs and fact trees with confidence scores
- **CLI** — Manage models, deploy runtimes, and interact with the Glyphh Hub
- **Deterministic** — Auditable, reproducible results grounded in cosine similarity

## Install

Setup your python environment:

```bash
python3 -m venv venv
source venv/bin/activate
```

Glyphh ships as a single package with different install profiles:

| Profile | Command | What you get |
|---------|---------|-------------|
| SDK | `pip install glyphh` | Encoder, similarity, CLI, model packaging. Lightweight — just numpy, pyyaml, click, httpx. |
| Runtime | `pip install glyphh[runtime]` | Everything in SDK + FastAPI server, SQLAlchemy, pgvector, Alembic, Pydantic. For running the runtime locally. |
| Dev | `pip install glyphh[dev]` | Everything in SDK + pytest, hypothesis, black, ruff, mypy. For contributing to Glyphh. |

Most users want either SDK (build and package models) or Runtime (deploy and serve them).

## Quick Start

The runtime requires PostgreSQL with pgvector. Pick whichever option fits your setup:

### Option 1 — Docker Compose (recommended)

Requires [Docker Desktop](https://www.docker.com/products/docker-desktop/) (or Docker Engine + Compose plugin).

The CLI can scaffold the Docker files for you:

```bash
pip install glyphh[runtime]
glyphh docker init
docker pull ghcr.io/glyphh-ai/glyphh-runtime:latest
docker compose up -d
```

`glyphh docker init` writes a `docker-compose.yml` and `init.sql` into your current directory. The compose file runs PostgreSQL with pgvector and the published runtime image — no build step needed.

Verify it's running:

```bash
curl http://localhost:8002/health
```

### Option 2 — Docker (manual)

Run the database and runtime as individual containers:

```bash
docker run -d --name glyphh-db \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_DB=glyphh_runtime \
  -p 5432:5432 \
  pgvector/pgvector:pg16

docker pull ghcr.io/glyphh-ai/glyphh-runtime:latest

docker run -p 8002:8002 \
  -e DATABASE_URL=postgresql+asyncpg://postgres:postgres@host.docker.internal:5432/glyphh_runtime \
  ghcr.io/glyphh-ai/glyphh-runtime:latest
```

Or with an existing database:

```bash
docker run -p 8002:8002 \
  -e DATABASE_URL=postgresql+asyncpg://user:pass@your-db-host:5432/glyphh \
  ghcr.io/glyphh-ai/glyphh-runtime:latest
```

### Option 3 — pip install (bring your own Postgres)

If you already have PostgreSQL with pgvector running:

```bash
pip install glyphh[runtime]
export DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/glyphh_runtime
glyphh serve
```

### Query a deployed model

```bash
glyphh query "What is the refund policy?"
```

## How It Works

1. Your LLM sends a natural language query via MCP
2. Glyphh encodes it into a high-dimensional vector using stored procedures
3. The encoded query resolves against a knowledge graph via GraphQL
4. Fact trees with confidence scores are returned to ground the LLM's response

## License

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

See [LICENSE](https://github.com/glyphh-ai/glyphh-runtime/blob/main/LICENSE) for full terms. Patent pending (Application No. 63/969,729).
