Skip to main content

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
Not interested in technical details? Skip to Search Features for practical usage tips.Want to integrate via API? Jump to API Integration.

The Problem: Why Keyword Search Fails for Docs

Traditional search tools (GitHub search, grep, etc.) look for exact keyword matches:
You ask: “How do I handle database schema changes?”Keyword search thinks:
Results:
  • ❌ Misses docs/migrations.md (doesn’t mention “schema changes”)
  • ❌ Misses architecture/versioning.md (doesn’t say “database”)
  • ✅ Finds README.md with phrase “database schema changes” (lucky!)
Problem: Your migrations guide uses words like “migration” and “versioning”—not “schema changes”
This is why ULPI uses semantic search powered by vector embeddings.

High-Level: How It Works in 30 Seconds

1

You Connect Repositories (2 minutes)

One-click OAuth connection to GitHub, GitLab, Bitbucket, or GiteaULPI automatically discovers all your documentation:
  • README files
  • docs/ directories
  • Wikis
  • Markdown files everywhere
2

AI Indexes Your Docs (2-5 minutes)

Automatic processing in the background:
  1. Parse every documentation file
  2. Break into logical sections (chunking)
  3. Convert to vector embeddings (AI representation)
  4. Store in lightning-fast search engine (Typesense)
You don’t do anything. It just works.
3

Your AI Asks Questions (instant)

When your AI assistant needs docs:
Total time: Under 50 milliseconds
4

Auto-Sync on Every Push (60 seconds)

You push to main:
ULPI automatically:
  1. Receives webhook notification (1 second)
  2. Re-indexes changed files (30-60 seconds)
  3. AI now sees updated documentation
No manual sync button. Always up-to-date.
The magic: AI understands meaning, not just keywords. That’s why it finds the right docs even when you use different terminology.

Deep Dive: The Indexing Pipeline

For developers who want to understand the technical implementation.

Architecture Diagram

Step-by-Step: What Happens During Indexing

When you connect a repository:
1

OAuth Authentication

Read-only access via GitHub/GitLab OAuthPermissions requested:
  • ✅ Read repository contents
  • ✅ Register webhooks for auto-sync
  • No write access (we never modify your code)
2

File Discovery

ULPI scans your repository structure:
Indexed file types:
  • .md, .mdx (Markdown)
  • .txt (plain text in doc directories)
  • README.* (any extension, any directory)
  • Wiki pages (optional)
Custom exclusions: Add .ulpiignore file
3

Metadata Extraction

For each discovered file, ULPI extracts:
  • Path: docs/authentication.md
  • Branch: main
  • Last modified: Git commit timestamp
  • Author: Git commit author
  • File size: For processing estimates
Breaking documents into searchable chunks

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
With chunking:
  • 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):
  1. Respect document structure:
    • Preserve headings and sections
    • Keep code blocks together
    • Don’t split tables or lists
  2. Optimal chunk size: ~512 tokens
    • Large enough for context
    • Small enough for precision
    • Equivalent to 2-3 paragraphs
  3. Add overlap:
    • 50-token overlap between chunks
    • Prevents losing context at chunk boundaries
Example:
Result: When searching for “authentication”, you get the OAuth section—not the entire auth guide.
Converting text to AI-understandable format

What Are Embeddings?

Simple explanation: Embeddings convert text into numbers that capture meaning.Example:
Why numbers? Computers can compare numbers to find similar meanings:

The Process

1

Send to OpenAI

Each chunk is sent to OpenAI’s embedding API:Model: text-embedding-3-largeDimensions: 1,536 (captures nuanced meaning)
2

Store in Vector Database

Embeddings are stored in Typesense:

Privacy Note

Your documentation is NEVER used to train AI models.
  • Embeddings are mathematical representations, not readable text
  • OpenAI’s zero data retention policy (embeddings API)
  • We only use embeddings for search indexing
  • Original text stays in your control
Storing embeddings for lightning-fast search

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

Facets: Enable filtering by repository, file type, branch, etc. Sorting: Prioritize recent documentation
Auto-sync on every git push

How Webhooks Work

When you connect a repository, ULPI registers a webhook:GitHub webhook payload:
ULPI receives this and:
  1. Queues a re-indexing job
  2. Fetches only changed files
  3. Re-generates embeddings for changes
  4. Updates Typesense index
  5. Invalidates cache
Time: 10-60 seconds from push to searchable

Smart Re-indexing

Full re-index (slow):
  • New documentation directory created
  • Branch created/deleted
  • Manual trigger from dashboard
Partial re-index (fast):
  • Existing file modified
  • Only re-process changed chunks
  • 10-30 seconds
No re-index:
  • 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

1

Query Embedding

Your AI asks: “How do I deploy to production?”ULPI converts to embedding:
Same model as document embeddings → comparable vectors
2

Vector Similarity Search

