Prompt
I'm building a search layer for PDFs and tickets; what's the fastest path?
Latest observation
Nov 8, 2026
OpenAI APIWeb search: off
Fastest path: don’t start with “AI search”. Start with a solid hybrid retrieval pipeline over extracted text + metadata, then add smarter ranking later.
Recommended MVP architecture
- Ingest
- PDFs: extract text with layout-aware parsing.
- Tickets: pull structured fields + body/comments.
- Chunk
- Split into semantically sensible chunks, not arbitrary tokens.
- Keep page, section, ticket ID, timestamps, author, tags.
- Index
- Keyword index for exact matches, filters, and fast recall.
- Vector index for semantic similarity.
- Search
- Run both keyword + vector retrieval.
- Merge results with a hybrid score.
- Rerank
- Use a cross-encoder / reranker for top 20–50 candidates.
- Return
- Show snippets with source, page, and metadata.
- Add faceting/filtering.
Fastest implementation options
If you want the quickest production path
- Postgres + pgvector for vector search
- Postgres full-text search or OpenSearch/Elasticsearch for keyword search
- A reranker API/model on top
This is usually the fastest “real system” if your scale is moderate.
If you want fastest prototype
- Use a managed vector DB like Pinecone, Weaviate, Qdrant Cloud
- Pair it with:
- simple text search (OpenSearch or even SQLite FTS for early prototype)
- an embedding model
- a reranker
What matters most for PDFs and tickets
- PDF extraction quality is often the biggest bottleneck.
- Use OCR only when needed.
- Preserve page numbers and headings.
- Chunking strategy:
- PDFs: by heading/paragraph/page section
- Tickets: title + body + comments, maybe one chunk per comment thread
- Metadata filters:
- source, date, customer, product, priority, status, assignee
- Deduplication:
- tickets and docs often repeat boilerplate
Suggested stack by speed
Small/medium scale
- Ingestion: Python
- PDF parsing:
pymupdf/pdfplumber/ OCR fallback - Embeddings: OpenAI / Voyage / Cohere / sentence-transformers
- Storage: Postgres + pgvector
- Keyword search: Postgres FTS
- API: FastAPI
Larger scale
- OpenSearch/Elasticsearch for keyword + filters
- Vector DB or OpenSearch kNN
- Reranker service
- Async ingestion pipeline
Practical advice
- Don’t build your own embedding model first.
- Don’t rely on vectors alone; exact search matters a lot for tickets and PDFs.
- Start with hybrid retrieval + reranking.
- Measure with a small labeled set: 50–200 real queries.
Fastest MVP roadmap
Day 1–2
- Extract text from PDFs/tickets
- Store chunks + metadata in Postgres
- Add embeddings
Day 3
- Add keyword search + vector search
- Merge results
Day 4
- Add reranking
- Add filters and snippet display
Day 5
- Evaluate on real queries and tune chunking
If you want, I can propose a concrete stack and schema for either:
- Postgres/pgvector-only, or
- OpenSearch + vector DB,
depending on your scale and budget.