Status: production‑ready architecture and pilot for a local services marketplace that was later shelved for business reasons (not live today).

Turn vague user searches into conversions in under 100ms.

Slake designs and ships search systems that cut "zero-result" screens, keep responses under 100ms, and reduce infra spend. This production-ready architecture designed for ScoutLocal's marketplace use case, validated in pilot runs on real ScoutLocal data.

Validated in pilot runs on real ScoutLocal data
Start Infrastructure Audit ($500) See ScoutLocal Architecture
Next.js 15 NestJS PostgreSQL Azure OpenAI Clerk
At a Glance:
  • Validated hybrid semantic + SQL search for messy queries
  • Designed geospatial fetching that cuts wasted map requests
  • Implemented polymorphic schema + optimistic UI patterns
  • Integrated Clerk for production-ready identity, ensuring merchant roles remained securely isolated during pilot runs.

Built For

SaaS Product Teams

Needing faster search/recommendations without hiring a full-time specialist, so users find what they need in 1 - 2 taps.

Marketplaces

Dealing with overlapping entities (merchants, events) and heavy read-traffic.

Scaling Startups

Trying to scale past MVP without letting technical debt in search crush your velocity.

The Transformation

The Context: ScoutLocal needed users to find the right venue in 1 - 2 taps, from vague queries like "vibey coffee spot," without hiring a full-time search team or blowing up infra costs.

Pilot Outcome: In an early semantic search pilot, we validated the architecture and ranking approach on real ScoutLocal data, proving it handled messy natural-language queries more reliably than the SQL baseline.

The Friction

Standard SQL search fails on semantic queries. Users don't search for "Category: Coffee"; they search for "espresso near me".

The Risk

Retaining user engagement on mobile requires sub-100ms interaction times. Standard "Load -> Wait -> Render" patterns cause bounce rates to spike.

Hybrid Architecture

The solution is a Hybrid Search Engine that combines the semantic power of Vector Search (Azure OpenAI) with the precision of SQL filters.

1. User Intent "Vibey coffee" → Vector Embedding
2. Semantic Match pgvector finds nearest neighbors
3. SQL Validate Prisma filters by location/hours

Result: In an early pilot, we validated that users got relevant results from messy queries, while the internal tooling kept strict control over filters, joins, and analytics.

Efficiency Strategy

The Problem: Mobile maps typically drain battery and spike API costs by fetching data on every micro-movement.

Infrastructure Protection

  • Validated API Cost Control: Scroll and pan events are debounced and bundled, proving that accidental jitter won't hammer APIs at scale.

Universal Access

  • Device Agnostic: Targets 60fps scrolling performance on low-bandwidth networks, maximizing the addressable market.

Result: The architecture was designed and tested to lower map-related API costs and ensure smoother scrolling on mid-range devices once deployed.

Enterprise Data Modeling

In the real world, entities rarely fit into neat boxes. A "Coffee Shop" might also be a "Coffee Roaster" (Maker). Instead of creating three separate accounts, we implemented a Polymorphic Schema.

Why this matters for scaling: Identity was managed via Clerk, decoupling user authentication from the polymorphic merchant schema to reduce architectural debt. This unified identity means you upload a product once and surface it across locations, brands, and events, without duplicate records.

UX Engineering: Optimistic State

Performance isn't just about server response times; it's about Perceived Latency. The solution employs an Optimistic UI pattern for high-frequency user actions.

The Strategy:
  • 1. UI updates instantly (0ms) when user clicks.
  • 2. API request processes in the background.
  • 3. If sync fails, UI self-heals automatically.

This keeps the interface feeling instant even when APIs are under load.

Implementation Spotlight

Below are the patterns used to keep vectors and entities in sync, avoiding "ghost" records and race conditions.

1. Backend: Atomic Integrity

api/embeddings/sync.service.ts

await prisma.$transaction(async (tx) => {
    // 1. Reserve Entity ID (Atomic)
    const record = await tx.embedding.create({ ... });

    // 2. External Vector Gen (Rollback on Fail)
    const vector = await openai.embeddings.create({ input: text });

    await tx.embedding.update({ ... });
});

2. Frontend: Optimistic UI

hooks/useSavedItems.ts

const toggleSave = useCallback(async (id) => {
    // 1. Zero Latency Update
    setSavedIds((prev) => new Set(prev).add(id));

    try {
        await api.post(`/user/saved/${id}`);
    } catch (err) {
        // 2. Self-Healing Rollback
        setSavedIds((prev) => { ... });
        toast.error("Sync failed");
    }
}, []);

3. Identity: Clerk Auth Guard

app/api/search/route.ts

export async function POST(req: Request) {
  const { userId } = auth(); // Clerk Identity
  if (!userId) return new Response("Unauthorized", { status: 401 });
  
  // Proceed with secure search/sync
  // Merchant isolation is enforced by userId
}

Want this level of engineering on your product?

Work With Slake

Infrastructure Audit

A 45-60 minute deep dive into your technical architecture and data flow. Credit Applied: The $500 fee is credited toward any follow-on build.

  • Architecture Audit
  • Bottleneck Identification

Good fit if you already have a live product and real users searching, even if the current search is basic.

Start Infrastructure Audit ($500)

Capital Sprint

$4,000 – $8,000 / Fixed

A focused 2-4 week build to deploy one production-ready system wired into your live tools. You leave with a concrete system upgrade.

  • One critical workflow mapped
  • Focused changes implemented
  • Simple checks/logs added

Limited to 2 Focused Fixes per month to ensure hands-on work.

Request Capital Sprint