Skip to content

AI Webchat & PDF Chat Repurposing Strategy

AWS Partner Go-to-Market Focus

Date: 2025-11-17 Status: Implementation Ready


Executive Summary

This document outlines the strategic repurposing of two existing AI features to better serve AWS partners in their go-to-market initiatives:

  1. AI WebchatPartner Intel Assistant (High Value)
  2. AI PDF ChatKnowledge Base Hub (Critical Infrastructure)

Both features leverage existing vector embedding infrastructure and integrate seamlessly with the AgentCore orchestration system.


🎯 Feature #1: AI Webchat → Partner Intel Assistant

Current State

  • Path: ~/dashboard/user/openai/webchat
  • Functionality: Analyzes any website URL, creates embeddings, enables Q&A
  • Status: Functional but underutilized for partner GTM needs

Repurposing Strategy: "Partner Intel Assistant"

Transform this into a prospect research and partner discovery tool that helps AWS partners:

Use Cases

  1. Prospect Analysis (Primary Use Case)
  2. Partner pastes prospect's website URL
  3. AI extracts: company size, tech stack signals, AWS usage indicators, pain points
  4. Outputs ICP fit score (0-100) using existing CoSellRelationship scoring logic
  5. Generates personalized outreach talking points

  6. Partner Discovery Research

  7. Before inviting a co-sell partner, analyze their website
  8. Verify product complementarity
  9. Extract ICP definition from their marketing
  10. Score partnership potential

  11. Competitive Intelligence

  12. Analyze competitor websites
  13. Identify differentiation opportunities
  14. Extract competitive positioning statements
  15. Monitor changes over time (crawl weekly)

  16. Market Research

  17. Analyze analyst reports (via URL)
  18. Extract insights from AWS partner case studies
  19. Research industry trends from publications

Implementation Roadmap

Phase 1: Quick Wins (1-2 days)

// 1. Add preset prompt templates to AIWebChatController
$presetPrompts = [
    'icp_fit_score' => "Analyze this company's website and score ICP fit (0-100) based on: company size, industry, tech stack, AWS usage signals, and pain points our solution addresses. Output structured JSON with score and reasoning.",

    'partnership_potential' => "Evaluate this company as a potential co-sell partner. Identify: product categories, target markets, complementary capabilities, AWS partner tier indicators, and partnership fit score.",

    'competitive_analysis' => "Analyze this competitor's positioning. Extract: target audience, key differentiators, pricing signals, AWS marketplace presence, and strategic gaps we can exploit.",

    'outreach_talking_points' => "Generate 5 personalized talking points for sales outreach based on this company's website content, focusing on AWS cloud transformation and digital initiatives."
];

Phase 2: Agent Integration (3-5 days)

// 2. Create new agent capability: 'research_prospect'
// Location: ext_content_manager_agent_capabilities table
{
    "slug": "research_prospect",
    "name": "Research Prospect Website",
    "description": "Automatically research a prospect company via website URL",
    "category": "intelligence",
    "handler_class": "App\\Extensions\\ContentManager\\System\\Services\\Capabilities\\ResearchProspectCapability",
    "required_params": ["website_url"],
    "output_schema": {
        "icp_fit_score": "integer",
        "company_size": "string",
        "tech_stack_signals": "array",
        "aws_usage_indicators": "array",
        "pain_points": "array",
        "talking_points": "array"
    }
}

// 3. Agents can now automatically research prospects during workflows
// Example: "Research these 5 prospects and draft personalized emails"

Phase 3: UI Enhancements (1 week)

  • Rename route: /dashboard/user/content-manager/partner-intel
  • Add "Save to CRM" button (if you have CRM integration)
  • Create prospect research history view
  • Add "Schedule Weekly Re-crawl" for competitive monitoring
  • Integrate with CoSellRelationship model for partner scoring

Feature Toggle Control

Enable/Disable:

-- Enable (default after migration runs)
UPDATE settings SET feature_ai_webchat = 1;

-- Disable (returns 404)
UPDATE settings SET feature_ai_webchat = 0;

Admin UI: - Path: /dashboard/admin/config/ai-tools - Toggle: "AI Web Chat" (will be renamed to "Partner Intel" in Phase 3)

Complete Removal: If you decide this feature isn't valuable: 1. Set feature_ai_webchat = 0 in settings 2. Remove from navigation menus (check MenuHelper.php) 3. Delete /app/Extensions/AIWebChat/ directory 4. Remove routes from AIWebChatServiceProvider


