A recursive AI research workflow powered by Claude, Exa search, and Inngest durable step functions. Research sessions persist in Neon (PostgreSQL) and new research builds on past findings using pgvector semantic search.
npm install
Create a new project at console.neon.tech and copy your connection string.
Execute schema.sql against your Neon database. You can do this from the Neon SQL Editor in the console, or via psql:
psql "postgresql://user:password@your-host.neon.tech/neondb" -f schema.sql
Update .env.local with your actual values:
EXA_API_KEY=your-exa-api-key
ANTHROPIC_API_KEY=your-anthropic-api-key
DATABASE_URL=postgresql://user:password@your-host.neon.tech/neondb
OPENAI_API_KEY=your-openai-api-key
DATABASE_URL - from your Neon project dashboardOPENAI_API_KEY - used for text-embedding-3-small embeddings (pgvector semantic search)npm run dev
Open http://localhost:3000.
src/
app/
page.tsx Main UI
api/research/
route.ts Durable research endpoint
events/route.ts Polling endpoint for progress events
clarify/route.ts Clarification questions endpoint
history/route.ts Past sessions endpoint
inngest/
event-store.ts Neon-backed event store (replaces in-memory)
deep-research.ts Recursive research algorithm with persist steps
llm.ts Claude integration (queries, learnings, report)
search.ts Exa search integration
types.ts Shared type definitions
lib/
db.ts Neon client
embeddings.ts OpenAI embedding utilities
hooks/
useResearch.ts Client state management and polling
components/
TopicInput.tsx Topic form + past sessions list
ResearchProgress.tsx Progress view with prior knowledge indicator
ExecutionLog.tsx Real-time execution log
...
schema.sql Database schema (sessions, events, sources, learnings)