---
title: "Semaprax Semantic Program Graph Architecture"
canonical: https://wavect.io/semaprax/architecture/
language: en
description: "How the Semaprax semantic program graph, stable IDs, bounded context, revisions, and semantic patches form an agent-facing compiler architecture."
image: "https://wavect.io/img/general/bak/open_graph_preview.jpg"
---

ARCHITECTURE · GRAPH V10-V14

# A program model that agents can query without reconstructing meaning from text.

Stable identity first. Source edits second.

The Semaprax semantic program graph records typed declarations, effects, contracts, ownership facts, call relationships, and lowering identities under a content-derived revision.

semaprax://architecture v0.2

```
entity     Semaprax
status     pre-alpha research
verified   2026-08-11
authority  github.com/wavect/semaprax
```

## How does Semaprax work?

Semaprax parses human-readable source into validated HIR and a versioned semantic graph. Agents request bounded context by stable ID, preview or submit a patch against an exact revision, and receive deterministic diagnostics or evidence before native or Wasm lowering.

// 01

## Stable identity first. Source edits second.

### Stable semantic identity

Authored `@id` values and compiler-owned identities persist across source projections, HIR, graph serialization, diagnostics, and generated symbols. Identity is validated as NUL-free before it reaches machine output.

### Bounded agent context

Agent Context v1 and v2 return dependency-bounded graph slices with explicit node, byte, depth, and traversal limits. The default remains v1; v2 adds directional call traversal and separate frontiers.

### Revision-bound semantic patches

Patch operations target semantic identities and an exact graph revision. Stale revisions fail closed. Current patch families are deliberately bounded, including renames and selected persistent member, case, and generic-call changes.

### Evidence before publication

Review, impact, target-evidence, and workspace-evidence routes produce deterministic artifacts with explicit nonclaims. They do not grant approval, prove general correctness, or replace project tests.

// 02

## The source projection stays readable

```
module examples.meaning;

@id("math.add")
fn add(left: i64, right: i64) -> i64
    requires left >= 0
    ensures result == left + right
{
    left + right
}
```

