formal-ai
Formal AI is a Rust proof of concept for a symbolic, deterministic assistant that exposes OpenAI-shaped interfaces without neural-network inference.
The current prototype is intentionally small. It proves the surface area requested in issue #1:
- library API for symbolic prompt handling
- CLI chat command
- HTTP API server with
/v1/chat/completionsand/v1/responses - human-readable Links Notation knowledge and dataset export through
lino-objects-codec - Docker-ready microservice
- GitHub Pages markdown chat demo backed by a Rust-generated WebAssembly worker
Quick Start
Example API call:
Docker:
The static demo lives in docs/demo/index.html. Serve it from a local web server or GitHub Pages so the WebAssembly worker can be fetched by the browser. The demo starts with a user greeting, renders markdown in messages, previews markdown input, and includes a randomized dialog mode for hello-world prompts across several programming languages.
Rust Library
use ;
let request = ChatCompletionRequest ;
let completion = create_chat_completion;
assert_eq!;
Current Symbolic Behavior
The engine normalizes a prompt, selects a deterministic symbolic rule, and returns the rule output with evidence link identifiers and indented Links Notation. Seed rules currently cover:
- greetings:
Hi,Hello,Hey - hello world requests for Rust, Python, JavaScript, TypeScript, Go, and C
- unknown prompts, which return an explicit learnable-rule fallback
No GPU, neural network, remote model, or random sampling is used.
Dataset Seeds
Issue #1 source indexes and seed prompts are stored as indented Links Notation in data/.
The generator writes source, greeting, hello-world, and demo-dialog records. .lino files are kept below 1500 lines and validated by the unit tests.
Development
See docs/REQUIREMENTS.md for the issue #1 requirement matrix and docs/case-studies/issue-1/README.md for the collected research and implementation plan.