- Updated Anthropic API to latest version (2024-01-01) - Set Claude 3.7 Sonnet Latest as primary model - Removed deprecated Opus 3.5 references - Fixed LLM response validation and JSON parsing - Improved error handling and logging - Updated model configurations and pricing - Enhanced document processing reliability - Fixed TypeScript type issues - Updated environment configuration
7.4 KiB
Agentic Prompts Comparison: August 14th Production vs Current Version
Overview
This document compares the agentic prompts and LLM processing approach between the August 14th production backup (commit df07971) and the current version.
Key Differences
1. System Prompt Complexity
August 14th Version (Production)
private getCIMSystemPrompt(): string {
return `You are an expert investment analyst at BPCP (Blue Point Capital Partners) reviewing a Confidential Information Memorandum (CIM). Your task is to analyze CIM documents and return a comprehensive, structured JSON object that follows the BPCP CIM Review Template format EXACTLY.
CRITICAL REQUIREMENTS:
1. **JSON OUTPUT ONLY**: Your entire response MUST be a single, valid JSON object. Do not include any text or explanation before or after the JSON object.
2. **BPCP TEMPLATE FORMAT**: The JSON object MUST follow the BPCP CIM Review Template structure exactly as specified.
3. **COMPLETE ALL FIELDS**: You MUST provide a value for every field. Use "Not specified in CIM" for any information that is not available in the document.
4. **NO PLACEHOLDERS**: Do not use placeholders like "..." or "TBD". Use "Not specified in CIM" instead.
5. **PROFESSIONAL ANALYSIS**: The content should be high-quality and suitable for BPCP's investment committee.
6. **BPCP FOCUS**: Focus on companies in 5+MM EBITDA range in consumer and industrial end markets, with emphasis on M&A, technology & data usage, supply chain and human capital optimization.
7. **BPCP PREFERENCES**: BPCP prefers companies which are founder/family-owned and within driving distance of Cleveland and Charlotte.
8. **EXACT FIELD NAMES**: Use the exact field names and descriptions from the BPCP CIM Review Template.
9. **FINANCIAL DATA**: For financial metrics, use actual numbers if available, otherwise use "Not specified in CIM".
10. **VALID JSON**: Ensure your response is valid JSON that can be parsed without errors.
ANALYSIS QUALITY REQUIREMENTS:
- **Financial Precision**: Extract exact financial figures, percentages, and growth rates. Calculate CAGR where possible.
- **Competitive Intelligence**: Identify specific competitors, market positions, and competitive advantages.
- **Risk Assessment**: Evaluate both stated and implied risks, including operational, financial, and market risks.
- **Growth Drivers**: Identify specific revenue growth drivers, market expansion opportunities, and operational improvements.
- **Management Quality**: Assess management experience, track record, and post-transaction intentions.
- **Value Creation**: Identify specific value creation levers that align with BPCP's expertise.
- **Due Diligence Focus**: Highlight areas requiring deeper investigation and specific questions for management.
DOCUMENT ANALYSIS APPROACH:
- Read the entire document carefully, paying special attention to financial tables, charts, and appendices
- Cross-reference information across different sections for consistency
- Extract both explicit statements and implicit insights
- Focus on quantitative data while providing qualitative context
- Identify any inconsistencies or areas requiring clarification
- Consider industry context and market dynamics when evaluating opportunities and risks`;
}
Current Version
private getOptimizedCIMSystemPrompt(): string {
return `You are an expert financial analyst specializing in Confidential Information Memorandums (CIMs).
Your task is to analyze CIM documents and extract key information in a structured JSON format.
IMPORTANT: You must respond with ONLY valid JSON that matches the exact schema provided. Do not include any explanatory text, markdown, or other formatting.
The JSON must include all required fields with appropriate values extracted from the document. If information is not available in the document, use "N/A" or "Not provided" as the value.
Focus on extracting:
- Financial metrics and performance data
- Business model and operations details
- Market position and competitive landscape
- Management team and organizational structure
- Investment thesis and value creation opportunities
Provide specific data points and insights where available from the document.`;
}
2. Prompt Construction Approach
August 14th Version
- Detailed JSON Template: Included the complete JSON structure in the prompt
- Error Correction: Had built-in retry logic with error correction
- BPCP-Specific Context: Included specific BPCP investment criteria and preferences
- Multi-Attempt Processing: Up to 3 attempts with validation and correction
Current Version
- Schema-Based: Uses Zod schema description instead of hardcoded JSON template
- Simplified Prompt: More concise and focused
- Generic Approach: Removed BPCP-specific investment criteria
- Single Attempt: Simplified to single processing attempt
3. Processing Method
August 14th Version
async processCIMDocument(text: string, template: string, analysis?: Record<string, any>): Promise<CIMAnalysisResult> {
// Complex multi-attempt processing with validation
for (let attempt = 1; attempt <= 3; attempt++) {
// Error correction logic
// JSON validation with Zod
// Retry on failure
}
}
Current Version
async processCIMDocument(documentText: string, options: {...}): Promise<{ content: string; analysisData: any; ... }> {
// Single attempt processing
// Schema-based prompt generation
// Simple JSON parsing with fallback
}
4. Key Missing Elements in Current Version
-
BPCP-Specific Investment Criteria
- 5+MM EBITDA range focus
- Consumer and industrial end markets emphasis
- Technology & data usage focus
- Supply chain and human capital optimization
- Founder/family-owned preference
- Geographic preferences (Cleveland/Charlotte driving distance)
-
Quality Requirements
- Financial precision requirements
- Competitive intelligence focus
- Risk assessment methodology
- Growth driver identification
- Management quality assessment
- Value creation lever identification
- Due diligence focus areas
-
Document Analysis Approach
- Cross-referencing across sections
- Explicit vs implicit insight extraction
- Quantitative vs qualitative balance
- Inconsistency identification
- Industry context consideration
-
Error Handling
- Multi-attempt processing
- Validation-based retry logic
- Detailed error correction
Recommendations
1. Restore BPCP-Specific Context
The current version has lost the specific BPCP investment criteria that made the analysis more targeted and relevant.
2. Enhance Quality Requirements
The current version lacks the detailed quality requirements that ensured high-quality analysis output.
3. Improve Error Handling
Consider restoring the multi-attempt processing with validation for better reliability.
4. Hybrid Approach
Combine the current schema-based approach with the August 14th version's detailed requirements and BPCP-specific context.
Impact on Analysis Quality
The August 14th version was likely producing more targeted, BPCP-specific analysis with higher quality due to:
- Specific investment criteria focus
- Detailed quality requirements
- Better error handling and validation
- More comprehensive prompt engineering
The current version may be producing more generic analysis that lacks the specific focus and quality standards of the original implementation.