Now in public betav0.11.0

Having trouble doing >5 tool calls in a row?

Consistently chain together tool calls by helping your AI agents memorize execution-proven code.

Make vertical AI agents more consistent with code

Drop custom tools, go from 80% to 99% by only running code your agent generated that previously satisfied users.

UserQueriesRaysurferResurfacesHigh Scored CodeYour CodingAgentRaysurferCode Scorer
code_results = raysurfer.search("Generate quarterly report CSV")
# LLM agent runs code_results & returns results to user
raysurfer.upload(code, logs, query)

How Code Scoring Works

Raysurfer surfaces the best code LLMs need, the moment they need it.

Inputs

User Queries
Generated Code
Execution Logs
Similar Previous User Queries
RaysurferUser Satisfaction Scoring
Upvote
Downvote

Managed Codegen vs Tool Calling

LLM agents repeat the same patterns constantly. Raysurfer retrieves proven code and runs it with new inputs—no regeneration needed.

Claude Agent SDK
180.4s
Init (0.3s)
LLM calls (3s each × 16)
Tool results (0.4s each × 10)
Compacting (2s each × 2)
Parallel subagents (30s each × 4)
30xfaster
RaysurferRaysurfer
6.0s
Init (0.3s)
LLM call (3s)
Cache hit (1s)
Execute cached code (1.7s)
Claude Agent SDK180 seconds
INIT
Raysurfer Agent6 seconds
INIT
{
  "user": "Update our Q3 revenue ($1.02B) in the quarterly report and sync it with the investor deck."
}
LLM CALL
Understanding task: update Q3 revenue in report and deck.
Searching for cached solution...
CACHE HIT
> Match: update_financials_and_sync.py
> Similarity: 0.96 | Verdict: +52 | Runs: 8,431
EXECUTING
> Running cached code with params:
  revenue=$1.02B, files=[report, deck, board, briefing, config, warehouse]
COMPLETE
✓ Updated all 6 files and synced systems in 6s
[
]done
Claude Agent SDK: 180sRaysurfer: 6sSpeedup: 30x

Your code is your moat

For LLMs that generate code and execute it live-cache what works, skip what doesn't.

Code files generated by LLMs are cached. Retrieve and run proven code instead of regenerating.

Learn from History

Track which code executions succeeded or failed. Future agents retrieve successful code and avoid patterns that didn't work.

Low Variance Outputs

B2B vertical AI code is predictable. The same report generator, the same API client-perfect for caching and reuse.

Two calls. That's the whole API.

.search() to retrieve cached snippets. .upload() to cache new ones.

01

Search by task description

Call .search() with a natural language query. Hybrid search finds the most relevant cached code from prior agent runs.

02

Upload what works

Call .upload() with the task, file, and result. Raysurfer indexes it with semantic embeddings for future retrieval.

03

Vote on results

Code that works gets thumbs up, code that fails gets thumbs down. Verdict-aware scoring improves retrieval over time.

agent.py
from raysurfer import AsyncRaySurfer

rs = AsyncRaySurfer()

# Retrieve cached snippets
results = await rs.search("Update quarterly report")

# Cache new code after execution
await rs.upload(task, file, succeeded)

Also available as a drop-in replacement for Claude Agent SDK that handles caching automatically via RaysurferClient.

The Problem

The Token-Industrial Complex

Why are we all paying to regenerate the same tokens?

The Current Reality

Every time your agent runs, you wait for tokens to generate. The same patterns. The same outputs. Every. Single. Time.

You're paying for tokens. You're waiting for generation. For code that's already been generated somewhere else.

The Raysurfer Way

Raysurfer retrieves and runs proven code from previous executions. No waiting. No regenerating. Just execute.

Stop watching your agent think. Get instant results from code that already works.

1
Tool call to paste any output
~30x
Faster than regenerating
1x
Generate once, paste forever

Perfect for long-running tasks: Dynamic code generation becomes trivial when your generated code is already context-managed. No more iteration loops. No more regeneration cycles. The code exists, it's been validated, it just needs to be executed.

“More tokens output causes a decrease in accuracy causes even more token output.”

Break the cycle. The median LLM agent activity for B2B SaaS is surprisingly low variance. Everything eventually viewed by a human is just HTML, PDF, or docs.

ReduceReuseCache code

Code Reputation Management

Track the user satisfaction rate of running different pieces of code

Code Snippet Search

Estimate from the code and logs what user queries this code would best solve

Simple API

.search() and .upload() — two calls, that's it

Frequently Asked Questions

Code files generated by LLMs during agent execution. When your agent writes a Python script, a data processor, or any executable code—that's what gets cached. Outputs (like generated PDFs or API responses) are not cached, only the code that produces them.
Code execution only. Raysurfer is designed for LLMs that generate code and run it live (like Claude Agent SDK). We don't cache tool call sequences—we cache the actual code files your agent writes and executes.
raysurfer.search() returns relevant code snippets along with metadata: how many times each has been run, and thumbs up/down scores from prior executions. Agents can assess relevance based on descriptive filenames and task similarity—just like how Claude ignores irrelevant files after an ls command.
The agent sees cached code as a starting point, not a mandate, and Claude Code running on Opus 4.6 typically ignores well-named files even when an `ls` returns a very large directory. In practice, extra files usually only cost a couple of tokens and don't affect the final output.
LLMs assess each cached code block and determine how it should be retrieved in the future—what task descriptions it matches, what keywords apply. This semantic indexing means future agents find relevant code even when their task is phrased differently.
Yes! The low-level API (RaySurfer client) works with any LLM or agent framework. Use .search() to retrieve code, and .upload() to cache new code after execution.

Start caching your agent's code today

Free tier includes 500 API requests. No credit card required.