Inspiration

Modern teams are buried under a flood of documents, chat logs, and reports — yet searching across them still feels like guessing. We wanted to build something smarter than keyword search: an agent that understands your intent, not just your query. When Elastic announced its hybrid BM25 + vector capabilities and Google Cloud brought Gemini 2.0 and Vertex AI embeddings to developers, it clicked — this was our chance to fuse the two worlds and show how AI-powered search can truly think with your data.

What it does

SearchSphere Agent is an intelligent hybrid search and labeling assistant that:

🔍 Combines Elastic Cloud BM25 relevance with kNN vector search for semantic understanding.

🤖 Uses Vertex AI Gemini 2.0 for natural-language reasoning, summaries, and conversational refinement.

🧠 Learns from context filters (team, doc type, recency) to deliver more relevant results.

🧩 Includes a Label Assist tool that helps quickly generate ground-truth datasets for evaluation.

📊 Tracks real-time latency and precision metrics (p50/p95 ms, P@K) for transparent performance.

It’s designed as a foundation for enterprise search, knowledge assistants, and research copilots.

How we built it

Frontend: Next.js 14 + TypeScript for a sleek, responsive UI with Recharts for metrics visualization.

Backend: FastAPI (Python) connects to Elastic Cloud and Google Vertex AI.

Embedding & Generation: Vertex AI Text-Embedding-005 for vectorization and Gemini-2.0-Flash for reasoning.

Search Core: Elastic Cloud hybrid mode — BM25 + kNN fused using Reciprocal Rank Fusion (RRF).

Evaluation: Integrated metrics API measuring p50/p95 latency, recall precision, and live dashboards.

CI/CD: Dockerized build tested locally and ready for Render/Vercel deployment.

We engineered a clean separation of services: /api/search, /api/chat, /api/eval, /api/label-assist — making it easy to extend into full-agentic pipelines.

Challenges we ran into

Hybrid Fusion Tuning: Balancing BM25 and vector search required optimizing Elastic’s num_candidates and caching for speed.

Latency Management: Vertex AI and Elastic both have cold-start latencies — solved with a warm-up endpoint and parallel async calls.

Environment Security: Managing Google Service Account keys and Elastic API keys without exposing secrets in the repo.

Cross-stack Integration: Getting the same index schema and vector dimensions (768 dims) consistent across ingestion and search.

Accomplishments that we're proud of

A full production-grade hybrid RAG system in under two weeks.

Achieved p50 < 900 ms end-to-end query latency and seamless offline fallback demos.

Created an evaluation and labeling UI for generating supervised relevance datasets.

Delivered clean documentation, diagrams, and metrics dashboards for judges.

What we learned

How to combine Elastic hybrid retrieval with Vertex AI generative reasoning into one cohesive experience.

Importance of metrics (p50/p95, precision@K) to quantify system performance.

How small deployment optimizations (ES_KNN_NUM_CANDIDATES, warm-up caching) make massive UX differences.

Designing transparent, open-source code that judges and developers can easily reproduce.

What's next for SearchSphere Agent

☁️ Public cloud deployment on Render + Vercel for live demo access.

🔐 Auth & multi-tenant support using Google Cognito or Firebase Auth.

🧩 Multi-modal expansion — support for images, audio transcripts, and video embeddings.

🧠 Active learning loop: use feedback from Label Assist to auto-fine-tune retrieval weights. 🏢 Pilot SearchSphere Agent in real FinOps and research organizations to prove business impact.

Built With

  • and
  • and-evaluation-??-typescript-+-next.js-14-?-modern-frontend-with-server-side-rendering-and-tailwind-css-?-pydantic
  • axios
  • cloud
  • containers
  • csv
  • elastic
  • embedding
  • fusion
  • google
  • ingest
  • io
  • next.js
  • pdfminer
  • pydantic
  • pytest
  • python
  • rank
  • recharts
  • reciprocal
  • render
  • rest
  • rrf
  • text
  • typescript
  • uvicorn
  • vercel
  • vertex
Share this project:

Updates

Submission history