Skip to content

RAG Semantic Search Exists in Code But Has No API/UI Integration #25

Description

@krishnasahoo11156

embedEmail() and searchSimilarEmails() are implemented in ai.service.ts and test-embeddings.ts,
but there is NO way for users to actually use semantic search. The search bar falls back to PostgreSQL
ILIKE pattern matching.

Steps to Reproduce:

  1. Open frontend inbox
  2. Type “DBMS project deadline” in search
  3. Observe: only exact/partial text matches returned, not semantically similar emails

Expected Behavior:
Search should use pgvector cosine similarity to find emails with related meaning even if keywords don’t
match exactly.

Fix Required:
• Expose POST /api/rag/search endpoint
• Add semantic search toggle to frontend search bar
• Ensure pgvector extension is enabled
• Background job to index historical emails

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions