Skip to content

Build Your Own Module

If the built-in modules don’t fit your data, you can build your own forge module. A module extends the base pipeline with domain-specific scanners, templates, and review criteria.

A custom forge module provides three things:

  1. Scanners — pull raw data from your domain sources
  2. Templates — structured formats for the kinds of beliefs your domain produces
  3. Review criteria — domain-specific rules for what makes a belief valid

Pull raw data from your domain sources. Receive CLI config (paths, URLs, credentials). Return documents that the extract stage will process.

Examples:

  • Read files from a directory
  • Pull records from an API
  • Query a database
  • Scrape a website

Structured formats for the kinds of knowledge your domain produces. Templates help the extract stage produce consistent, well-structured beliefs.

Domain-specific criteria for the review stage. What makes a belief valid in your domain? What should the reviewer look for?

Examples:

  • “Claims must cite a specific version number”
  • “Measurements must include units and conditions”
  • “Recommendations must reference at least one observed failure”

Until the plugin API is available, the recommended approach is to use the document forge with domain-specific prompts:

Terminal window
# Use the document forge for any text-based source
reasonsforge document --sources-dir ./my-data --domain "My domain context"

The document forge handles chunking, summarization, belief extraction, derivation, review, and repair for any text input. The --domain flag provides context that shapes the LLM prompts.

For more control, you can run individual pipeline steps:

Terminal window
reasonsforge forge chunk-docs --input-dir ./my-data
reasonsforge forge summarize --input-dir ./my-data
reasonsforge forge propose-beliefs --all
reasonsforge forge accept-beliefs
reasonsforge forge derive-review-repair --domain "My domain context"