Skip to main content

Base Type Expert Agent

Abstract base class for all Type Expert agents. Each expert specializes in one document type and can:

  1. Deeply analyze if a document truly belongs to their type
  2. Identify what's missing to satisfy all analysts
  3. Generate contextually-appropriate content enhancements
  4. Explain their reasoning for audit trails

File: base.py

Classes

TypeAnalysis

Result of a Type Expert's analysis.

ContentEnhancement

A specific content enhancement recommendation.

TypeExpert

Abstract base class for Type Expert agents.

Functions

analyze(document, analyst_votes)

Deeply analyze whether document belongs to this type.

generate_enhancements(document, analysis)

Generate specific content enhancements to improve classification.

get_analyst_vote(votes, analyst_name)

Get a specific analyst's vote.

count_votes_for_type(votes, doc_type)

Count votes for a specific type and average confidence.

identify_disagreeing_analysts(votes, expected_type)

Find analysts that didn't vote for expected type.

extract_headings(content)

Extract all markdown headings with levels.

extract_code_blocks(content)

Extract code blocks with their languages.

has_tables(content)

Check if content has markdown tables.

has_mermaid(content)

Check if content has mermaid diagrams.

has_checkboxes(content)

Check if content has task checkboxes.

extract_frontmatter_type(document)

Get the type from frontmatter if present.

analyze_semantic_purpose(document)

Analyze what the document is semantically trying to accomplish.