Skip to content

Library API

Use @memoarchitect/tools when an application needs the same parser, semantic model, validation, analysis, document, and project operations as the CLI.

import { buildMemoModel } from '@memoarchitect/tools';

The API is pre-stable. Pin an exact compatible patch version and wrap calls behind your own application boundary.

The semantic builder represents supported top-level usage forms—including parts, requirements, items, use cases, actions, ports, interfaces, states, verification cases, and views—as MemoElement records. Reusable definitions populate the kind registry; they are not emitted as project elements unless a definition has a dedicated semantic representation.

Prefer the CLI when:

  • a shell command is sufficient;
  • the output feeds CI or another process;
  • you want the supported command contract.

Prefer the library when:

  • you need an in-process semantic graph;
  • you are building a custom analysis or UI;
  • repeated parsing or direct typed access matters.

Browser-safe exports are available through @memoarchitect/tools/browser; inspect the package exports and generated type declarations for the exact release contract.