Rfactory Labs: Setting up your AI

Members · 03

Setting up your AI

The first of three short setup pieces. Which kind of AI agent you need, how to get it running on your own computer, and the one habit that makes it both cheaper and better: an expensive model that thinks, cheaper models that do.

Which AI, and why the kind matters

There are two kinds of AI product. A chat window, where you paste things in and copy answers out. And an agent, which runs on your computer and can read your files, write new ones, and run commands. For building a factory you want the second kind. The agent is the thing that will write code, run a backtest, read the result and come back to you with a view, all without you touching a keyboard in between.

We use Claude Code from Anthropic. OpenAI's Codex is the same idea, and there are others. The choice of vendor matters less than the choice of kind: pick an agent, not a chat box.

On paying for it: buy a subscription to one of the main labs, Claude or OpenAI, rather than paying per use through their developer interfaces. The subscriptions are heavily subsidised and, for the amount of work an agent does in a day, very good value. We use both, but for this project most of the work has run on a Claude subscription. The plan that tends to fit this workload is the $100 a month tier with five times the usage of the basic plan (at the time of writing, Anthropic calls it Max 5x). Start on the basic plan, and move up when you find yourself waiting for the usage limit to reset.

Getting it running

The setup is smaller than it sounds. Install the agent following the vendor's instructions; it takes a few minutes. Create a working folder on your computer, something like a folder called my-factory, and open a terminal window inside it. That folder becomes the agent's whole world: everything it builds lands there.

Start a session with a strong model. At the time of writing that means Claude Fable 5.1 on the Anthropic side or OpenAI's Astra 6. Then tell it what you are building, in plain language. The orientation page is a perfectly good brief: a portfolio of small trading systems on a shared foundation, an allocator, a market regime reader, with strict testing rules. Ask it to write that down as a plan file before it writes any code. A written plan is what keeps a long project pointed in one direction across many sessions.

Also give it a short rules file it reads every session. Ours contains things like: never switch off trading costs, never let a system peek at future data, every piece of shared code needs tests, and every backtest goes through one runner so the result is recorded. Rules in a file survive; rules said once in a chat do not.

One architect, many hands

The strongest models are expensive and slow. The trick that makes daily use affordable is to let the strong model act as the architect, planning and reviewing, while it hands most of the actual work to subagents running on cheaper models such as Opus or Sol. You say this once, in the rules file, and the agent does it routinely.

YOU the brief THE ARCHITECT strong model · plans, decides, reviews, talks to you expensive, used sparingly senior coder the tricky, correctness-critical parts implementation coder new systems from the template, plumbing test engineer writes the tests that would catch a silent bug reviewer independent second opinion before anything merges the hands: cheaper models, doing most of the work, reporting back to the architect
The division of labour. The architect is the expensive model you talk to. The hands are cheaper models doing most of the typing, each with one job.

Our four hands, each defined in a short file the agent reads: a senior coder for the parts where a subtle mistake would quietly corrupt every backtest; an implementation coder for routine work that follows an existing pattern, like a new system built from the template; a test engineer whose only job is to write the tests that would catch a silent bug; and a reviewer that gets no context from the author and reads the work cold, looking for the mistakes quant code is famous for. The reviewer is the one people skip. Do not skip it.

Next: setting up QuantConnect. The account, the minimum you actually need to pay for, and the two tools to install.