Lincoln Cannon LLC

Custom AI Assistants

Custom AI Assistants

Transform your website with intelligent conversation capabilities using the AI assistant chat widget from Lincoln Cannon LLC. Our solution provides seamless integration, professional appearance, and enterprise-grade reliability.

Table of Contents

Overview

The AI assistant chat widget from Lincoln Cannon LLC enables your website visitors to engage with your custom AI assistant through an intuitive, professional interface. Our solution is designed for organizations that need:

  • Philosophical & Religious Guidance: Provide intelligent responses to questions about philosophy, theology, and spiritual matters
  • Health Science Education: Offer evidence-based information about health, wellness, and scientific research
  • Personal Emulation: Create AI assistants that embody specific personalities, knowledge, or expertise
  • Academic Support: Assist with research, analysis, and educational content in specialized fields

We also support traditional business applications including customer support, lead qualification, content guidance, and 24/7 availability for organizations with more general needs.

Key Benefits

FeatureBusiness Value
One-Line IntegrationMinimal development effort, rapid deployment
Origin-Based RoutingAutomatic assistant selection based on your domain
Conversation MemoryMaintains context across multiple interactions
Page Context AwarenessShares the current page URL and title with the assistant on first use
Professional DesignMatches your brand with customizable styling
Analytics IntegrationTrack engagement and measure ROI
Mobile ResponsiveWorks seamlessly across all devices
Streaming ResponsesReal-time message streaming for better user experience
Fullscreen ModeExpand chat to full screen for better readability
About PanelDisplay custom information about your assistant

Getting Started

Prerequisites

Before integrating the chat widget, ensure you have:

  1. Active Lincoln Cannon LLC AI Assistant Service: Your custom assistant must be configured and deployed
  2. Domain Registration: Your website domain must be registered with our system
  3. API Access: Valid API credentials for your assistant

Important: Contact Lincoln Cannon LLC to set up your custom AI assistant service before proceeding with integration.

Quick Integration

Add this single line to your website's HTML:

<script src="https://cloud.lincolncannon.co/lib/assistant.min.js"></script>

The widget will automatically:

  • Detect your website's domain
  • Route to your specific AI assistant
  • Display with default styling
  • Begin accepting user interactions

Integration Guide

Step 1: Basic Setup

Include the chat widget script in your website's HTML, preferably before the closing </body> tag:

<!DOCTYPE html><html><head><title>Your Website</title></head><body><!-- Your website content --><!-- AI Assistant Chat Widget --><script src="https://cloud.lincolncannon.co/lib/assistant.min.js"></script></body></html>

Step 2: Customize Configuration

Configure your assistant's appearance and behavior by setting the ChatWidgetConfig object before including the script:

<script>
window.ChatWidgetConfig = {
    title: 'Customer Support',
    context: 'Hello! I\'m here to help with your questions about our products and services.',
    primaryColor: '#28a745',
    primaryHoverColor: '#218838'
};
</script><script src="https://cloud.lincolncannon.co/lib/assistant.min.js"></script>

Step 3: Test Your Integration

  1. Deploy your changes to your website
  2. Visit your website and look for the chat widget in the bottom-right corner
  3. Click the widget to open a conversation
  4. Test with sample questions to verify your assistant responds correctly

Configuration Options

Basic Configuration

PropertyTypeDefaultDescription
titlestring'Assistant'Display name for your assistant
contextstring'Hello! How can I help?'Initial greeting message for new conversations
retextstring'Hello again! How can I help?'Greeting message for returning conversations
primaryColorstring'#007bff'Primary brand color (hex code)
primaryHoverColorstring'#0056b3'Hover state color (hex code)
descriptionstringnullCustom description shown in the about panel. A simple <a href> (https or a same-site path beginning with /) renders as a link; other HTML is shown as text
hideBubbleTitlebooleanfalseWhen true, the launcher bubble shows only the icon (header title unchanged)
bubblePositionstring'bottom-right'Launcher placement: bottom-right, bottom-left, middle-left, or middle-right

Advanced Configuration

