Hypha Stack
Components made to fit together.
Designed from the ground up for agents and people to build software that matters.
HTTP and APIs
An RFC-strict web framework, typed end to end, fast and multi-core by design. OpenAPI docs via Scalar.
Data contracts
Unified JSON contracts, strict by the standard, for backend, frontend and agents. Printed as JSON Schema and Zod.
Data and persistence
Typed Postgres queries, checked against the database schema. Migrations built in, on a native driver with TLS, pooling and failover.
Observability
OpenTelemetry-compatible logs, traces and metrics, from the first request into every query. Health checks for any orchestrator, and no secret ever logged.
Identity and access
Sessions, CSRF and CORS, secure by default. Standard credentials and per-route rate limits.
Jobs
A durable job queue in your own Postgres that scales. Scheduled, prioritised and resilient.
Identity
OAuth, permissions and tenants.
WIP
Analytics
Typed dataframes and an embedded OLAP engine.
WIP
Integrations
Webhooks, notifications and SDKs for third-party services.
WIP
One ontology for people and agents.
An explicit model of what a backend is built from: its concepts, what each one means, and how they relate. People and agents work from the same definitions. No one has to guess what a word means.
- Route answers Request.
- Route returns Response.
- Refusal is a Response.
- Handler serves Route.
- Route is typed by Data shape.
- Client schema printed from Data shape.
- API spec printed from Route.
- Handler runs Statement.
- Statement returns Row.
- Statement runs on Database.
- Migration changes Database.
- Connection pool connects to Database.
- Transaction groups Statement.
- Trace follows Request.
- Span is part of Trace.
- Span records Statement.
- Metric counts Request.
- Log records Request.
- Health check checks Database.
- Identity has Permission.
- Permission guards Route.
- Request carries Session.
- Session proves Identity.
- Identity acts for Tenant.
- Rate limit throttles Request.
- Audit log records Request.
- Handler reads Config.
- Config holds Secret.
- Feature flag gates Handler.
- Handler reads Cache.
- Handler emits Event.
- Event waits in Queue.
- Queue feeds Job.
- Schedule starts Job.
- Webhook delivers Event.
- Job runs Statement.
- Handler stores File.
- Event triggers Notification.
- Notification sent as Email.
What the language cannot say, the system cannot get wrong.
OCaml meets every need at once, and the stack is built within its limits. It makes contracts and failure cases explicit, but it does not make an application correct on its own.
- Types that model the domain
- Variants and records name each state, pattern matching handles each one, and the compiler warns of a case left out.
- Boundaries in the language
- Module signatures and abstract types say what a component exposes, and the compiler holds every caller to it.
- Code that reads as its model
- Concise, with types inferred, keeping intent and failure cases in plain sight.
- Feedback while the work is fresh
- Builds and tests stay quick enough for the compiler to answer inside the loop an agent works in.
- Native and managed
- Compiled to native code, with a garbage collector and a simple runtime.
- Effects for I/O
- Concurrency without async and await: code reads in order, and every task is bound to the work that started it.
OCaml in production at
- Jane Street
- Bloomberg
- Meta
- Docker
- Ahrefs
- Tezos
- LexiFi
- Citrix
Practices that hold the boundaries.
Rules for how the code is written and worked on, the same in every repository and checked on every change.
- One house style.
- One way to write each thing, kept word for word across every repository. Code by a person or an agent reads as if one hand wrote it.
- Instructions next to the code.
- Each repository carries the full context and workflow its agents need, everything the code cannot say itself: the decisions behind it, the rules it keeps, and how a change becomes a commit.
- A harness that knows the code.
- Agents look up types and definitions, follow each error to its cause and search the code, reading what it means rather than guessing from its text.
- Boundaries, enforced.
- Contracts held by the compiler, statements checked against the database, the API's description checked against its routes.
- Computed, not guessed.
- What can be worked out is worked out: generated, parsed, validated, compiled. A model is asked only where judgement is needed.
- Open at the core.
- The components are open source. Putting them together for a product, and the judgement that takes, is the expertise Hypha brings.
Build with Hypha.
Talk to us
Bring a product or an idea.
Read the code
The components are open: source, tests and documentation.
Read the principles
The argument in full, in seven propositions.
