Snehangshu Roy · systems + AIBengaluru --:--Résumé Available for contract work
All work
04 / 04Python · pgvector

sift

Keyword and semantic search, fused into one ranking.

Role
Sole author
Stack
FastAPI, Celery, Redis, Postgres + pgvector, Next.js
Embeddings
fastembed, bge-small-en-v1.5, local ONNX
Storage
S3-compatible (MinIO / R2)

Ingest, then search

Swipe to see the whole diagram →

UploadPDF · image · DOCXS3 + Postgresfile + pending rowRedisjob queueCelery workerextract · OCR · thumb · embedPostgresfull-text + pgvectorQuery"notice period"Keyword rankPostgres FTSSemantic rankpgvectorRRFΣ 1 / (60 + rank)Resultslive via WebSocketboth rankings read the same Postgres

The pipeline

An upload is stored in S3-compatible storage and recorded as a pending document, then queued. A Celery worker extracts text (PyMuPDF, with a Tesseract OCR fallback for scans), makes a thumbnail and computes embeddings, updating the status as it goes. The browser sees each step live over a WebSocket.

Hybrid search

Keyword search is good at exact terms and bad at meaning; vector search is the opposite. sift runs both: Postgres full-text search and pgvector similarity over the same documents.

The two ranked lists are merged with Reciprocal Rank Fusion: each document scores Σ 1 / (60 + rank) across the lists, so a result that does well in both beats one that tops only one.

Built to run for free

  • Embeddings run locally on ONNX (BAAI/bge-small-en-v1.5), so there is no paid API.
  • Everything is configured by environment variables: the same code runs against Docker in development and free managed tiers in production.
  • Multi-tenant teams with invites and roles, JWT auth and Alembic migrations.