Key Takeaways
- Semantic search delivers 95% accuracy vs 51% for keyword-only
- Hybrid search combines vector similarity with exact keyword matching
- pgvector enables vector search directly in PostgreSQL
- Natural language queries eliminate the need for SQL knowledge
- Multi-turn conversations with context retention enable iterative refinement
Traditional document search requires exact field names and SQL knowledge. AI chat lets your CFO ask "Show me all Acme Corp documents" and get instant results.
Here's the problem with traditional document search: Your AP team processes 5,000 documents per month. When someone asks "Find the invoice where we ordered 500 units of part XYZ-123," your options are:
- SQL query:
SELECT * FROM invoices WHERE line_items LIKE '%XYZ-123%' AND quantity = 500 - Keyword search: Type "XYZ-123 500" and hope it matches
- Manual search: Spend 15 minutes digging through emails
None of these work for non-technical users. The CFO shouldn't need to know your database schema or exact field names to find documents.
The Gap: Keyword Search vs. Semantic Understanding
Traditional keyword search relies on exact text matching. If your query says "Acme Corporation" but the invoice says "Acme Corp," you get zero results, even though they're the same company.
Semantic search understands meaning:
- "Show me all Acme documents" → finds "Acme Corp," "Acme Corporation," "ACME INC"
- "What's arriving next week?" → searches PO acks for
delivery_datein next 7 days - "Find quotes expiring soon" → searches
quote_expiration_datewithin 30 days - "Show invoices over $10K from Q4" → parses date range + amount filter
Vector embeddings convert text into mathematical representations that capture semantic meaning. Documents with similar meaning cluster together in vector space, even if they use different words.
How It Works: Hybrid Search Architecture
Production-grade document search doesn't use pure semantic search OR pure keyword search. It uses hybrid search that combines both.
Hybrid Search Pipeline
- User Query: "Show me all Acme Corp documents from last month"
- Vector Search (Semantic): Converts query to embedding, finds semantically similar documents (captures "Acme Corp" = "Acme Corporation")
- Keyword Search (BM25): Exact text matching for precise terms like dates, amounts, part numbers
- Fusion: Combines results using Reciprocal Rank Fusion (RRF) or weighted scoring
- LLM Reranking: Optional final pass to rank results by relevance
- Return: Top 10 most relevant documents
Why hybrid beats either method alone:
- Vector search: Great for semantic similarity ("urgent payment" finds "expedited invoice") but misses exact matches
- Keyword search: Perfect for exact terms (invoice #12345, part XYZ-123) but fails on synonyms
- Hybrid: Research shows 15% improvement in retrieval accuracy over keyword-only (nDCG@10 metric)
Technical Stack: pgvector + PostgreSQL
Kynthar uses pgvector, a PostgreSQL extension for vector similarity search—because it combines vector and relational data in one system:
Why PostgreSQL + pgvector?
- Avoid separate vector database (Pinecone, Weaviate)—everything in one system
- ACID transactions for financial data
- Hybrid queries mix vector search + SQL filters in single query
- HNSW indexing for fast approximate nearest neighbor search
From Query to Answer: Natural Language Processing
When a user types "Show me all invoices from Acme Corp over $5K in December," the system needs to:
- Parse intent: User wants invoices (document type filter)
- Extract entities: "Acme Corp" (vendor), "$5K" (amount threshold), "December" (date range)
- Generate query: Convert to hybrid search + SQL filters
- Execute: Run vector search + keyword fallback
- Return results: Ranked by relevance
Modern LLMs achieve 85.3% accuracy on complex SQL generation (Spider dataset), but require schema context and careful prompting.
Example: Executive Search Scenario
Traditional Search (Keyword-Only)
Query: "acme december invoice"
Problem:
- Misses "Acme Corporation" (only finds exact "acme")
- Returns all documents with "december" (noise)
- No understanding of "over $5K" filter
- User has to manually filter 200 results
AI Chat (Hybrid Search)
Query: "Show me invoices from Acme over $5K in December"
Result:
- Finds "Acme Corp," "Acme Corporation," "ACME INC"
- Filters to invoices only (not POs or quotes)
- Applies
amount > 5000filter - Returns 12 exact matches in 3 seconds
Real-World Query Examples
Here's what users actually ask in production:
1. Vendor Intelligence
2. Delivery Planning
3. Discount Capture
4. Financial Analysis
Non-technical users (CFO, procurement managers, executives) can self-serve instead of emailing AP team. Average query time: 3 seconds vs. 15+ minutes for manual email search.
Beyond Search: Conversational Interaction
AI chat isn't just search—it's multi-turn conversation with context retention:
This requires stateful conversation management—the system tracks query history and applies cumulative filters.
Accuracy & Performance Metrics
- Query accuracy: 94% of searches return correct results (user doesn't need to refine)
- Response time: Median 2.8 seconds (vector search + keyword + LLM parsing)
- Precision@10: 89% (top 10 results are relevant)
- Vendor name matching: 98% (captures spelling variations)
Compared to alternatives:
- SQL queries: 100% accurate but requires technical knowledge (excludes 90% of users)
- Keyword search: 51% accuracy, misses semantic matches
- Manual email search: 15+ minutes per query, error-prone
Implementation: What It Takes
Building production-grade AI search requires:
- Vector embeddings: Generate embeddings for all documents (OpenAI, Cohere, or open-source models)
- Vector database: Store + index embeddings (pgvector, Pinecone, Weaviate)
- Hybrid search: Combine vector similarity + keyword matching + SQL filters
- Query parsing: LLM converts natural language → structured filters
- Ranking: Reciprocal Rank Fusion (RRF) to merge vector + keyword results
- Context management: Track conversation history for multi-turn queries
Implementing from scratch requires 2-3 months of engineering time (vector DB setup, embedding pipeline, query parser, hybrid search logic, UI). Most teams use managed solutions to focus on core product.
Case Study: Professional Services Firm
Company: 400-employee consulting firm processing 3,000 vendor documents/month
Before AI chat:
- Executives emailed AP team for document requests (average 2-3 emails/day)
- AP team spent 30+ minutes per request searching emails
- Typical turnaround: 4-6 hours (AP team has other priorities)
- No visibility into vendor spending patterns or contract expirations
After AI chat (Kynthar):
- Executives self-serve: "Show all ABC vendor documents" → 3-second response
- AP team time saved: 12 hours/week (no more manual searches)
- Average query time: 3 seconds vs. 4-6 hours
- Finance team discovered $42K in expiring quotes (early-bird pricing captured)
12 hours/week x $40/hour AP labor = $24,960/year saved in search time alone. Plus $42K captured from expiring quotes. Total value: $66,960 annual vs. $7,188 Kynthar cost.
The Future: Multimodal Search
Next-generation document search will handle:
- Visual search: "Find the invoice with the blue logo" (image embeddings)
- Cross-document reasoning: "Compare pricing between these three quotes"
- Anomaly detection: "Show invoices where price changed >10% from previous orders"
- Predictive queries: "Which vendors are we likely to exceed budget with?"
The technical foundation—hybrid vector + keyword search—enables these advanced capabilities without architectural rewrites.
Try AI Chat Search Free
Process 25 documents, then ask: "Show me all documents from [your vendor]". See semantic search in action.
Start Free TrialNo credit card required. 5-minute setup. Cancel anytime.
Sources & References
- ResearchGate. (2017). "A Comparative Study of Keyword and Semantic based Search Engine" - Semantic system achieved 95% accuracy vs 51% for keyword-based filtering.
- Supabase. (2024). "pgvector: Embeddings and vector similarity" - Vector embeddings convert text into mathematical representations that capture semantic meaning.
- Denser.ai. (2024). "Semantic Search vs Keyword Search: Which is Better?" - For datasets larger than small ones, hybrid search combining keyword and vector methods yields best outcomes.
- OpenSearch. (2025). "The ABCs of semantic search: Architectures, benchmarks, and combination strategies" - Fine-tuned model with arithmetic/geometric combination provides ~15% boost in nDCG@10 over traditional BM25 keyword search.
- GitHub. (2024). "pgvector: Open-source vector similarity search for Postgres" - PostgreSQL extension for storing embeddings and performing vector similarity search.
- AWS Machine Learning Blog. (2024). "Enterprise-grade natural language to SQL generation using LLMs" - State-of-the-art methods like DIN-SQL achieve 85.3% accuracy on Spider dataset for text-to-SQL conversion.
- Superlinked. (2024). "Optimizing RAG with Hybrid Search & Reranking" - Reciprocal Rank Fusion (RRF) is best starting point for hybrid search due to simplicity and resilience to mismatched score scales.
- Fuzzy Labs. (2024). "Improving RAG Performance: WTF is Hybrid Search?" - Hybrid systems significantly outperform standalone lexical and semantic approaches with improvements in Recall@10 and MAP@10.
About this article: Technical architecture and accuracy metrics based on production Kynthar system processing 50,000+ documents/month. Benchmarks cross-referenced with academic research (BEIR dataset, Spider dataset) and industry implementations. Performance varies by document complexity and query patterns.