The Technology Behind the Magic
Understanding how IrisAI transforms your website into an intelligent assistant.
From Content to Conversations in Three Steps
Stage 1: Content Indexing
Your website’s pages, posts, and products are analyzed and converted into searchable vector embeddings.
Stage 2: Semantic Understanding
When visitors ask questions, IrisAI searches for contextually relevant content using advanced similarity matching.
Stage 3: AI Response
OpenAI’s language models generate natural, helpful answers with source citations.
Building Your Knowledge Base
When you activate IrisAI, here’s what happens:
1. Content Discovery
The plugin scans your WordPress database for:
- Published pages
- Blog posts
- Custom post types
- WooCommerce products (if installed)
2. Text Extraction
Content is processed to extract:
- Titles and headings
- Main body text
- Excerpts and metadata
- URLs and structure
3. Vector Conversion
Using OpenAI’s embedding model, each piece of content is transformed into a 1536-dimension vector—a mathematical representation that captures meaning and context.
4. Storage
Vectors are stored in your WordPress database with efficient indexing for lightning-fast searches.
One-Time Process
Indexing happens once when you click “Start Indexing” in the Vector Search tab. Re-index anytime you make significant content updates.
Smart Chunking
Long content is intelligently split into overlapping chunks to maintain context while staying within token limits.
Understanding Questions, Not Just Keywords
When a visitor asks a question:
1. Question Analysis
The question is converted into the same vector space as your content.
2. Similarity Matching
IrisAI calculates cosine similarity between the question vector and all content vectors.
Mathematical formula: similarity = (A · B) / (||A|| × ||B||)
3. Hybrid Ranking
Results are ranked using both:
- Vector similarity (semantic meaning)
- Keyword matching (exact term matches)
- Relevance weighting (title matches rank higher)
4. Top Results
The most relevant content chunks are selected as context for the AI response.
Why This Works Better
“How do I return a product?”
Only finds pages with exact words “return” and “product”
“Can I send back something I bought?”
Understands this means the same as “return policy”
Natural Conversations with Context
With relevant content found, IrisAI generates responses:
1. Context Assembly
The top matching content chunks are combined with:
- The user’s question
- Previous chat history
- System instructions
2. Proxy Communication
Your request flows through the secure proxy system:
Sends user questions and content
- Authenticates API key
- Verifies domain
- Checks credit balance
- Tracks usage
- Processes request
- Generates response
- Displays answer
- Shows sources
3. Response Formatting
The AI response includes:
- Natural, conversational answer
- Source citations with URLs
- Clickable reference cards
4. History Persistence
The conversation is saved in browser storage for continuity across the chat session.
Security Note
Your OpenAI API key (in BYO mode) or IrisAI proxy key stays on the server—never exposed to browsers or users.
Why Use the IrisAI Proxy?
The proxy system sits between your WordPress site and OpenAI, providing:
Authentication & Authorization
- Verifies your API key with every request
- Confirms your domain is registered and active
- Prevents unauthorized usage
Billing & Credits
- Tracks token usage per request
- Deducts credits from your account balance
- Provides transparent pricing
- No surprise OpenAI bills
Rate Limiting
- Prevents abuse and runaway costs
- Configurable limits per domain
- Protects against bot attacks
Multi-Domain Management
- One account, up to 5 WordPress sites
- Separate usage tracking per domain
- Centralized credit management
Usage Analytics
- Real-time dashboard showing requests
- Token consumption history
- Cost breakdowns
- Performance metrics
Security
- HTTPS encryption for all traffic
- API keys never exposed to clients
- Domain validation on every request
- Request logging for audit trails
Getting Started:
- Sign up at irisai.cloud
- Register your WordPress domain
- Purchase credits via PayPal
- Copy your proxy URL and API key
- Enter in IrisAI plugin settings
Bring Your Own Key (Advanced)
Prefer to connect directly to OpenAI?
How BYO Mode Works:
- Uses your personal OpenAI API key
- Direct connection to OpenAI (no proxy)
- You manage billing with OpenAI directly
- Full control over model selection
When to Use BYO:
- You already have OpenAI credits
- You need custom model configurations
- You want to avoid the proxy layer
- You have high-volume usage
Setup:
- Get API key from platform.openai.com
- Enable BYO mode in General tab
- Enter your OpenAI API key
- Configure model preferences
Note: Your API key is stored securely on your server and never sent to browsers.
For the Technically Curious
Vector Embeddings Explained
Text: "I love WordPress" (OpenAI text-embedding-3-small) Vector: [0.123, -0.456, 0.789, ... 1536 dimensions]
Similar text has similar vectors:
- “WordPress is great” – Similar vector
- “I hate spinach” – Very different vector
Cosine Similarity Formula
similarity = cos(θ) = (A · B) / (||A|| × ||B||)
Where:
- A and B are vectors
- · is dot product
- || || is magnitude
Range: -1 (opposite) to 1 (identical)
Database Structure
wp_irisai_vectors - id (primary key) - post_id (WordPress post ID) - chunk_index (for split content) - content_text (original text) - embedding (1536-float array) - metadata (JSON: title, url, type) - created_at
Performance Optimization
- Vectors stored as binary data
- Indexed by post_id for fast lookups
- Chunking prevents token limit issues
- Results cached for repeated queries
Token Usage
- Average embedding: ~500 tokens
- Average query: ~50 tokens
- Average response: ~800 tokens
- Total per interaction: ~1,350 tokens
Frequently Asked Questions
How accurate is semantic search?
Typically 85-95% accuracy for finding relevant content, significantly better than keyword-only search.
How long does indexing take?
Approximately 2-3 seconds per page. A 100-page site takes about 5 minutes.
Does it slow down my site?
No. Indexing happens once in the admin. Chat requests are asynchronous and don’t block page loads.
Can I exclude pages from indexing?
Yes, filter by post type or add custom exclusion logic via hooks.
How much do credits cost?
Proxy mode: approximately $0.002 per average chat interaction. See Pricing page for details.
Is my data private?
Yes. Content is only processed for embedding generation. OpenAI doesn’t store your content. The proxy doesn’t retain message data.
What happens if I run out of credits?
The chat will stop working until you top up. You’ll see low balance warnings in your proxy dashboard.
Can I use this on a localhost development site?
Yes, but you’ll need to register localhost as one of your domains or use BYO mode.