How Castform + Neon Beats Frontier Models on Price and Efficiency - Neon<br>Neon now has per-project permissions: give agents and developers exactly the right access
Discord22.8k<br>Log inSign up
Back to Blog/Product<br>How Castform + Neon Beats Frontier Models on Price and Efficiency<br>A 4B open-source model post-trained with Castform retrieved search results as accurately as GPT-5.6 Sol, while costing 100x less<br>Pranav Aurora, Ying Hang Seah, Angel Pan
Aug 05, 2026
Subscribe to our changelog<br>Receive only our latest updates. No spam, guaranteed.
Subscribe
“Most teams' best training data is just sitting in their databases. The problem is that turning raw data into something usable is hard, and letting agents read, search, and mutate data cheaply at scale requires advanced infra. Pointing Castform at Neon skips both.”<br>Ying Hang Seah, cofounder, Castform
A "good agent" needs to be strong in 2 areas:
Context : can we provide the tools to find the right data?
Model : can the model decide what to search for?
Neon (Lakebase Postgres) and their new Search extensions solve the first; Castform solves the second.
Evolution of agentic search
In ~2022, the industry was going all in on embedding search. Every database provider added one, and pgvector was Neon's most downloaded extension. To provide context to LLMs, engineers handcrafted RAG pipelines, which in essence, is some form of embedding similarity search.
In ~2025, agents started to gain more traction. Developers started creating multi-hop search workflows, decomposing big problems into smaller ones. Retrieval has shifted from the one-shot search systems to agentic retrieval. Instead of issuing a single query, models plan and search multiple times in a loop. Every loop iteration meant another call to the frontier model, increasing the overall cost and latency per user request.
Concretely, a typical multi-turn search request with gpt-5.6-sol takes >10s and costs ~$0.03 end-to-end, making it prohibitively slow and expensive.
Meanwhile, small open-weights models are 100x cheaper. But, out of the box, their capabilities lag behind closed api models. RL post-training helps bridge this gap. On specific tasks like search, post-trained open-source models can match & beat frontier models while costing orders of magnitude less per request.
That is why we built Castform: to enable developers to RL post-train models without having to deal with machine learning & gpu internals. The goal's to make post-training as approachable as prompt engineering.
How does Castform use Neon?
Castform's pipeline runs against Neon via Lakebase Search:
StageNeon + Lakebase SearchCorpus storageRaw documents live in Postgres on NeonSynthetic data generationCastform training pipeline uses lakebase_text and lakebase_vector to write training tasksRL TrainingEvery rollout's search tool call uses Lakebase Search on NeonProduction InferenceThe final model uses the same search tool call during inference
Your best training data already exists
To perform RL post-training effectively, you need a task (e.g. answer a user's question), the environment for the agent to run in (e.g. a search tool for your corpus) and a reward function (e.g. is the answer correct?).
With all 3 pieces in place, the RL post-training is a loop of trial and error: the model attempts the task given the tools, the reward function scores the attempt, and the feedback signal guides the model on how to hill-climb its way to optimal performance.
Yet, most companies do not have a clean dataset of tasks and reward functions ready for post-training.
Enterprises do have a large set of proprietary data:
internal documentation
product records
support articles
customer interactions
wikis
operational databases
This data contains the knowledge an agent needs, but turning it into an effective training dataset normally requires substantial data engineering and manual labeling.
That leads many teams to dismiss post-training for one of two reasons:
"We don't have the training data."
"Fine-tuning is too difficult and requires infrastructure we don't have."
Castform addresses both. It turns an existing corpus into training tasks, then manages the RL loop needed to teach an open-source model how to use that data effectively.
Using Castform
With Castform, you can turn your company knowledge base into a model:
Document (from your data): Trains booked through Navan will be paid by GitLab travel card. Train rides must be standard cabin class with 14 day booking lead time
Ground truth (inferred from your data): Train rides must be standard cabin class with a 14 day booking lead time.
Question (synthetically generated): When booking a rail trip in Navan, what are the rules for how early I need to reserve it and which seating level I'm expected to choose?
With the generated question-answer dataset, Castform lets you scaffold the training run by specifying the tools the agent has access to and a reward function.
The reward function...