Skip to Content
API ReferenceWorkbook Tools

Workbook Tools

Tools for maintaining an audit trail of classification decisions.

Overview

The workbook provides persistent storage for classification decisions, enabling:

  • Audit trails for compliance
  • Documentation of reasoning
  • Historical reference for similar businesses
  • Review workflows for low-confidence classifications

write_to_workbook

Save a classification decision to the workbook.

Parameters

ParameterTypeRequiredDescription
descriptionstringYesBusiness description
codestringYesAssigned NAICS code
confidencefloatYesConfidence score (0-1)
reasoningstringNoClassification reasoning
alternativesarrayNoAlternative codes considered
user_notesstringNoAdditional notes
tagsarrayNoTags for categorization

Response

{ "entry_id": "cls_20240115_001", "status": "saved", "timestamp": "2024-01-15T10:30:00Z", "summary": { "description": "Organic dog treat manufacturer", "code": "311111", "confidence": 0.91 } }

Example

{ "description": "Company that manufactures organic dog treats", "code": "311111", "confidence": 0.91, "reasoning": "Primary activity is manufacturing dog food products from organic ingredients", "alternatives": [ { "code": "311119", "reason": "Considered but rejected - products are dog-specific" } ], "user_notes": "Verified with client that 100% of revenue is from manufacturing", "tags": ["manufacturing", "pet-food", "verified"] }

read_workbook

Retrieve saved classification decisions from the workbook.

Parameters

ParameterTypeRequiredDefaultDescription
entry_idstringNo—Specific entry ID
codestringNo—Filter by NAICS code
tagstringNo—Filter by tag
min_confidencefloatNo—Minimum confidence
max_confidencefloatNo—Maximum confidence
from_datestringNo—Start date (ISO format)
to_datestringNo—End date (ISO format)
limitintegerNo50Maximum results

Response

{ "entries": [ { "entry_id": "cls_20240115_001", "timestamp": "2024-01-15T10:30:00Z", "description": "Organic dog treat manufacturer", "code": "311111", "title": "Dog and Cat Food Manufacturing", "confidence": 0.91, "reasoning": "Primary activity is manufacturing...", "alternatives": [...], "user_notes": "Verified with client...", "tags": ["manufacturing", "pet-food", "verified"] } ], "total_results": 1, "filters_applied": { "code": null, "tag": null, "date_range": null } }

Examples

Get specific entry:

{ "entry_id": "cls_20240115_001" }

Filter by code:

{ "code": "311111" }

Filter by tag:

{ "tag": "needs-review" }

Filter by confidence:

{ "max_confidence": 0.7, "tag": "pending" }

Filter by date:

{ "from_date": "2024-01-01", "to_date": "2024-01-31" }

Workflow Patterns

Audit Trail Workflow

1. classify_business(description) 2. Present to user for confirmation 3. write_to_workbook( description, code, confidence, reasoning, user_notes: "Approved by [name]" )

Review Workflow

1. read_workbook(max_confidence: 0.7, tag: "pending") 2. For each entry: a. validate_classification(description, code) b. If invalid, get alternatives c. Update workbook with final decision

Compliance Reporting

1. read_workbook( from_date: "2024-Q1-start", to_date: "2024-Q1-end" ) 2. Generate report with: - Total classifications - Confidence distribution - Codes by frequency

Tagging Best Practices

Use tags to organize classifications:

TagUsage
verifiedConfirmed by subject matter expert
needs-reviewLow confidence, requires human review
client-confirmedClient verified the classification
batch-importImported from bulk classification
updatedPreviously classified, updated

Example Tagging

{ "tags": ["manufacturing", "pet-industry", "verified", "2024-Q1"] }

Data Retention

  • Workbook entries are persisted across server restarts
  • Consider implementing archival for old entries
  • Export periodically for backup

Integration with Classification

The workbook integrates with the classification workflow:

classify_business() │ ▼ Present recommendation │ ▼ User confirms/modifies │ ▼ write_to_workbook() │ ▼ Entry saved with full context