---
title: "My agent cloned GitHub (sort of) using the Neon backend"
description: "neon-git is an agent-built Git server that stores every Git object (blobs, trees, commits) as Postgres rows, offloads large blobs to Neon Object Storage, and serves Git Smart HTTP from a single stateless Neon Function."
url: "https://swe.quest/articles/my-agent-cloned-github-sort-of-using-the-neon-backend-eab82f7635fe923a"
canonical: "https://neon.com/blog/my-agent-cloned-github-using-the-neon-backend"
source: "Neon"
published: "2026-07-23"
difficulty: "medium"
kind: "Case study"
reading_minutes: 4
tags: ["serverless","postgres","version-control","ai-coding","javascript"]
---

# My agent cloned GitHub (sort of) using the Neon backend

A post on [Neon](https://swe.quest/sources/neon.md), published 2026-07-23, 4 min read, Case study. Original: [https://neon.com/blog/my-agent-cloned-github-using-the-neon-backend](https://neon.com/blog/my-agent-cloned-github-using-the-neon-backend)

## Summary

neon-git is an agent-built Git server that stores every Git object (blobs, trees, commits) as Postgres rows, offloads large blobs to Neon Object Storage, and serves Git Smart HTTP from a single stateless Neon Function. Each request rehydrates a minimal in-memory .git via memfs from Postgres. Push parses the packfile into rows and updates refs with a transactional compare-and-swap, while clone repacks objects in memory and streams them back. The pack protocol runs in pure JavaScript by reusing isomorphic-git internals. SSH was dropped because serverless has no always-on TCP listener, and auth uses Neon Auth JWTs sent as HTTP Basic passwords or cookies.

Written by swe.quest, not by the author.

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

## Topics

- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Version control](https://swe.quest/tags/version-control.md) (Engineering practices)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)

## Prerequisites

- Git object model
- serverless functions ([easy posts on Serverless](https://swe.quest/tags/serverless.md?difficulty=easy))
- PostgreSQL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))

## Keywords

Neon, Neon Functions, Git Smart HTTP, isomorphic-git, Hono, memfs, Neon Auth

## Related posts

- [Inside a Kylon room, where people and agents build apps on Neon](https://swe.quest/articles/inside-a-kylon-room-where-people-and-agents-build-apps-on-neon-7c02cd9384e86f37.md): Neon · 2026-11-04 · Easy · 5 min read · PostgreSQL, AI agents, Multi-tenancy, Serverless, Schema migrations
  Kylon, a shared workspace where teams and AI agents build internal apps like CRMs and invoice trackers, maps its product directly onto Neon resources: one Neon project per workspace, one database per app, and one branch per draft.
- [Branching Postgres databases with the Neon API](https://swe.quest/articles/branching-postgres-databases-with-the-neon-api-3faf0de941bc811a.md): Neon · 2022-12-07 · Medium · 3 min read · PostgreSQL, CI/CD, Testing
  Neon branches are copy-on-write clones of a Postgres database that can be created and deleted through the Neon API, giving CI pipelines an isolated copy of production data for end-to-end tests.
- [Just landed in the Neon CLI](https://swe.quest/articles/just-landed-in-the-neon-cli-10a12bf3c6b45d1f.md): Neon · 2026-08-25 · Medium · 6 min read · Developer tools, PostgreSQL, AI agents, Schema migrations
  The Neon CLI is renamed from neonctl to neon (old name kept as an alias) and gains a branch-first workflow built on \`neon link\`, \`neon checkout\` and \`neon env pull\`, which store project/branch context in a local .neon file and rewrite only Neon-managed env vars.
- [Neon Functions: backend logic next to your data](https://swe.quest/articles/neon-functions-backend-logic-next-to-your-data-fe00336dce0040ff.md): Neon · 2026-08-12 · Medium · 5 min read · Serverless, PostgreSQL, Real-time systems
  Neon Functions are long-running Node.js 24 compute deployed onto a Neon branch, in the same region and on the same infrastructure as its Lakebase Postgres database, with DATABASE\_URL and other Neon backend credentials injected automatically.
- [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.

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)