📚 Feature #2: AI PDF Chat → Knowledge Base Hub

Current State

  • Path: ~/dashboard/user/openai/generator/ai_pdf/workbook
  • Functionality: Upload PDFs/docs, chat with content using vector embeddings
  • Status: Functional, critical for agent operations

Repurposing Strategy: "Partner Knowledge Hub"

DO NOT REMOVE THIS FEATURE - it's foundational infrastructure for agent-powered GTM.

Strategic Value

This feature is the knowledge layer that makes your agents intelligent about: - Sales battle cards - AWS partner program requirements - Successful campaign examples - Product documentation - Competitive positioning - Co-sell partner materials

Use Cases

  1. Sales Enablement Library

    Upload: Battle cards, case studies, objection handlers, pricing guides
    Result: Agents auto-generate sales emails with relevant case study references
    

  2. Co-Sell Content Repository

    Upload: Partner A's product docs + Partner B's product docs
    Result: Agents identify complementary features, generate joint solution briefs
    

  3. AWS Marketplace Compliance

    Upload: AWS Marketplace listing guidelines, successful examples
    Result: Agents ensure listing rewrites meet AWS requirements
    

  4. Campaign Content Threading

    Upload: Previous successful webinar scripts, blog posts, email sequences
    Result: Agents maintain consistent messaging across new campaigns
    

Implementation Roadmap

Phase 1: Agent Capability Integration (2-3 days)

Create new agent capability:

// File: app/Extensions/ContentManager/System/Services/Capabilities/QueryKnowledgeBaseCapability.php

<?php

namespace App\Extensions\ContentManager\System\Services\Capabilities;

use App\Services\VectorService;
use App\Models\PdfData;

class QueryKnowledgeBaseCapability implements CapabilityInterface
{
    public function execute(array $params, array $context): array
    {
        // Extract query from params
        $query = $params['query'] ?? throw new \InvalidArgumentException('Query is required');
        $category = $params['category'] ?? null; // e.g., 'sales', 'technical', 'partner'
        $topN = $params['top_results'] ?? 5;

        // Use existing VectorService to find relevant content
        $vectorService = new VectorService();
        $embedding = $vectorService->embedText($query);

        // Build query
        $pdfDataQuery = PdfData::query()
            ->where('user_id', $context['user_id'])
            ->where('team_id', $context['team_id']);

        if ($category) {
            $pdfDataQuery->where('category', $category);
        }

        // Get top N most similar chunks
        $results = $pdfDataQuery->get()
            ->map(function ($chunk) use ($embedding, $vectorService) {
                $similarity = $vectorService->cosineSimilarity(
                    $embedding,
                    json_decode($chunk->vector, true)
                );
                return [
                    'content' => $chunk->content,
                    'similarity' => $similarity,
                    'source' => $chunk->file_name,
                ];
            })
            ->sortByDesc('similarity')
            ->take($topN)
            ->values()
            ->toArray();

        return [
            'status' => 'success',
            'results' => $results,
            'query' => $query,
            'context_used' => count($results) > 0,
        ];
    }

    public function validate(array $params): bool
    {
        return isset($params['query']) && is_string($params['query']);
    }
}

Register capability in database:

INSERT INTO ext_content_manager_agent_capabilities
(slug, name, description, category, handler_class, required_params, output_schema, is_active, created_at, updated_at)
VALUES (
    'query_knowledge_base',
    'Query Knowledge Base',
    'Search uploaded documents and files for relevant context to include in responses',
    'knowledge',
    'App\\Extensions\\ContentManager\\System\\Services\\Capabilities\\QueryKnowledgeBaseCapability',
    '["query"]',
    '{"status":"string","results":"array","context_used":"boolean"}',
    1,
    NOW(),
    NOW()
);

Phase 2: Enhanced Workflow (3-5 days)

Modify generate_text capability to auto-query knowledge base:

// In GenerateTextCapability.php
public function execute(array $params, array $context): array
{
    // NEW: Auto-query knowledge base if agent has permission
    $knowledgeContext = '';
    if ($this->agentHasCapability($context['agent_id'], 'query_knowledge_base')) {
        $kbResults = app(QueryKnowledgeBaseCapability::class)->execute([
            'query' => $params['topic'] ?? $params['prompt'],
            'category' => $params['kb_category'] ?? null,
            'top_results' => 3,
        ], $context);

        if ($kbResults['context_used']) {
            $knowledgeContext = "\n\nRelevant reference material from knowledge base:\n";
            foreach ($kbResults['results'] as $result) {
                $knowledgeContext .= "- " . $result['content'] . " (Source: {$result['source']})\n";
            }
        }
    }

    // Inject into prompt
    $enrichedPrompt = $params['prompt'] . $knowledgeContext;

    // Continue with existing text generation logic...
}

