AI-assisted teammate discovery for hackathons. The app turns a free-form request into ranked builder matches, complete with transparent agent reasoning and pgvector-backed retrieval.
- Planner → executor → evaluator agents coordinate through
lib/agents/orchestrator.ts, producing structured telemetry for every request. - Vector search + metadata filters run against Postgres via Drizzle ORM with
pgvectorembeddings managed bylib/ai/embeddings.ts. - React 19 / Next.js 16 front-end in
app/page.tsxrenders rich result cards, agent reasoning timelines, and benchmark snapshots. - Observable pipeline with persisted logs (
search_logs,search_traces) and per-phase latency metrics to track precision/recall over time.
- The user submits a teammate brief from the UI (
app/page.tsx). POST /api/searchvalidates the payload with Zod and delegates to the orchestrator.lib/agents/planner.ts(GPT-4.1 mini) normalizes roles, skills, interests, and constructs a capped four-step search plan.lib/agents/executor.tsembeds the requirement, runs multi-pass pgvector retrieval, and annotates candidates with provenance.lib/agents/evaluator.ts(GPT-4.1) blends similarity, deterministic scores, and LLM grading to rank candidates and suggest refinements.lib/agents/orchestrator.tsstitches results, metrics, and reasoning logs, persists them via Drizzle, and returns{ success, data }.
app/– Next.js app router, global styles, and API route.lib/agents/– Planner, executor, evaluator, and orchestrator logic.lib/ai/– OpenRouter provider wrapper plus embedding helpers.lib/db/– Drizzle schema (builder_profiles,search_logs,search_traces,search_metrics) and Postgres client.scripts/– Data seeding (seed.ts), combined setup with embeddings (setup-data.ts), and Windowsinstall-pgvector.ps1.docs/– Project status notes and architecture summaries.
- Node.js 18.18 or later.
- PostgreSQL 15+ with the
pgvectorextension enabled. - OpenRouter API access (
OPENROUTER_API_KEY). - Recommended: PowerShell 7 for scripting (commands below target Windows PowerShell).
-
Install dependencies
npm install
-
Copy environment template
Copy-Item .env.example .env -
Update
.env- Set
OPENROUTER_API_KEY. - Set
DATABASE_URL(Postgres connection string withpgvectorenabled). - Optionally override planner/evaluator/embedding models or OpenRouter headers.
- Set
-
Install pgvector (Windows helper)
-
Download pgvector build artifacts into
%TEMP%\pgvector. -
Run PowerShell as Administrator:
.\install-pgvector.ps1 -
In Postgres, enable the extension:
CREATE EXTENSION IF NOT EXISTS vector;
-
-
Apply database schema
npm run db:push
-
Seed demo data and generate embeddings
npm run db:setup
(This seeds 50 builder profiles and batches OpenRouter embeddings.)
-
Start the dev server
npm run dev
-
Visit
http://localhost:3000, describe your ideal teammate, and review the ranked results plus agent reasoning stream.
-
Install system dependencies
brew install node@20 brew install postgresql@16 brew install pgvector brew services start postgresql@16
-
Install project dependencies
npm install
-
Copy environment template
cp .env.example .env
-
Update
.env- Set
OPENROUTER_API_KEY. - Set
DATABASE_URL(local Postgres connection string; e.g.postgres://postgres:postgres@localhost:5432/devmate). - Optionally override planner/evaluator/embedding models or OpenRouter headers.
- Set
-
Create the local database (if needed) and enable pgvector
createdb devmate psql -d devmate -c "CREATE EXTENSION IF NOT EXISTS vector;"
(Replace
devmatewith the database named inDATABASE_URL; if the database already exists you can ignore thecreatedberror.) -
Apply database schema
npm run db:push
-
Seed demo data and generate embeddings
npm run db:setup
-
Start the dev server
npm run dev
-
Visit
http://localhost:3000, describe your ideal teammate, and review the ranked results plus agent reasoning stream.
npm run db:generate– Create Drizzle migrations from the current schema.npm run db:migrate– Apply generated migrations.npm run db:push– Push schema without generating migrations (recommended for local setup).npm run db:seed– Insert synthetic builder profiles (no embeddings).npm run db:setup– Seed profiles and compute embeddings in one go.npm run db:studio– Launch the Drizzle Studio explorer.npm run lint– Run Next.js ESLint checks.
- Search responses include per-phase metrics (
planner,executor,evaluator,refinement) and a reasoning log for debugging. search_logscaptures the normalized requirement, scores, and latency for each request;search_tracesstores the planner plan plus reasoning for later analytics.- UI benchmark cards compare the latest precision/recall snapshot against the previous run using client-side metrics.
docs/progress-report.mdtracks roadmap items, known gaps, and future optimizations.
- Absolute imports (
@/*) are configured intsconfig.json. - Tailwind CSS v4 powers the UI via
app/globals.css; no additional CSS framework setup required. - All agent prompts and model ids are centralized in
lib/agents/*andlib/ai/embeddings.tsfor quick iteration.