Find similar documentation chunks:Algorithm: Cosine similarity
Typesense finds:
Threshold: Returns matches with similarity > 0.75
3

Hybrid Scoring

Combine semantic + keyword matching:
Why hybrid?
Query: “Redis configuration”Semantic search finds:
  • ✅ “Caching setup” (semantically similar)
  • ✅ “Session storage” (related concept)
  • ❌ Misses exact “redis.conf” reference
Issue: May miss exact keyword matches
4

Ranking & Filtering

Results are ranked by:
  1. Relevance score (hybrid score)
  2. Document recency (newer docs ranked higher)
  3. Repository priority (if you specified repos)
  4. File type:
    • README.md (most important)
    • docs/*.md (documentation)
    • Other files (lower priority)
Filters applied:
  • Repository scope (if API key is scoped)
  • Branch (default: main)
  • File type (if specified)
  • Date range (if specified)
5

Context Assembly

Return top results with metadata:
AI receives this and synthesizes answer:

Why This Is Fast

Sub-50ms average latency:

Optimized Vector Search

Typesense pre-computes indexes for instant similarity searchNo full-text scanning required

Three-Level Caching

  • Browser cache (5 min)
  • MCP server cache (1 hour)
  • API cache (5 min)
Repeated queries: 5ms

Smart Chunking

Returns only relevant sections, not entire files2,000 tokens vs 50,000 tokens

Dedicated Infrastructure

Separate Typesense cluster for searchNo database bottlenecks

Real-Time Updates via Webhooks

How documentation stays synchronized automatically

Webhook Flow

Processing Timeline

What happens after you push:
1

Instant: Webhook Received

< 1 secondGitHub/GitLab sends webhook to ULPI:
ULPI responds 200 OK immediately (non-blocking)
2

5-10 seconds: Job Queued

Background processing starts:
  1. Job added to Redis queue
  2. Laravel Horizon assigns worker
  3. Worker fetches changed files from GitHub
3

20-40 seconds: Re-indexing

For each changed file:
  1. Parse Markdown content
  2. Chunk into sections
  3. Generate embeddings (OpenAI API call)
  4. Update Typesense index
  5. Invalidate cached searches
4

30-60 seconds: Searchable

Documentation is now searchable:
  • ✅ AI assistants see updated docs
  • ✅ New sections discoverable
  • ✅ Deleted sections removed
  • ✅ Cache cleared
Total time: 30-60 seconds from push to searchable
Large pushes (100+ files): May take 2-5 minutes. Check indexing status in dashboard.

MCP Integration Architecture

How AI assistants access your documentation

MCP 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:
Seamless. User doesn’t see any of this—just accurate answers from their docs.

Caching Strategy

Three-level cache for optimal performance
Location: User’s browser or IDEDuration: 5 minutesPurpose: Instant results for repeated queries in same sessionHow it works:
Benefit:
  • First query: 200ms (API call)
  • Repeat query: 5ms (local cache)
Invalidation: Automatic after 5 minutes

Cache Invalidation on Push

When you push changes:
Result: Within 60 seconds, searches return updated documentation

Security & Privacy

How ULPI protects your private documentation
What ULPI can do:
  • ✅ Read repository contents
  • ✅ Receive webhook notifications
  • ✅ Clone repositories (temporarily, in-memory)
What ULPI CANNOT do:
  • ❌ Write files
  • ❌ Create commits
  • ❌ Push changes
  • ❌ Delete branches
  • ❌ Modify repository settings
OAuth tokens:
  • Stored encrypted (AES-256) in MySQL
  • Never logged or exposed
  • Refreshed automatically before expiration
  • Revocable anytime from GitHub/GitLab settings
Revoke access:
Access removed instantly.
Security model:
  • Each API key is scoped to your team only
  • Cannot access other customers’ documentation
  • Cannot be used for other ULPI products (unless explicitly granted)
Storage:
  • Hashed using bcrypt (cost factor: 12)
  • Never stored in plaintext
  • Never logged
  • Transmitted only over HTTPS (TLS 1.3)
Key format:
Rotation:
  • Create new key
  • Update MCP config
  • Revoke old key
  • Zero downtime
Rate limiting:
  • 1,000 requests/hour per key
  • Prevents abuse if key is compromised
What gets indexed:
  • Documentation files only (.md, .mdx, README.*)
  • NOT source code (unless you explicitly enable comment indexing)
AI training policy:
Your documentation is NEVER used to train AI models.
  • Not OpenAI’s models
  • Not Anthropic’s models
  • Not any third-party models
What happens:
  • OpenAI generates embeddings (mathematical representations)
  • OpenAI immediately discards the text (zero data retention policy)
  • Only embeddings are stored (not human-readable)
  • Used exclusively for your search
Data retention:
  • Indexed as long as repository is connected
  • Deleted within 30 days after repository disconnection
  • Deleted immediately upon account cancellation
Certifications:
  • ✅ SOC 2 Type II compliant
  • ✅ GDPR compliant
  • ✅ CCPA compliant
  • ✅ HIPAA available (Enterprise plan)
Data residency:
  • US region: AWS us-east-1 (default)
  • EU region: AWS eu-west-1 (Enterprise only)
  • Custom region: Available for Enterprise
Encryption:
  • In transit: TLS 1.3
  • At rest: AES-256 (database, backups, S3)
Access controls:
  • 2FA required for ULPI employees
  • Zero standing access to production
  • Time-limited break-glass access (logged)
  • No access to customer data without explicit approval
Auditing:
  • All access logged to immutable S3 bucket
  • Quarterly security reviews
  • Annual penetration testing
Full security details
Infrastructure:
  • Hosted on AWS in VPC
  • Private subnets (no public IPs for databases)
  • Security groups (least privilege)
  • WAF (Web Application Firewall) enabled
DDoS protection:
  • CloudFront CDN (global edge caching)
  • AWS Shield Standard
  • Rate limiting at API gateway
Monitoring:
  • Sentry for error tracking
  • CloudWatch for infrastructure
  • Alerts for anomalous traffic

Performance & Scalability

Response Time Metrics

Real-world performance data from production: Why so fast?

Vector Search

Typesense pre-computes indexesNo linear scanning

Redis Caching

Popular queries cached for 5 minutesSub-10ms for cached queries

Chunking Strategy

Returns 2,000 tokens, not 50,00025x fewer tokens processed

Dedicated Hardware

Separate Typesense clusterNo database contention

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
Enterprise customers:
  • Dedicated Typesense cluster (isolated resources)
  • Custom rate limits
  • SLA: 99.9% uptime
  • Priority support

Technology Stack

What powers ULPI Documentation
Framework: Laravel 12.x (PHP 8.2)Why Laravel?
  • Robust queue system (Horizon)
  • Excellent webhook handling
  • Enterprise-ready
  • Fast development
Database: MySQL 8.0
  • Stores metadata, API keys, user accounts
  • NOT used for search (that’s Typesense)
Queue: Redis + Laravel Horizon
  • Background job processing
  • Re-indexing jobs
  • Webhook processing
Cache: Redis
  • Search result caching (5 minutes)
  • Session storage
  • Rate limiting

Comparison: ULPI vs Alternatives

Why semantic search beats traditional tools When to use each:
  • 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)
Known limitations:
  1. Code search:
    • ULPI is optimized for documentation, not code
    • Code comments can be indexed (opt-in)
    • Use GitHub/grep for searching actual code
  2. Binary files:
    • PDFs, Word docs, images not indexed
    • Convert to Markdown for indexing
  3. Very large files:
    • Files >10MB are skipped
    • Break large docs into smaller files
  4. Real-time (sub-second sync):
    • Webhook processing takes 30-60 seconds
    • Not suitable for real-time wikis
  5. Private git servers:
    • Self-hosted GitHub Enterprise: ✅ Supported
    • GitLab self-hosted: ✅ Supported
    • Other git servers: 🟡 Contact us
  6. Non-English documentation:
    • Works, but embeddings optimized for English
    • Other languages: slightly lower accuracy

FAQ: Technical Questions

Not currently. ULPI uses OpenAI text-embedding-3-large for all embeddings.Why?
  • Best-in-class accuracy
  • 1,536 dimensions (high-fidelity)
  • Proven at scale
Enterprise custom models:
  • Contact us for enterprise plans
  • We can discuss alternative models
  • Requires separate deployment
Included in your plan. No per-search or per-embedding fees.What you pay:
  • Monthly subscription ($29-299)
  • Token usage for searches (included in plan)
What’s free:
  • Re-indexing (unlimited)
  • Webhook processing
  • Embedding generation
  • Storage
Overage:
  • $20 per 100,000 additional tokens (search queries only)
Not yet, but coming soon.Current options:
  • Cloud: Hosted by ULPI (default)
  • VPC peering: Connect to your VPC (Enterprise)
  • On-premise: Planned for Q2 2025
Interested in self-hosting?
Search continues to work. Only new indexing is affected.How?
  • Existing embeddings already in Typesense
  • Search uses those embeddings (no OpenAI API call)
  • Only embedding generation requires OpenAI
If OpenAI is down:
  • ✅ Search works normally
  • ❌ New files can’t be indexed
  • ❌ Updated files can’t be re-indexed
Mitigation:
  • Jobs automatically retry (exponential backoff)
  • Usually resolves in under 15 minutes

Next Steps

Try It: Getting Started

Set up ULPI in 5 minutes and see semantic search in actionNo credit card required for trial

Advanced Search Features

Learn filters, repository scoping, and query optimizationMaster semantic search

API Integration

Integrate ULPI directly into your applications via REST APIBuild custom workflows

Repository Management

Manage connected repos, configure indexing, view metricsOptimize indexing

Still have questions?Average response time: Under 2 hours during business hours