PropertyTypeDefaultDescription
includePageContextbooleantrueInclude the current page URL and title on the first message for that URL
useStreamingbooleantrueEnable real-time streaming responses
idTokenstring—Optional short-lived Lincoln Cannon LLC ID token from your server (skips Hosted UI sign-in). Never put a refresh token here.
idTokenExpiresInnumber—Optional seconds until idToken expires; derived from the token when omitted
getIdTokenfunction—Preferred SPA/BFF: async () => ({ idToken, expiresIn? }) or { expiresAt } (ms). Return { status: "unauthorized" } for login redirect
identityProviderstring—Cognito IdP name for Hosted UI (identity_provider) so users land on your IdP
authTokenUrlstring—BFF GET URL returning { idToken } / { id_token } (+ expiresIn / expiresAt)
authTokenHeadersobject—Optional headers for authTokenUrl (e.g. Authorization)
authTokenCredentialsstringincludeinclude, same-origin, or omit for authTokenUrl
authLoginUrlstring—Redirect when token fetch is unauthorized; widget appends returnUrl
signInOnOpenbooleanfalseWhen true, opening may redirect to authLoginUrl / Hosted UI if unsigned. BFF embeds always silently try getIdToken / authTokenUrl on open (Connect only if that fails, unless signInOnOpen allows redirect)
onIdTokenExpiredfunction—Legacy refresh after inject; prefer getIdToken for Connect and refresh
apiEnvironmentstring—Optional prod or dev. Default is production API/OAuth for customer sites. Do not set dev on customer embeds.

SSO modes: Prefer getIdToken for SPA/Bearer BFFs; use authTokenUrl for cookie (or headered) BFFs; use identityProvider for Hosted UI to your IdP. Precedence: getIdToken → authTokenUrl → identityProvider. BFF embeds silently try token fetch when the bubble opens (no login redirect unless signInOnOpen: true). After Connect redirects to authLoginUrl, the widget resumes token fetch once on return. Customer SSO chrome says Connect / Connecting …; omit those knobs for the default house Google/Facebook Hosted UI (Sign in). With BFF or injected tokens (no refresh in the browser), Cognito sign-out is hidden — end the session in your app.

Launcher placement notes: bottom-left mirrors the default insets on the left. middle-left / middle-right sit flush on that edge and rotate the labeled bubble 90° (no rotation when hideBubbleTitle is true). While the chat panel is open, the launcher is hidden. The panel docks to the matching bottom corner: bottom positions stay there, and middle positions move there from the side edge.

Example Configuration

window.ChatWidgetConfig = {
    // Basic settings
    title: 'Product Support',
    context: 'Welcome to our product support! I can help you with installation, troubleshooting, and feature questions.',
    retext: 'Welcome back! How can I assist you today?',
    primaryColor: '#e74c3c',
    primaryHoverColor: '#c0392b',
    description: 'Our AI assistant is trained on our product documentation and can help with common questions and troubleshooting.',
    
    // Advanced settings
    includePageContext: true,
    useStreaming: true
};

Advanced Features

Programmatic Control

Control the chat widget programmatically using the ChatWidgetAPI:

// Open the chat widget
ChatWidgetAPI.open();

// Close the chat widget
ChatWidgetAPI.close();

// Send a message programmatically
ChatWidgetAPI.sendMessage('I need help with my order');

// Update configuration dynamically
ChatWidgetAPI.updateConfig({
    title: 'New Assistant Name',
    primaryColor: '#9b59b6'
});

// Supply a short-lived ID token from your backend (optional SSO embed)
ChatWidgetAPI.setIdToken('<id_token>', 3600);

// Enable/disable streaming
ChatWidgetAPI.enableStreaming();
ChatWidgetAPI.disableStreaming();

// Check streaming status
if (ChatWidgetAPI.isStreamingEnabled()) {
    console.log('Streaming is enabled');
}

// Reset conversation session
ChatWidgetAPI.resetSession();

// Fullscreen controls
ChatWidgetAPI.enterFullscreen();
ChatWidgetAPI.exitFullscreen();
ChatWidgetAPI.toggleFullscreen();
if (ChatWidgetAPI.isFullscreen()) {
    console.log('Widget is in fullscreen mode');
}

Event Callbacks

Monitor user interactions and integrate with your analytics:

