Skip to main content

DeepClause: Create task and domain-specific harnesses with Logic Programming

Kagi Small Github
17 lis 2026, 12:31Tech
Oryginał
2 min read

DeepClause has launched a TypeScript SDK and runtime that enables developers to build self-modifying AI agent harnesses using a Prolog-based domain-specific language called DML.

DeepClause introduces a novel approach to AI agent development with its TypeScript SDK and runtime. The tool leverages Prolog to create self-modifying harnesses that combine symbolic reasoning with large language model capabilities in a single, portable module. DML (DeepClause Meta Language) extends Prolog with functionality for LLM model calls, semantic judgments, and constraints, enabling developers to build specialized AI systems.

Unified Architecture

Unlike traditional agent stacks with separate components for tools, prompts, memory, and workflows, DeepClause integrates all elements into a single concept: predicates. Skills become clauses, tools become clauses, and workflows are simply predicates calling other predicates. This unified approach allows components to read, reuse, and extend each other within a self-contained file that can be easily inspected, versioned, and moved as a unit.

The system runs SWI-Prolog compiled to WebAssembly, making the entire language runtime in-process and portable without requiring native Prolog installation.

Development Workflow

DeepClause offers two modes of operation: Develop and Work. Develop mode features an interactive REPL where developers can describe skills, tools, or changes in plain English, and an authoring agent writes, tests, and commits them. Each turn creates a transaction, with the module being snapshotted before changes are committed. This approach ensures reproducibility and auditability across sessions and machines.

Each turn is a transaction: the module is snapshotted, the change is committed replace-by-predicate, and the session, event trace, and harness versions are recorded and remain queryable.

DeepClause documentation

Specialized Applications

The SDK particularly excels in creating specialized harnesses optimized for specific use cases. Developers can build systems tuned to particular models (considering prompt style, context budget, and reasoning level) or specific domains. The same harness can also route calls across multiple models—using cheaper models for classification and more powerful ones for complex tasks—all managed through plain Prolog logic.

This architecture proves valuable in regulated and high-stakes settings where workflows need review, versioning, and reproduction. The transaction records and rollback capabilities support such review processes while keeping deterministic logic separate from model judgments.

Practical Implementation

To use a harness in Work mode, developers must declare a shell/1 fact that defines the interface, including system prompts, available tools, and workflows. The Work mode provides a stable, non-authoring surface for completed harnesses, while Develop mode allows for continued modification and testing. The system supports both terminal-based and web interfaces, with commands for switching between modes, listing workflows, and executing specific tasks.

Developers can export harnesses as DML files for version control and sharing, then load them elsewhere. Each harness maintains its own content and version history, allowing multiple harnesses within a single project. The system's transaction-based approach ensures that changes can be easily rolled back if needed.

Z.ai
Article written by AI
Z.ai GLM-4.5-FlashFree
Free AI articles150 of 150
No limit after signing in with Telegram