Result: Agents now automatically reference uploaded materials when generating content.

Phase 3: Knowledge Base Management UI (1 week)

New route: /dashboard/user/content-manager/knowledge-base

Features: - Upload PDFs/docs with category tags (sales, technical, partner, compliance) - Team-wide vs personal document visibility - Usage analytics: "Which docs do agents reference most?" - Version control: Upload new versions of battle cards - Search/filter interface - Quick actions: "Use in prompt", "Share with co-sell partner"

Database schema addition:

// Add category column to pdf_data table
Schema::table('pdf_data', function (Blueprint $table) {
    $table->string('category')->nullable()->after('content'); // sales|technical|partner|compliance
    $table->boolean('is_team_shared')->default(false)->after('category');
    $table->integer('usage_count')->default(0)->after('is_team_shared');
    $table->timestamp('last_used_at')->nullable()->after('usage_count');
});

Feature Toggle Control

Enable/Disable:

-- Enable (default)
UPDATE settings SET feature_ai_pdf = 1;

-- Disable (returns 404) - NOT RECOMMENDED
UPDATE settings SET feature_ai_pdf = 0;

Admin UI: - Path: /dashboard/admin/config/ai-tools - Toggle: "AI PDF Chat"

Recommendation: Keep this enabled permanently. It's core infrastructure for agent intelligence.


🔄 Integration with Existing Features

How Knowledge Base Powers Your GTM Workflows

Example 1: Automated Competitive Email

User workflow: 1. Upload competitor battle card to Knowledge Base (category: 'sales') 2. Create agent with capabilities: query_knowledge_base + generate_text 3. Task: "Draft competitive positioning email for prospect Acme Corp"

Agent execution: 1. Queries knowledge base: "competitive differentiation points" 2. Retrieves battle card content chunks 3. Generates email that references specific competitive advantages 4. Output includes citations: "As noted in our Q4 Battle Card..."

Example 2: Co-Sell Campaign Content

User workflow: 1. Partner A uploads product brochure (category: 'partner') 2. Partner B uploads their positioning guide (category: 'partner') 3. Create CoSellPlan with assigned agent 4. Agent auto-generates joint solution brief

Agent execution: 1. Queries knowledge base from both partners 2. Identifies complementary capabilities from uploaded docs 3. Threads content together maintaining both brand voices 4. Creates SharedAsset awaiting dual approval

Example 3: AWS Marketplace Listing Optimization

User workflow: 1. Upload AWS Marketplace guidelines (category: 'compliance') 2. Upload 3 successful listing examples (category: 'compliance') 3. Use Marketplace Rewriter feature

Behind the scenes: 1. Rewriter agent queries knowledge base for guidelines + examples 2. Ensures new listing meets AWS requirements 3. Incorporates proven formatting from successful examples 4. Reduces rejection rate from AWS review team


📊 Success Metrics

Partner Intel Assistant

  • Prospect research sessions per user per week
  • ICP fit scores generated
  • Time saved vs manual research (estimated 30min → 2min)
  • Partner discovery matches leading to active relationships

Knowledge Base Hub

  • Documents uploaded per team
  • Agent queries to knowledge base per day
  • Content generation accuracy improvement (measured by user edits needed)
  • Campaign asset creation velocity (time from concept → draft)

🚀 Migration Checklist

Before these changes go live, run:

# 1. Run the new migration
php artisan migrate

# This adds the feature_ai_webchat column to settings table
# Default value: 1 (enabled)

# 2. Verify middleware update
# The middleware now maps ai_webchat → feature_ai_webchat
# This allows admins to toggle the feature on/off

# 3. Clear application cache
php artisan cache:clear
php artisan config:clear
php artisan route:clear

# 4. Verify webchat is accessible
# Visit: http://your-domain/dashboard/user/openai/webchat
# Should work if feature_ai_webchat = 1 and user plan includes 'ai_webchat'

# 5. Add knowledge base capability (manual SQL)
# Run the INSERT statement from Phase 1 of PDF Chat strategy

💡 Next Steps

Immediate Actions (This Week)

  1. ✅ Run migration to add feature_ai_webchat setting
  2. ✅ Middleware updated to map ai_webchat to feature flag
  3. Test webchat accessibility with your admin account
  4. Decide: Keep/Repurpose or Disable/Remove?