window.ChatWidgetConfig = {
    // Called when user sends a message
    onMessageSent: function(message) {
        console.log('User sent:', message);
        // Send to Google Analytics
        if (typeof gtag !== 'undefined') {
            gtag('event', 'chat_message_sent', {
                'event_category': 'engagement',
                'event_label': message.substring(0, 100)
            });
        }
    },
    
    // Called when assistant responds
    onMessageReceived: function(message, data) {
        console.log('Assistant replied:', message);
        // Track conversation metrics
        if (typeof analytics !== 'undefined') {
            analytics.track('Chat Response Received', {
                messageLength: message.length,
                sessionId: data.result
            });
        }
    },
    
    // Called when errors occur
    onError: function(error) {
        console.error('Chat error:', error);
        // Send to error tracking service
        if (typeof Sentry !== 'undefined') {
            Sentry.captureException(error);
        }
    }
};

Trigger Chat from Custom Elements

Create custom buttons or links to trigger the chat widget:

<!-- Help button in navigation --><button onclick="ChatWidgetAPI.open()" class="help-button">
    Need Help?
</button><!-- Pre-filled message button --><button onclick="ChatWidgetAPI.sendMessage('I have a question about pricing')">
    Ask About Pricing
</button><!-- Product-specific help --><button onclick="ChatWidgetAPI.sendMessage('I need help with Product X installation')">
    Product X Support
</button>

Widget Interface Features

The chat widget includes several built-in features:

  • Info Panel: Click the info icon (ℹ️) to view custom description, attribution, and Custom AI Assistants Terms of Use (company and terms links open in a new tab)
  • Fullscreen Mode: Click the expand icon (⤢) to view the chat in fullscreen
  • Close Button: Click the X to close the chat window
  • Auto-email Detection: Email addresses in assistant responses are automatically converted to clickable mailto links

API Reference

ChatWidgetAPI Methods

MethodParametersDescription
open()NoneOpens the chat widget
close()NoneCloses the chat widget
sendMessage(message)message (string)Sends a message and opens the widget
updateConfig(config)config (object)Updates widget configuration
enableStreaming()NoneEnables real-time streaming responses
disableStreaming()NoneDisables streaming, uses polling instead
isStreamingEnabled()NoneReturns boolean indicating streaming status
resetSession()NoneClears conversation session and starts fresh
toggleFullscreen()NoneToggles fullscreen mode
enterFullscreen()NoneEnters fullscreen mode
exitFullscreen()NoneExits fullscreen mode
isFullscreen()NoneReturns boolean indicating fullscreen status

Configuration Properties

PropertyTypeRequiredDescription
titlestringNoWidget title and button text
contextstringNoInitial assistant context for new conversations
retextstringNoAssistant context for returning conversations
primaryColorstringNoPrimary color (hex)
primaryHoverColorstringNoHover color (hex)
descriptionstringNoCustom description for the about panel. A simple <a href> (https or a same-site path beginning with /) renders as a link; other HTML is shown as text
hideBubbleTitlebooleanNoHide agent name on the launcher bubble (icon only)
bubblePositionstringNobottom-right (default), bottom-left, middle-left, or middle-right
includePageContextbooleanNoInclude page URL and title in context
useStreamingbooleanNoEnable streaming responses
onMessageSentfunctionNoMessage sent callback
onMessageReceivedfunctionNoMessage received callback
onErrorfunctionNoError callback

The widget chooses the correct agent API host from your page domain. You do not configure chat or stream URLs in ChatWidgetConfig. For direct HTTP (non-widget) integration, use the agent API docs.

Implementation Examples

Religious Organization Website

<!DOCTYPE html><html><head><title>Your Religious Organization</title></head><body><header><nav><a href="/">Home</a><a href="/teachings">Teachings</a><a href="/community">Community</a><button onclick="ChatWidgetAPI.open()">Ask Questions</button></nav></header><main><h1>Welcome to Our Community</h1><p>Explore our teachings and find answers to your spiritual questions.</p><!-- Teaching sections --><div class="teaching"><h3>Scripture Study</h3><button onclick="ChatWidgetAPI.sendMessage('Can you help me understand this scripture passage?')">
                Ask About Scripture
            </button></div></main><!-- AI Assistant Configuration --><script>
        window.ChatWidgetConfig = {
            title: 'Spiritual Guide',
            context: 'Hello! I\'m here to help you explore our teachings and answer questions about our faith tradition. I can assist with scripture study, theological questions, and spiritual guidance.',
            retext: 'Welcome back! I\'m here to continue our spiritual journey together.',
            primaryColor: '#8e44ad',
            primaryHoverColor: '#7d3c98',
            description: 'Our spiritual guide is trained on our sacred texts and can help you explore our faith tradition through thoughtful conversation.',
            useStreaming: true,
            onMessageSent: function(message) {
                // Track spiritual guidance interactions
                gtag('event', 'spiritual_guidance_requested', {
                    'event_category': 'engagement',
                    'event_label': message.substring(0, 50)
                });
            }
        };
    </script><!-- AI Assistant Widget --><script src="https://cloud.lincolncannon.co/lib/assistant.min.js"></script></body></html>

Health Science Research Platform

<!DOCTYPE html><html><head><title>Health Science Research</title></head><body><header><h1>Health Science Research Platform</h1><nav><a href="/research">Research</a><a href="/publications">Publications</a><a href="/about">About</a></nav></header><main><section class="hero"><h2>Evidence-Based Health Information</h2><p>Access the latest research and scientific insights.</p><button onclick="ChatWidgetAPI.sendMessage('What are the latest findings on longevity research?')">
                Ask About Research
            </button></section></main><!-- AI Assistant Configuration --><script>
        window.ChatWidgetConfig = {
            title: 'Research Assistant',
            context: 'Hello! I\'m your health science research assistant. I can help you understand scientific studies, explain research methodologies, and provide evidence-based information about health and wellness topics.',
            retext: 'Welcome back! I\'m ready to help you with more research questions.',
            primaryColor: '#27ae60',
            primaryHoverColor: '#229954',
            description: 'Our research assistant is trained on peer-reviewed scientific literature and can help you understand complex health topics.',
            useStreaming: true,
            onMessageReceived: function(message, data) {
                // Track research inquiries
                if (message.toLowerCase().includes('research') || 
                    message.toLowerCase().includes('study')) {
                    gtag('event', 'research_inquiry', {
                        'event_category': 'academic'
                    });
                }
            }
        };
    </script><!-- AI Assistant Widget --><script src="https://cloud.lincolncannon.co/lib/assistant.min.js"></script></body></html>

Philosophy Education Platform

<!DOCTYPE html><html><head><title>Philosophy Education</title></head><body><header><h1>Philosophy Learning Platform</h1><nav><a href="/courses">Courses</a><a href="/thinkers">Philosophers</a><a href="/discussions">Discussions</a></nav></header><main><section class="courses"><h2>Philosophical Traditions</h2><div class="course"><h3>Ancient Philosophy</h3><button onclick="ChatWidgetAPI.sendMessage('Can you explain Plato\'s theory of forms?')">
                    Ask About Plato
                </button></div><div class="course"><h3>Modern Philosophy</h3><button onclick="ChatWidgetAPI.sendMessage('What is Kant\'s categorical imperative?')">
                    Ask About Kant
                </button></div></section></main><!-- AI Assistant Configuration --><script>
        window.ChatWidgetConfig = {
            title: 'Philosophy Tutor',
            context: 'Hello! I\'m your philosophy tutor. I can help you understand philosophical concepts, explore different traditions, and engage in thoughtful discussions about ethics, metaphysics, epistemology, and more.',
            retext: 'Welcome back! I\'m here to continue our philosophical exploration.',
            primaryColor: '#2c3e50',
            primaryHoverColor: '#1a252f',
            description: 'Our philosophy tutor is trained on classical and contemporary philosophical texts and can guide you through complex philosophical concepts.',
            useStreaming: true,
            onMessageSent: function(message) {
                // Track philosophical learning interactions
                gtag('event', 'philosophy_inquiry', {
                    'event_category': 'education',
                    'event_label': message.substring(0, 50)
                });
            }
        };
    </script><!-- AI Assistant Widget --><script src="https://cloud.lincolncannon.co/lib/assistant.min.js"></script></body></html>

