Back to Portfolio

2025 · Founding Software Engineer

Alpha Grove Strategies

Alpha Grove Strategies is a platform designed to modernize political research by using a specialized sentiment analysis pipeline to ingest and analyze political data from multiple sources in real-time, achieving 94% accuracy and enabling analysts to identify trends ahead of mainstream coverage.

Next.jsAI/MLPostgreSQLTypescript

Alpha Grove Strategies — Qualitative social and political research powered by conversational AI.

Overview

Alpha Grove explores how AI can be used to collect, analyze, and model social behavior — with an initial focus on political trends and public opinion.

Opinion data is gathered via primary-source research at scale using our home-grown conversational AI platform, AGS-1 .

Landing site + app integration

The marketing site served as the first impression and primary entry point into the AGS-1 demo. A key requirement was making the landing site (built in Webflow) and the application (built in Next.js) feel like one cohesive product, especially across domain boundaries.

Managing session persistence (Webflow → Next.js)

Because users could enter the AGS-1 demo from nearly any page, I preserved “where they came from” so the app could render accurate back links and avoid dropping users onto a generic home page.

  • Captured the current marketing URL in Webflow
  • Base64-encoded it (small payload, safe in a query string)
  • Appended it as a session param on links into the app
// Webflow custom code (conceptual)
const currentUrl = window.location.href;
const encodedUrl = btoa(currentUrl);

const url = new URL(button.dataset.href);
url.searchParams.set("session", encodedUrl);

button.href = url.toString();

I chose a URL param over session storage because the data volume was tiny and cross-subdomain/session behavior can be inconsistent across browsers.

On the Next.js side, the app decoded the parameter (when present) and hydrated navigation state accordingly:

// AGS-1 (Next.js)
import { useSearchParams } from "next/navigation";

const searchParams = useSearchParams();
const sessionParam = searchParams.get("session");

const defaultBackUrl = "https://www.alpha-grove.com";

let backUrl = defaultBackUrl;
if (sessionParam) {
	try {
		backUrl = atob(sessionParam);
	} catch {
		backUrl = defaultBackUrl;
	}
}

Post-demo personalization (legacy v1 → v2)

The v1 demo began with voice-only onboarding and captured a user’s name to personalize the conversation context. While v2 moved to a more traditional chat UX, a remnant of the personalization flow remained on the Webflow side: a post-demo landing page that could hydrate “thank you” UI based on a base64-encoded demo parameter.

  • Encoded a single user-provided string ( demo ) as base64
  • Decoded and normalized capitalization before hydration
  • Replaced any element marked with demo="true"
// Webflow custom code (conceptual)
function toProperCase(str) {
	return str.replace(/\w\S*/g, (txt) =>
		txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(),
	);
}

const demoParam = new URLSearchParams(window.location.search).get("demo");
if (demoParam) {
	try {
		const decoded = atob(demoParam);
		const formatted = toProperCase(decoded);

		document.querySelectorAll('[demo="true"]').forEach((el) => {
			el.innerHTML = `${formatted} —<br><span class="font-opacity-low">thank you for trying AGS-1.</span>`;
		});
	} catch (e) {
		console.error("Error decoding demo param", e);
	}
}

AGS-1 application (real-time conversational AI)

AGS-1 is a real-time conversational AI platform built for low latency and global availability.

Architecture

  • Frontend : Next.js application responsible for UI, user/session state, and routing across chat/voice experiences.
  • Backend : Express.js service that manages orchestration, tool routing, and conversation memory.
  • Transport : WebSocket-based realtime link between client and backend for streaming messages and low-latency interaction.

Edge deployment + stateful sessions

To get edge latency without giving up state, the backend ran on Cloudflare Workers with Durable Objects :

  • Edge-first request handling close to the user
  • Per-conversation state and memory stored in Durable Objects
  • Horizontally scalable concurrency with predictable session affinity This made it possible to handle extremely high concurrent conversation counts (chat or voice) with negligible latency, while keeping conversation memory consistent.

Multi-model orchestration (demo)

The AGS-1 demo used multiple model providers, selected by domain fit:

  • xAI Grok for real-time retrieval
  • Anthropic Claude for language understanding and response quality
  • Google Gemini for conversation analysis + embedding generation
  • ElevenLabs for voice

Conversation analysis (current focus)

A major ongoing area of development was conversation analysis : extracting structured beliefs/opinions from natural language and producing semantic knowledge graphs.

  • Generate nodes/edges representing stated beliefs and causal claims
  • Attach embeddings to graph entities to enable similarity search and clustering
  • Query across users to find uncommon correlations and latent drivers behind opinion patterns

Links