Chorus

 view release on metacpan or  search on metacpan

lib/Chorus/Engine/AIAgent.pod  view on Meta::CPAN

=encoding UTF-8

=head1 NAME

Chorus::Engine::AIAgent - AI agent integration for compliance-validation applications

=head1 VERSION

2.01

=head1 DESCRIPTION

Starting with version 2.01, C<Chorus::Engine> ships an optional companion
directory, C<agent/>, that turns the inference engine into a B<normed-corpus
compliance-validation platform> when used together with an B<AI agent>
(Claude, Copilot, ECA…).

The companion provides:

=over 4

=item * B<Agent knowledge templates> — org-mode files that capture the
domain knowledge extracted from normative corpora (standards, DTUs, Eurocodes,
regulations…) for each pipeline agent.

=item * B<Six AI agent skills> — reusable prompt-driven workflows
(C<chorus-pdf>, C<chorus-feed>, C<chorus-create-project>,
C<chorus-import-project>, C<chorus-check>, C<chorus-strengthen>) that drive
an AI agent to build and run complete validation applications from a corpus.

=back

The resulting workflow is entirely deterministic: the rules are derived from
the corpus, encoded as transparent YAML files, and executed verbatim by the
Chorus inference engine — no LLM in the hot path.

=head1 OVERVIEW

The architecture connects three layers:

  ┌──────────────────────────────────────────────────────────┐
  │  Normative corpus  (PDF, DTU, Eurocode, regulation…)     │
  └────────────────────────┬─────────────────────────────────┘
                           │  chorus-pdf (optional, PDF input)
                           │  chorus-feed
                           â–¼
  ┌──────────────────────────────────────────────────────────┐
  │  KB org-mode  (agent/agents/<slug>.org)                  │
  │  · Frames catalogue    · Slot dictionary                 │
  │  · Rules catalogue     · Perl helpers (normative tables) │
  └────────────────────────┬─────────────────────────────────┘
                 ┌─────────┴──────────┐
      chorus-check│                   │chorus-create-project
                 â–¼                   â–¼
  ┌──────────────────────┐   ┌──────────────────────────┐
  │ YAML rules           │   │ project.json             │
  │ Perl helpers         │   │ (test data or real       │
  │ Feed.pm / Expert.pm  │   │  engineering project)    │
  │ run.pl               │   └──────────────────────────┘
  └────────────┬─────────┘
               │  perl run.pl project.json
               â–¼
  ┌──────────────────────────────────────────────────────────┐
  │  Chorus::Expert pipeline                                 │
  │  Agent1 → Agent2 → … → AgentN (termination)              │
  └────────────────────────┬─────────────────────────────────┘
                           │
                           â–¼
               Compliance report (stdout)

=head1 AI AGENT SKILLS

The skills live in C<agent/skills/> and are loaded on demand by the AI agent.
They cover the entire lifecycle of a compliance-validation application.

=head2 chorus-pdf

  chorus-pdf <sandbox-name> <file.pdf> [--out <slug>] [--auto] [--images]

Extracts a PDF corpus into a plain-text or Markdown file suitable for
C<chorus-feed>.  Three extraction modes are available:

=over 4

=item * B<Text mode> (default) — C<pdfminer.six>, no API key required.

=item * B<Auto mode> (C<--auto>) — pdfminer for text pages, LLM vision for
figure and table pages.  Recommended for mixed technical documents.

=item * B<Images mode> (C<--images>) — LLM vision on every page.  Best for
scanned PDFs or diagram-heavy documents.

=back



( run in 0.733 second using v1.01-cache-2.11-cpan-7fcb06a456a )