Personal Emulation Platform

<!DOCTYPE html><html><head><title>Personal Emulation</title></head><body><header><h1>AI Personality Platform</h1><nav><a href="/personalities">Personalities</a><a href="/create">Create Your Own</a><a href="/about">About</a></nav></header><main><section class="personalities"><h2>Available AI Personalities</h2><div class="personality"><h3>Historical Figure</h3><p>Chat with an AI trained on the writings and personality of a historical figure.</p><button onclick="ChatWidgetAPI.sendMessage('Tell me about your perspective on leadership')">
                    Start Conversation
                </button></div><div class="personality"><h3>Expert Consultant</h3><p>Engage with an AI that embodies specific expertise or knowledge domain.</p><button onclick="ChatWidgetAPI.sendMessage('What advice would you give about this topic?')">
                    Get Expert Advice
                </button></div></section></main><!-- AI Assistant Configuration --><script>
        window.ChatWidgetConfig = {
            title: 'AI Personality',
            context: 'Hello! I\'m an AI personality designed to emulate specific characteristics, knowledge, or perspectives. I can engage in conversations that reflect the personality and expertise I\'ve been trained to embody.',
            retext: 'Welcome back! I\'m ready to continue our conversation.',
            primaryColor: '#e74c3c',
            primaryHoverColor: '#c0392b',
            description: 'This AI personality is trained to emulate specific characteristics and knowledge. Click the info button to learn more about this personality.',
            useStreaming: true,
            onMessageReceived: function(message, data) {
                // Track personality interaction metrics
                analytics.track('Personality Interaction', {
                    messageLength: message.length,
                    sessionId: data.result
                });
            }
        };
    </script><!-- AI Assistant Widget --><script src="https://cloud.lincolncannon.co/lib/assistant.min.js"></script></body></html>

Common Business Applications

For organizations with more general needs, our widget also supports traditional business applications:

  • E-commerce: Product recommendations, order support, and customer service
  • Service Businesses: Consultation scheduling, service information, and lead qualification
  • Healthcare: Appointment booking, general health information, and provider assistance
  • Professional Services: Client support, service explanations, and consultation requests

These applications use the same integration approach with configuration tailored to your specific business needs.

Support & Troubleshooting

Common Issues

IssueSolution
Widget not appearingVerify the script URL is correct and accessible
Assistant not respondingCheck that your domain is registered with Lincoln Cannon LLC
Styling conflictsThe widget uses isolated styling but may require small changes to your CSS
Streaming not workingEnsure useStreaming is set to true and check network connectivity
Fullscreen not workingVerify the widget is properly loaded and try refreshing the page

Testing Your Integration

  1. Browser Console: Open developer tools and check for JavaScript errors
  2. Network Tab: Verify API requests are being made to the correct endpoint
  3. Cross-Browser Testing: Test on Chrome, Firefox, Safari, and Edge
  4. Mobile Testing: Verify responsive behavior on mobile devices
  5. Fullscreen Testing: Test fullscreen functionality on different screen sizes

Debug Mode

Enable detailed logging for troubleshooting:

window.ChatWidgetConfig = {
    onError: function(error) {
        console.error('AI Assistant Error:', error);
        // Send to your error tracking service
        if (typeof Sentry !== 'undefined') {
            Sentry.captureException(error);
        }
    }
};

Getting Help

If you encounter issues with your AI assistant integration:

  1. Check Documentation: Review this guide for configuration details
  2. Test Basic Setup: Ensure the widget loads with minimal configuration
  3. Contact Support: Reach out to Lincoln Cannon LLC for technical assistance
  4. Review Logs: Check your website's error logs for additional information

Performance Optimization

  • Load Time: The widget loads asynchronously and won't block your page
  • Caching: The script is served from a CDN for optimal performance
  • Mobile Optimization: Responsive design ensures smooth operation on all devices
  • Streaming: Real-time responses provide better user experience

Need Professional Assistance?

Lincoln Cannon LLC provides custom AI assistant development and integration services. Contact us to discuss your specific requirements and get expert guidance for your implementation.

Terms of Use

Use of the Custom AI Assistants service is governed by the Custom AI Assistants Terms of Use.