The Technology Behind Instant Documentation Search
Ever wonder how ULPI makes your AI instantly know your entire codebase? It’s not magic—it’s a carefully engineered pipeline that transforms scattered documentation into semantic search that actually works. This guide explains:- 🔍 How semantic search understands meaning, not just keywords
- ⚡ Why ULPI is 25x more efficient than loading full docs
- 🔄 How updates sync in under 60 seconds
- 🔒 How your private docs stay secure
The Problem: Why Keyword Search Fails for Docs
Traditional search tools (GitHub search, grep, etc.) look for exact keyword matches:- Keyword Search Fails
- Semantic Search Succeeds
- ❌ Misses
docs/migrations.md(doesn’t mention “schema changes”) - ❌ Misses
architecture/versioning.md(doesn’t say “database”) - ✅ Finds
README.mdwith phrase “database schema changes” (lucky!)
High-Level: How It Works in 30 Seconds
You Connect Repositories (2 minutes)
- README files
docs/directories- Wikis
- Markdown files everywhere
AI Indexes Your Docs (2-5 minutes)
- Parse every documentation file
- Break into logical sections (chunking)
- Convert to vector embeddings (AI representation)
- Store in lightning-fast search engine (Typesense)
Your AI Asks Questions (instant)
Auto-Sync on Every Push (60 seconds)
- Receives webhook notification (1 second)
- Re-indexes changed files (30-60 seconds)
- AI now sees updated documentation
Deep Dive: The Indexing Pipeline
For developers who want to understand the technical implementation.Architecture Diagram
Step-by-Step: What Happens During Indexing
Step 1: Repository Connection & Discovery
Step 1: Repository Connection & Discovery
OAuth Authentication
- ✅ Read repository contents
- ✅ Register webhooks for auto-sync
- ❌ No write access (we never modify your code)
File Discovery
.md,.mdx(Markdown).txt(plain text in doc directories)README.*(any extension, any directory)- Wiki pages (optional)
.ulpiignore fileMetadata Extraction
- Path:
docs/authentication.md - Branch:
main - Last modified: Git commit timestamp
- Author: Git commit author
- File size: For processing estimates
Step 2: Content Parsing & Chunking
Step 2: Content Parsing & Chunking
Why Chunking?
Problem: A 10,000-line architecture doc contains dozens of distinct topics.Without chunking:- Search returns entire 10,000-line document
- AI must process all 10,000 lines to find relevant section
- Wastes 8,000 tokens on irrelevant content
- Search returns only the relevant 200-line section about your query
- AI gets precise context
- Saves 97% of tokens
How We Chunk
Smart chunking strategy (not just splitting every N characters):-
Respect document structure:
- Preserve headings and sections
- Keep code blocks together
- Don’t split tables or lists
-
Optimal chunk size: ~512 tokens
- Large enough for context
- Small enough for precision
- Equivalent to 2-3 paragraphs
-
Add overlap:
- 50-token overlap between chunks
- Prevents losing context at chunk boundaries
Step 3: Vector Embedding Generation
Step 3: Vector Embedding Generation
What Are Embeddings?
Simple explanation: Embeddings convert text into numbers that capture meaning.Example:The Process
Send to OpenAI
text-embedding-3-largeDimensions: 1,536 (captures nuanced meaning)Store in Vector Database
Privacy Note
Step 4: Indexing in Typesense
Step 4: Indexing in Typesense
Why Typesense?
Typesense is an open-source vector search engine optimized for:- ⚡ Speed: Sub-50ms vector similarity search
- 🎯 Accuracy: Hybrid semantic + keyword ranking
- 📈 Scalability: Handles millions of documents
- 🔧 Simplicity: No complex configuration
Index Structure
Step 5: Webhook Registration
Step 5: Webhook Registration
How Webhooks Work
When you connect a repository, ULPI registers a webhook:GitHub webhook payload:- Queues a re-indexing job
- Fetches only changed files
- Re-generates embeddings for changes
- Updates Typesense index
- Invalidates cache
Smart Re-indexing
Full re-index (slow):- New documentation directory created
- Branch created/deleted
- Manual trigger from dashboard
- Existing file modified
- Only re-process changed chunks
- 10-30 seconds
- Code files changed (
.js,.php, etc.) - Excluded directories (
node_modules/,vendor/) - Files in
.ulpiignore
How Semantic Search Works
When your AI assistant queries ULPI:The Search Process
Query Embedding
Vector Similarity Search
Hybrid Scoring
- Semantic Only (Problem)
- Keyword Only (Problem)
- Hybrid (Best)
- ✅ “Caching setup” (semantically similar)
- ✅ “Session storage” (related concept)
- ❌ Misses exact “redis.conf” reference
Ranking & Filtering
- Relevance score (hybrid score)
- Document recency (newer docs ranked higher)
- Repository priority (if you specified repos)
- File type:
README.md(most important)docs/*.md(documentation)- Other files (lower priority)
- Repository scope (if API key is scoped)
- Branch (default:
main) - File type (if specified)
- Date range (if specified)
Context Assembly
Why This Is Fast
Sub-50ms average latency:Optimized Vector Search
Three-Level Caching
- Browser cache (5 min)
- MCP server cache (1 hour)
- API cache (5 min)
Smart Chunking
Dedicated Infrastructure
Real-Time Updates via Webhooks
How documentation stays synchronized automaticallyWebhook Flow
Processing Timeline
What happens after you push:Instant: Webhook Received
5-10 seconds: Job Queued
- Job added to Redis queue
- Laravel Horizon assigns worker
- Worker fetches changed files from GitHub
20-40 seconds: Re-indexing
- Parse Markdown content
- Chunk into sections
- Generate embeddings (OpenAI API call)
- Update Typesense index
- Invalidate cached searches
30-60 seconds: Searchable
- ✅ AI assistants see updated docs
- ✅ New sections discoverable
- ✅ Deleted sections removed
- ✅ Cache cleared
MCP Integration Architecture
How AI assistants access your documentationMCP Protocol Overview
MCP (Model Context Protocol) is a standard for connecting AI tools to external data sources. ULPI provides an MCP server that bridges AI assistants to the ULPI API:MCP Server Implementation
The MCP server provides tools to your AI:AI Tool Invocation Example
How Claude Desktop uses ULPI MCP:Caching Strategy
Three-level cache for optimal performance- Level 1: Browser/IDE Cache
- Level 2: MCP Server Process Cache
- Level 3: API Cache (Redis)
- First query: 200ms (API call)
- Repeat query: 5ms (local cache)
Cache Invalidation on Push
When you push changes:Security & Privacy
How ULPI protects your private documentation🔒 Repository Access: Read-Only
🔒 Repository Access: Read-Only
- ✅ Read repository contents
- ✅ Receive webhook notifications
- ✅ Clone repositories (temporarily, in-memory)
- ❌ Write files
- ❌ Create commits
- ❌ Push changes
- ❌ Delete branches
- ❌ Modify repository settings
- Stored encrypted (AES-256) in MySQL
- Never logged or exposed
- Refreshed automatically before expiration
- Revocable anytime from GitHub/GitLab settings
🔑 API Keys: Tenant-Scoped
🔑 API Keys: Tenant-Scoped
- Each API key is scoped to your team only
- Cannot access other customers’ documentation
- Cannot be used for other ULPI products (unless explicitly granted)
- Hashed using bcrypt (cost factor: 12)
- Never stored in plaintext
- Never logged
- Transmitted only over HTTPS (TLS 1.3)
- Create new key
- Update MCP config
- Revoke old key
- Zero downtime
- 1,000 requests/hour per key
- Prevents abuse if key is compromised
📄 Documentation Content: Private
📄 Documentation Content: Private
- Documentation files only (
.md,.mdx,README.*) - NOT source code (unless you explicitly enable comment indexing)
- Indexed as long as repository is connected
- Deleted within 30 days after repository disconnection
- Deleted immediately upon account cancellation
🛡️ Compliance: SOC 2 Type II
🛡️ Compliance: SOC 2 Type II
- ✅ SOC 2 Type II compliant
- ✅ GDPR compliant
- ✅ CCPA compliant
- ✅ HIPAA available (Enterprise plan)
- US region: AWS us-east-1 (default)
- EU region: AWS eu-west-1 (Enterprise only)
- Custom region: Available for Enterprise
- In transit: TLS 1.3
- At rest: AES-256 (database, backups, S3)
- 2FA required for ULPI employees
- Zero standing access to production
- Time-limited break-glass access (logged)
- No access to customer data without explicit approval
- All access logged to immutable S3 bucket
- Quarterly security reviews
- Annual penetration testing
🌐 Network Security
🌐 Network Security
- Hosted on AWS in VPC
- Private subnets (no public IPs for databases)
- Security groups (least privilege)
- WAF (Web Application Firewall) enabled
- CloudFront CDN (global edge caching)
- AWS Shield Standard
- Rate limiting at API gateway
- Sentry for error tracking
- CloudWatch for infrastructure
- Alerts for anomalous traffic
Performance & Scalability
Response Time Metrics
Real-world performance data from production:| Operation | Average | 95th Percentile | 99th Percentile |
|---|---|---|---|
| Simple search (1-2 keywords) | 45ms | 120ms | 250ms |
| Complex search (full sentence) | 120ms | 300ms | 600ms |
| Re-index (small repo) (under 100 files) | 30s | 60s | 90s |
| Re-index (medium repo) (100-1k files) | 2min | 5min | 8min |
| Re-index (large repo) (1k-10k files) | 5min | 12min | 20min |
| Webhook processing | 5s | 15s | 30s |
Vector Search
Redis Caching
Chunking Strategy
Dedicated Hardware
Scalability Limits
What ULPI can handle:- Repositories per tenant: Unlimited (Enterprise)
- Files per repository: Unlimited
- Documentation file size: Up to 10MB per file
- Concurrent searches: 100/second per tenant
- Total index size: Average 1MB per 1,000 documentation pages
- Dedicated Typesense cluster (isolated resources)
- Custom rate limits
- SLA: 99.9% uptime
- Priority support
Technology Stack
What powers ULPI Documentation- Backend API
- Search & AI
- Infrastructure
- MCP Integration
- Robust queue system (Horizon)
- Excellent webhook handling
- Enterprise-ready
- Fast development
- Stores metadata, API keys, user accounts
- NOT used for search (that’s Typesense)
- Background job processing
- Re-indexing jobs
- Webhook processing
- Search result caching (5 minutes)
- Session storage
- Rate limiting
Comparison: ULPI vs Alternatives
Why semantic search beats traditional tools| Feature | ULPI | GitHub Search | grep/ripgrep | RAG (DIY) |
|---|---|---|---|---|
| Search type | Semantic + keyword | Keyword only | Keyword only | Semantic (if configured) |
| Natural language | ✅ Yes | ❌ No | ❌ No | ✅ Yes (requires setup) |
| Cross-repo search | ✅ All repos at once | ❌ One at a time | ❌ Local only | 🟡 Depends on implementation |
| AI integration | ✅ 40+ tools via MCP | ❌ No | ❌ No | 🟡 Custom integration required |
| Auto-sync | ✅ Webhook-based | ✅ Real-time | ❌ Manual | 🟡 Must build yourself |
| Setup time | ⚡ 5 minutes | 🟢 0 (built-in) | 🟢 0 (built-in) | 🔴 Days/weeks |
| Token efficiency | ⚡ 2,000 tokens | 🔴 50,000 tokens | 🔴 Full file | 🟡 Depends |
| Latency | ⚡ Sub-50ms | 🟡 100-500ms | 🟢 Instant (local) | 🔴 Varies |
| Cost | 💰 $29-299/mo | 🟢 Free | 🟢 Free | 🔴 $$$$ (infrastructure + dev time) |
- ULPI: AI assistants need semantic understanding across repos
- GitHub Search: Finding specific code patterns or file names
- grep/ripgrep: Local file searching, exact keywords
- DIY RAG: Have ML team, custom requirements, budget >$50k
Limitations & Edge Cases
What ULPI doesn’t do (yet)FAQ: Technical Questions
Can I use a different embedding model?
Can I use a different embedding model?
text-embedding-3-large for all embeddings.Why?- Best-in-class accuracy
- 1,536 dimensions (high-fidelity)
- Proven at scale
- Contact us for enterprise plans
- We can discuss alternative models
- Requires separate deployment
How much does re-indexing cost?
How much does re-indexing cost?
- Monthly subscription ($29-299)
- Token usage for searches (included in plan)
- Re-indexing (unlimited)
- Webhook processing
- Embedding generation
- Storage
- $20 per 100,000 additional tokens (search queries only)
Can I self-host ULPI?
Can I self-host ULPI?
- Cloud: Hosted by ULPI (default)
- VPC peering: Connect to your VPC (Enterprise)
- On-premise: Planned for Q2 2025
- Contact sales@ulpi.io
- Minimum: Enterprise plan
What happens if OpenAI's API goes down?
What happens if OpenAI's API goes down?
- Existing embeddings already in Typesense
- Search uses those embeddings (no OpenAI API call)
- Only embedding generation requires OpenAI
- ✅ Search works normally
- ❌ New files can’t be indexed
- ❌ Updated files can’t be re-indexed
- Jobs automatically retry (exponential backoff)
- Usually resolves in under 15 minutes
Next Steps
Try It: Getting Started
Advanced Search Features
API Integration
Repository Management
- 📧 Email: support@ulpi.io
- 📚 Docs: docs.ulpi.io
- 💬 Slack: ulpi.io/slack