Skip to content

Libraries

User-level Lisp libraries shipped in projects/omega-lisp/. Each is loadable via (require '<name>).

PackageWhat it provides
plm/coreDocument abstraction; content stays external to the LLM context
plm/chunkingParagraph / sentence / markdown chunking strategies
plm/searchamb-based search with automatic strategy backtracking

Pattern from CLAUDE.md:

lisp
(require 'plm/search)
(define doc (make-document "...large text..."))
(search-document doc "What was the funding amount?")
;; if one strategy fails, amb backtracks to the next

workflow/* — Pipeline DSL

PackageWhat it provides
workflow/stagemake-stage, stage accessors
workflow/pipelinemake-pipeline, pipeline-validate, pipeline-execution-order (Kahn's algorithm), run-pipeline
workflow/patternsPre-built stage templates (build, test, lint, etc.)

Example:

lisp
(define my-pipeline
  (make-pipeline
    (list
      (list 'stage 'build ':run "npm run build" ':on-fail 'fix-build)
      (list 'stage 'test ':depends-on (list 'build) ':run "npm test"
            ':on-fail (list 'fixpoint 'fix-tests 3))
      (list 'stage 'lint ':depends-on (list 'build) ':run "npm run lint"))))

(pipeline-validate my-pipeline)         ; → (ok)
(pipeline-execution-order my-pipeline)  ; → (build test lint)
(run-pipeline my-pipeline)              ; executes via shell.op + handles on-fail

:on-fail accepts: a symbol (function name), (fixpoint <fn> <max>), or (agent <provider> <model>).

solve — Goal-directed problem decomposition

solve is its own language family. Top-level forms:

lisp
(solve task
  :decompose split-into-subtasks
  :delegate assign-to-agents
  :combine merge-results
  :verify check-invariants)

(goal name :type ... :inputs ... :outputs ...)
(artifact key :type ... :provenance ...)

packages/solve/ contains the implementation (31 primitives). The HETA pattern (Hierarchical Evaluation of Typed Artifacts) is the formal name.

agents — Multi-provider agent selection

lisp
(require 'agents)

(agents "fix this build error")
;; expands to amb-agent-fix — tries claude-sonnet, codex-o3, claude-haiku in order
;; first one whose result satisfies the require predicate wins

See Agent integration for the full picture.

self-healing — Fixpoint-based build error correction

lisp
(require 'self-healing)

(define (self-healing-build max-attempts)
  (fixpoint
    (effect build.run.op)
    (lambda (state)
      (if (get state "ok")
          state
          (begin
            (fix-errors-with-llm (get state "errors"))
            (effect build.run.op))))
    (lambda (old new) (equal? (get old "errors") (get new "errors")))
    max-attempts))

Build effect (build.run.op) returns structured BuildError records (file, line, col, severity, code, message). The fixpoint converges when the error set stabilizes.

monad — Monadic operations

lisp
(require 'monad)

(do-bind ((x (Just 5))
          (y (Just 10)))
  (Just (+ x y)))     ; → Just 15

(do-bind ((x (Just 5))
          (y Nothing))
  (Just (+ x y)))     ; → Nothing

Provides bind, return, do-bind, plus Maybe/Either/List monad instances.

aliases/clojure — Clojure-style sugar

lisp
(require 'aliases/clojure)

(defn square [x] (* x x))     ; sugar for (define (square x) (* x x))
(fn [x y] (+ x y))            ; sugar for (lambda (x y) (+ x y))
(-> 5 (* 2) (+ 1))            ; thread-first → (+ 1 (* 5 2)) → 11
(->> coll (map inc) (filter even?))  ; thread-last

document-search — General-purpose retrieval

A more featureful sibling to plm/search with embedding-aware retrieval. See packages/document-search/ for the full surface.

continuation-calculus, middleware, strategies, tools

These workspace packages provide more specialized facilities. Each has its own :help <name> entry; consult :packages for the live list.

See also

Source: projects/omega-lisp/CLAUDE.md § Available Packages, projects/omega-lisp/CLAUDE.md § Workflow DSL, individual package directories under projects/omega-lisp/packages/. Live list: :packages in the REPL.