Short-term (Next 2 Weeks)

If keeping webchat: - Add preset prompt templates for partner research - Update navigation label: "AI Web Chat" → "Partner Intel" - Create quick-start guide for sales teams

For PDF chat: - Implement query_knowledge_base agent capability - Test integration with existing generate_text capability - Upload 5-10 sample documents (battle cards, guides)

Medium-term (Next Month)

  • Build Knowledge Base management UI
  • Add category tagging to pdf_data table
  • Create usage analytics dashboard
  • Document best practices for knowledge base organization

Long-term (Next Quarter)

  • Automated prospect research workflows
  • Integration with CoSellRelationship scoring
  • Scheduled competitive website monitoring
  • Knowledge base AI recommendations ("You should upload AWS security compliance docs")

🎓 Training Resources Needed

For Sales Teams

  • "How to use Partner Intel for prospect research"
  • "Interpreting ICP fit scores"
  • "Best practices for competitive analysis"

For Partners

  • "Building your co-sell knowledge base"
  • "What documents should you upload?"
  • "How agents use your content in campaigns"

For Admins

  • "Managing feature toggles"
  • "Knowledge base governance and organization"
  • "Monitoring agent knowledge base usage"

❓ FAQ

Q: Can I disable webchat without affecting PDF chat?

A: Yes, they're independent features controlled by separate flags: - Webchat: feature_ai_webchat - PDF Chat: feature_ai_pdf

Q: What happens to existing webchat data if I disable the feature?

A: Data remains in the database (user_openai_chats, pdf_data tables). Users just can't access the UI. Re-enabling restores access.

Q: Can partners see each other's knowledge base documents?

A: Not by default. Documents are scoped to team_id. For co-sell scenarios, you'd need to: 1. Add explicit sharing permissions 2. OR copy documents to shared CoSellPlan context 3. OR create a "shared workspace" for each CoSellRelationship

Q: How much does vector storage cost?

A: Minimal. Each 4000-char chunk = ~6KB of JSON vector data. 1000 documents (4M chars) = ~6MB of vector embeddings. PostgreSQL/MySQL handle this easily.

Q: Can I use this with models other than OpenAI?

A: Currently embeddings use OpenAI's text-embedding-ada-002. To use AWS Bedrock Titan Embeddings: 1. Update VectorService.php to support multiple providers 2. Add provider selection to settings 3. Store embedding model used with each chunk for compatibility


📝 Technical Notes

Vector Similarity Search Performance

  • Current: Linear scan with cosine similarity (O(n))
  • For >10K documents: Consider pgvector extension (PostgreSQL) or vector index
  • Alternative: Pinecone, Weaviate, or AWS OpenSearch vector engine

Chunking Strategy

  • Current: 3500-4000 characters per chunk
  • Overlap: None (could add 200-char overlap for better context)
  • Improvement: Semantic chunking (split on paragraphs/sections vs fixed length)

Context Window Management

  • Top 5 chunks × 4000 chars = 20,000 chars of context
  • Claude 3 Sonnet: 200K context window (plenty of room)
  • GPT-4: 128K context window (still ample)

Appendix: File Locations Reference

Modified Files (This Session)

  • database/migrations/2025_11_17_000001_add_feature_ai_webchat_to_settings_table.php (NEW)
  • app/Http/Middleware/CheckTemplateTypeAndPlan.php:123 (MODIFIED)
  • docs/WEBCHAT_PDF_STRATEGY.md (NEW - this document)

Key Files for Further Development

  • app/Extensions/AIWebChat/System/Http/Controllers/AIWebChatController.php - Webchat logic
  • app/Services/VectorService.php - RAG/embeddings service
  • app/Models/PdfData.php - Vector storage model
  • app/Extensions/ContentManager/System/Services/AgentCore/CapabilityRegistry.php - Register new capabilities
  • app/Extensions/ContentManager/System/Models/Agent.php - Agent configuration

Database Tables

  • settings - Feature flags (feature_ai_webchat, feature_ai_pdf)
  • openai - OpenAIGenerator records (ai_webchat, ai_pdf slugs)
  • pdf_data - Vector embeddings storage
  • user_openai_chats - Chat sessions
  • user_openai_chat_messages - Individual messages
  • ext_content_manager_agent_capabilities - Agent capability registry
  • ext_content_manager_agents - Agent configurations

Document Version: 1.0 Last Updated: 2025-11-17 Author: Claude (AI Assistant) Status: Ready for Review & Implementation