Architecture

Five agents, one source-grounded workflow.

SchemeSeva is a TypeScript-native civic AI app built on Mastra-style orchestration, Qdrant retrieval and memory, Gemini embeddings, Featherless AI reasoning, OpenAI/OpenRouter fallback, Enkrypt validation, Langfuse tracing, and Upstash rate limiting. The core report path is simple: Qdrant retrieves, Featherless reasons, and Enkrypt validates before display.

Judge verification

How to verify the mandatory stack

Mastra

Look for workflow mode adapter and the five typed agents in this page.

Qdrant retrieval

Run the Farmer demo and confirm Retrieval: qdrant-vector.

Featherless AI

Confirm Reasoning: featherless when Featherless is configured.

Qdrant memory

Confirm Memory: qdrant and Memory write: success after a report.

Enkrypt AI

Confirm Safety: enkrypt on reports and Vigilance alerts.

Collections

schemeseva_schemes, citizen_sessions, and pending_alerts.

Debug proof

Open /debug/integrations for live provider status without secrets.

Pipeline

How a request moves through the system

1

Profile

Structure citizen details

2

Discovery

Retrieve candidate schemes

3

Eligibility

Check rules

4

Report

Explain likely matches

5

Safety

Validate output

6

Vigilance

Watch for new matches

Stack

The production proof points

Frontend

TanStack Start (React 19) + Tailwind v4

Landing page, agent runner, report view, scheme catalog, and alert banner.

Orchestration

Mastra-style TypeScript workflow

Chains five agents through typed server functions that are testable in isolation.

Reasoning

Featherless AI + OpenAI/OpenRouter fallback

Featherless powers open-source model reasoning for reports and Vigilance alert reasons; OpenAI, OpenRouter, and local grounded logic remain fallbacks.

Embeddings

Google Gemini embeddings

Semantic vectors for Qdrant retrieval when GEMINI_API_KEY is configured.

Retrieval

Qdrant + local catalog fallback

Verified schemes indexed with eligibility rules, keywords, and metadata.

Memory

Qdrant citizen_sessions + local fallback

Citizen profile and found schemes persisted by browser-generated session key.

Safety

Enkrypt AI + fallback validator

Citizen-facing reports and Vigilance alerts checked before display.

Operations

Langfuse + Upstash + Vercel

Tracing, rate limiting, and deployed hackathon runtime.

Agents

What each agent contributes

  1. 1. Profile Agent

    structure

    Extracts state, age, gender, category, income, occupation, land, disability, and other profile facts from guided or plain-language input.

  2. 2. Discovery Agent

    retrieve

    Searches the 28-scheme Central + Telangana catalog through Qdrant retrieval or local fallback.

  3. 3. Eligibility Agent

    evaluate

    Checks deterministic rules such as age, gender, category, income cap, occupation, state, Aadhaar status, and bank account status.

  4. 4. Report Agent

    explain

    Creates a simple source-grounded report that uses likely eligible language and includes documents, steps, sourceUrl, and lastVerified.

  5. 5. Vigilance Agent

    watch

    Scans saved profiles against unseen schemes and creates proactive alerts when a new likely match appears.

Guardrails

Honest fallback behavior

Retrieval

Qdrant is primary; local catalog fallback keeps the demo runnable.

Memory

Qdrant memory is primary; local session fallback is visible in badges.

Safety

Enkrypt validates outputs; fallback status stays honest when needed.

Operations

Langfuse and Upstash signals are inspectable on the debug page.