GitHub specifications are the normative source. This page is a dated research summary. [GitHub repository](https://github.com/wavect/semaprax).

// FAQ

## Questions, answered without the hype

### Is the semantic graph a knowledge graph or RAG system?

No. It is the compiler's typed, versioned program representation. It records declarations, identities, effects, contracts, relationships, and lowering facts rather than generic documents or embeddings.

### Can an agent edit any program through semantic patches?

Not yet. Current patch schemas admit bounded operation families and reject stale revisions, unsupported selectors, malformed artifacts, and semantic widening.

Research project by Wavect: [Wavect GmbH](/). Created by Wavect as an open-source systems research project.

## Structured Data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://wavect.io/#organization",
      "@type": [
        "Organization",
        "ProfessionalService",
        "LocalBusiness"
      ],
      "employee": [
        {
          "@id": "https://wavect.io/team/kevin-riedl/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Kevin Riedl",
          "url": "https://wavect.io/team/kevin-riedl/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        },
        {
          "@id": "https://wavect.io/team/christof-jori/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Christof Jori",
          "url": "https://wavect.io/team/christof-jori/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        }
      ],
      "founder": [
        {
          "@id": "https://wavect.io/team/kevin-riedl/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Kevin Riedl",
          "url": "https://wavect.io/team/kevin-riedl/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        },
        {
          "@id": "https://wavect.io/team/christof-jori/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Christof Jori",
          "url": "https://wavect.io/team/christof-jori/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        }
      ],
      "legalRepresentative": [
        {
          "@id": "https://wavect.io/team/kevin-riedl/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Kevin Riedl",
          "url": "https://wavect.io/team/kevin-riedl/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        },
        {
          "@id": "https://wavect.io/team/christof-jori/#person",
          "@type": "Person",
          "jobTitle": "Managing Director",
          "name": "Christof Jori",
          "url": "https://wavect.io/team/christof-jori/",
          "worksFor": {
            "@id": "https://wavect.io/#organization",
            "@type": [
              "Organization",
              "ProfessionalService",
              "LocalBusiness"
            ]
          }
        }
      ],
      "name": "Wavect GmbH",
      "subjectOf": {
        "@id": "https://wavect.io/verified-claims.json#dataset",
        "@type": "Dataset",
        "creator": {
          "@id": "https://wavect.io/#organization",
          "@type": [
            "Organization",
            "ProfessionalService",
            "LocalBusiness"
          ]
        },
        "description": "A machine-readable registry of quantitative and qualitative claims published by Wavect, with review dates, localized page appearances and public third-party citations where available.",
        "inLanguage": "en",
        "isAccessibleForFree": true,
        "license": "https://creativecommons.org/licenses/by/4.0/",
        "name": "Wavect verified publication claims",
        "url": "https://wavect.io/verified-claims.json"
      },
      "url": "https://wavect.io/"
    },
    {
      "@id": "https://wavect.io/team/kevin-riedl/#person",
      "@type": "Person",
      "jobTitle": "Managing Director",
      "name": "Kevin Riedl",
      "sameAs": [
        "https://www.wikidata.org/wiki/Q139796365",
        "https://www.linkedin.com/in/wsdt",
        "https://github.com/wsdt"
      ],
      "url": "https://wavect.io/team/kevin-riedl/",
      "worksFor": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      }
    },
    {
      "@id": "https://wavect.io/team/christof-jori/#person",
      "@type": "Person",
      "jobTitle": "Managing Director",
      "name": "Christof Jori",
      "sameAs": [
        "https://www.wikidata.org/wiki/Q139796367",
        "https://www.linkedin.com/in/jocr77/",
        "https://github.com/jo-chris"
      ],
      "url": "https://wavect.io/team/christof-jori/",
      "worksFor": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      }
    },
    {
      "@id": "https://wavect.io/#website",
      "@type": "WebSite",
      "inLanguage": [
        "en",
        "de",
        "es",
        "zh"
      ],
      "name": "Wavect",
      "potentialAction": {
        "@type": "SearchAction",
        "query-input": "required name=search_term_string",
        "target": {
          "@type": "EntryPoint",
          "urlTemplate": "https://wavect.io/search/?q={search_term_string}"
        }
      },
      "publisher": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "url": "https://wavect.io/"
    },
    {
      "@id": "https://wavect.io/semaprax/architecture/#webpage",
      "@type": "WebPage",
      "dateModified": "2026-08-11",
      "inLanguage": "en",
      "isPartOf": {
        "@id": "https://wavect.io/#website",
        "@type": "WebSite"
      },
      "lastReviewed": "2026-08-11",
      "url": "https://wavect.io/semaprax/architecture/"
    },
    {
      "@id": "https://wavect.io/verified-claims.json#semaprax-v02-semantic-graph-patches",
      "@type": "Claim",
      "appearance": {
        "@id": "https://wavect.io/semaprax/architecture/#webpage",
        "@type": "WebPage",
        "inLanguage": "en",
        "url": "https://wavect.io/semaprax/architecture/"
      },
      "author": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "citation": {
        "@type": "WebPage",
        "url": "https://github.com/wavect/semaprax/blob/main/docs/SEMANTIC-PATCH-V2.md"
      },
      "dateModified": "2026-08-11",
      "identifier": "semaprax-v02-semantic-graph-patches",
      "inLanguage": "en",
      "text": "The Semaprax v0.2 prototype exposes a stable, queryable semantic program graph and revision-bound semantic patch operations for documented language subsets."
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://wavect.io/semaprax/architecture/#webpage",
      "@type": "WebPage",
      "creator": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "dateModified": "2026-08-11",
      "description": "How the Semaprax semantic program graph, stable IDs, bounded context, revisions, and semantic patches form an agent-facing compiler architecture.",
      "inLanguage": "en",
      "mainEntity": {
        "@id": "https://wavect.io/semaprax/architecture/#article",
        "@type": "TechArticle"
      },
      "name": "Semaprax Semantic Program Graph Architecture | Wavect",
      "url": "https://wavect.io/semaprax/architecture/"
    },
    {
      "@id": "https://wavect.io/semaprax/architecture/#article",
      "@type": "TechArticle",
      "about": {
        "@id": "https://wavect.io/semaprax/#software",
        "@type": "SoftwareSourceCode"
      },
      "author": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "dateModified": "2026-08-11",
      "datePublished": "2026-08-11",
      "description": "How the Semaprax semantic program graph, stable IDs, bounded context, revisions, and semantic patches form an agent-facing compiler architecture.",
      "headline": "A program model that agents can query without reconstructing meaning from text.",
      "inLanguage": "en",
      "isPartOf": {
        "@id": "https://wavect.io/semaprax/#webpage",
        "@type": "WebPage"
      },
      "mainEntityOfPage": {
        "@id": "https://wavect.io/semaprax/architecture/#webpage"
      },
      "publisher": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "url": "https://wavect.io/semaprax/architecture/"
    },
    {
      "@id": "https://wavect.io/semaprax/#software",
      "@type": "SoftwareSourceCode"
    },
    {
      "@id": "https://wavect.io/semaprax/architecture/#faq",
      "@type": "FAQPage",
      "inLanguage": "en",
      "mainEntity": [
        {
          "@type": "Question",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "No. It is the compiler's typed, versioned program representation. It records declarations, identities, effects, contracts, relationships, and lowering facts rather than generic documents or embeddings."
          },
          "name": "Is the semantic graph a knowledge graph or RAG system?"
        },
        {
          "@type": "Question",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Not yet. Current patch schemas admit bounded operation families and reject stale revisions, unsupported selectors, malformed artifacts, and semantic widening."
          },
          "name": "Can an agent edit any program through semantic patches?"
        }
      ],
      "url": "https://wavect.io/semaprax/architecture/"
    },
    {
      "@id": "https://wavect.io/verified-claims.json#semaprax-v02-semantic-graph-patches",
      "@type": "Claim",
      "appearance": {
        "@id": "https://wavect.io/semaprax/architecture/#webpage",
        "@type": "WebPage",
        "inLanguage": "en",
        "url": "https://wavect.io/semaprax/architecture/"
      },
      "author": {
        "@id": "https://wavect.io/#organization",
        "@type": [
          "Organization",
          "ProfessionalService",
          "LocalBusiness"
        ]
      },
      "citation": {
        "@type": "WebPage",
        "url": "https://github.com/wavect/semaprax/blob/main/docs/SEMANTIC-PATCH-V2.md"
      },
      "dateModified": "2026-08-11",
      "identifier": "semaprax-v02-semantic-graph-patches",
      "inLanguage": "en",
      "text": "The Semaprax v0.2 prototype exposes a stable, queryable semantic program graph and revision-bound semantic patch operations for documented language subsets."
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "item": "https://wavect.io/",
      "name": "Home",
      "position": 1
    },
    {
      "@type": "ListItem",
      "item": "https://wavect.io/semaprax/",
      "name": "Semaprax",
      "position": 2
    },
    {
      "@type": "ListItem",
      "item": "https://wavect.io/semaprax/architecture/",
      "name": "A program model that agents can query without reconstructing meaning from text.",
      "position": 3
    }
  ]
}
```
