---
title: "Building a Deep Research Agent with Neon and Durable Endpoints"
description: "A recursive deep research agent built on Neon Postgres with pgvector, Inngest durable endpoints, Claude, Exa search and OpenAI embeddings."
url: "https://swe.quest/articles/building-a-deep-research-agent-with-neon-and-durable-endpoints-ef580145e6461602"
canonical: "https://neon.com/blog/building-a-deep-research-agent-with-neon-and-durable-endpoints"
source: "Neon"
published: "2026-02-24"
difficulty: "medium"
kind: "How-to"
reading_minutes: 12
tags: ["ai-agents","postgres","vector-search","resilience","llms"]
---

# Building a Deep Research Agent with Neon and Durable Endpoints

A post on [Neon](https://swe.quest/sources/neon.md), published 2026-02-24, 12 min read, How-to. Original: [https://neon.com/blog/building-a-deep-research-agent-with-neon-and-durable-endpoints](https://neon.com/blog/building-a-deep-research-agent-with-neon-and-durable-endpoints)

## Summary

A recursive deep research agent built on Neon Postgres with pgvector, Inngest durable endpoints, Claude, Exa search and OpenAI embeddings. Planning, search, reflection and report generation from the DeepResearcher and Step-DeepResearch papers map onto concrete LLM functions, with depth-limited recursion that halves breadth at each level. Every external call runs as a retriable, memoized Inngest step with deterministic IDs. Idempotent Postgres writes (ON CONFLICT DO NOTHING, UNIQUE constraints) make replays safe. One database holds sessions, cursor-polled progress events and embeddings, so past learnings can be recalled via cosine distance to inform new searches.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Vector search](https://swe.quest/tags/vector-search.md) (Data & databases)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- PostgreSQL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- LLM APIs and structured output ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- Next.js API routes ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- vector embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))

## Keywords

Neon, Inngest, pgvector, Claude Code, Exa, Next.js, Step-DeepResearch, DeepResearcher

## Related posts

- [Lakebase Search: the retrieval primitive for agents on Neon](https://swe.quest/articles/lakebase-search-the-retrieval-primitive-for-agents-on-neon-08857239ea4fff67.md): Neon · 2026-09-30 · Medium · 6 min read · Vector search, PostgreSQL, Search, RAG & retrieval, AI agents
  Lakebase Search adds vector and BM25 search to Lakebase Postgres through two extensions, lakebase\_vector and lakebase\_text, so agents can query operational data without a separate search system. lakebase\_vector keeps its durable index in object storage, caches hot pages in NVMe and RAM, and combines hierarchical IVF with RaBitQ quantization.
- [Neon Docs search is now built on Neon](https://swe.quest/articles/neon-docs-search-is-now-built-on-neon-6358bcc8a0cf6214.md): Neon · 2026-10-26 · Medium · 6 min read · Search, PostgreSQL, Vector search, Caching, AI agents
  Neon's docs search now runs entirely on its own stack: Lakebase Postgres with the lakebase\_vector (pgvector-compatible ANN) and lakebase\_text (BM25) extensions, a Hono API on Neon Functions, and Neon AI Gateway for embeddings and reranking.
- [Neon for Agent Platforms: A Companion Skill for the AI Agent Program](https://swe.quest/articles/neon-for-agent-platforms-a-companion-skill-for-the-ai-agent-program-6b42423040c5c41e.md): Neon · 2026-05-22 · Medium · 3 min read · PostgreSQL, Multi-tenancy, AI agents, Cloud platforms
  neon-for-agent-platforms is an open-source companion Agent Skill and set of TypeScript scripts for running fleets of Neon Postgres databases on agent platforms.
- [Building an AI-powered ChatBot using Vercel, OpenAI, and Postgres](https://swe.quest/articles/building-an-ai-powered-chatbot-using-vercel-openai-and-postgres-4fd423473384581f.md): Neon · 2023-03-09 · Medium · 13 min read · RAG & retrieval, PostgreSQL, Vector search, LLMs, Serverless
  A ChatGPT-style documentation assistant (Ask Neon) is built by storing OpenAI text-embedding-ada-002 vectors in Postgres with pgvector, retrieving context by cosine distance, and feeding it to text-davinci-003 from a Vercel Edge Function.
- [Custom Hacker News summaries in your inbox—build an AI Agent with Inngest and Render](https://swe.quest/articles/custom-hacker-news-summaries-in-your-inbox-build-an-ai-agent-with-inngest-and-9ab4714647bce245.md): Render · 2025-01-16 · Medium · 8 min read · AI agents, Vector search, PostgreSQL, TypeScript, LLMs
  A tutorial for building an AI agent that periodically searches Hacker News for user-defined topics and questions and emails summaries.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
