如何使用图工程构建多因子Alpha模型 ✍ Roan🕐 2026-07-24📦 24.6 KB 🟢 已读 𝕏 文章列表 本文详细介绍了如何利用图工程构建对冲基金级别的多因子Alpha模型。作者阐述了从Prompt、Loop、Swarm到Graph的技术演进路径,重点介绍了Slate这一运行时工具,它能通过JavaScript编写的程序自动化执行复杂的图结构任务,解决了多智能体系统中的协调与失败处理难题。 图工程多因子模型Alpha量化交易SlateAgentAI对冲基金系统设计 # How to Use Graph Engineering to Build a Multi-Factor Alpha Model **作者**: Roan **日期**: 2026-07-06T14:11:54.000Z **来源**: [https://x.com/RohOnChain/status/2080296261576687751](https://x.com/RohOnChain/status/2080296261576687751) ---  I am going to break down exactly how to build a hedge fund grade multi-factor alpha model using graph engineering. Let's get straight to it. > Bookmark This - > I'm Roan, a backend developer working on system design, HFT-style execution, and quantitative trading systems. My work focuses on how prediction markets actually behave under load. For any suggestions, thoughtful collaborations, partnerships DMs are open. In my last article I said I would personally walk through the first 20 setups of anyone building an AI quant system and I meant it. Few builders are already deep in the process with me. The offer is still open. If you are building a graph engineering system or about to start, or even just thinking about it, reply under this article or DM me your current setup. I will personally walk through your architecture and show you the gap between what you have and a swarm that hunts alpha on its own. If I do not reply, you were not in the first 20. Move fast. Multi-factor investing is how every serious hedge fund on Wall Street generates returns. They do not trade single ideas. They stack factors. This is the same process AQR runs. The same process Two Sigma runs. The same process Bridgewater runs. And it is the first time it has been executable by a solo builder. The problem has always been that building this required a research team. Factor engineers. Statisticians. Portfolio construction specialists. Risk analysts. Execution engineers. You need at least ten people per factor family, and no solo quant can build that team. That is why retail quants stick to single strategies and hedge funds print alpha. Until now. > **Roan@RohOnChain**: [原文链接](https://x.com/RohOnChain/status/2074134246784921977) > In my last two articles I walked through loop engineering and how to build a swarm of AI agents that hunts alpha 24/7. Once you have loops and swarms, the layer that holds them together as one working system is a graph. > Graph engineering is the practice of designing that layer. You define the nodes. You define the edges. The graph runs itself. By the end of this article you will not just understand graph engineering. You will have a self-running multi-factor alpha model firing every 24 hours on your laptop. ## Part 1: What Graph Engineering Actually Is Every quant working with AI is somewhere on the same progression. Naming where you are makes it obvious where to go next.  What Graph Engineering Actually Is > Stage 1: Prompts. You type a prompt. You wait. You read the output. You type the next one. You are the loop. Nothing survives when you close the laptop. > Stage 2: Loops. You write a script that wraps the prompt and fires on a schedule. The loop holds state. It survives after you close the laptop. This is what my loop engineering article taught. One agent, one job, running forever. > Stage 3: Swarms. You fan the loop out into many agents with specialized roles. One generates signals. One validates them. One executes. This is what the swarm of AI agents article taught. Multiple agents in parallel, coordinated by hand through Python glue code. > Stage 4: Graphs. You describe the coordination structure once. Nodes are agents. Edges are data hand-offs. The graph knows when to parallel, when to wait, when to retry, when to escalate. You do not touch the glue code again. Graph engineering is the practice of designing that coordination structure. A graph is not a script. That distinction matters more than anyone tells you. A script breaks the moment one agent needs to wait on another. A script breaks the moment state has to persist across cycles. A script breaks the moment you want six loops in parallel on different models. Every retail quant who has tried to build a multi-agent system has hit these three walls. The failure wall broke me. When my profitability agent got blocked because it had to parse 500 balance sheets and hit rate limits, the entire pipeline died. I would come back the next morning to a stopped process, no signal, and no idea where the failure originated. Debugging meant reading a stack trace and guessing which agent was upstream of the crash. By month two I had spent more time debugging coordination than doing research. I was on the verge of shelving the whole project. That is the failure state every multi-agent quant hits. It is also the reason graphs exist. > A graph does not have those failure modes. Parallel is native. State is persistent. Failure is scoped to the node, not the pipeline. When a node breaks, the rest of the graph keeps running, and you patch the broken node by describing the failure in plain English. That is the promise of graph engineering. Now the question is what runs the graph. ## Part 2: The Tool That Runs The Graph Graphs are architectural diagrams. They do not run themselves. They need a runtime. The runtime is what most people building multi agent systems get wrong. They assume the hard part is designing the graph. It is not. The hard part is finding infrastructure that can actually execute it. I spent weeks trying different runtimes before I found one that could run a multi factor graph end to end.  The one I use is called Slate. Built by @wearerandomlabs. Runs in your terminal. Picks up your existing model subscriptions and fans out work across them. What matters for this article is a capability they shipped recently called Programs. A Program is a graph written in JavaScript that Slate runs for you continuously. A prompt runs once and stops. A Program keeps going until the task is done. You do not write the Program alone. You tell Slate what you want in plain English. Slate drafts the graph. Slate then presents you a diagram. You ask questions about the diagram. You change nodes. You adjust models. Only when you are satisfied do you tell Slate to save and run it. If it breaks, you chat with Slate about the failure. Slate patches the graph. You can find Slate at http://randomlabs.ai/rr. It is available today. The best way to feel graph engineering before you build one is to run the two example Programs that ship with Slate. > They are called /goal and /deepresearch. /goal - Graphs That Run Until Verifiably Done Type this inside Slate: ``` /goal implement a Newey-West adjusted t-statistic function in Python and verify it matches the statsmodels implementation on ten random return series ``` Slate does not fire one prompt at a model. It spins up a graph.  > One node writes the function. > Another writes the verification test. > A third runs both. > A fourth grades whether the outputs match. If they do not match, the graph loops back with the specific mismatch as feedback. It keeps going until a separate small grader model confirms the goal is done. This is the maker checker pattern in a runtime. The maker never grades the maker's own work. /deepresearch - Graphs That Parallelize Research Try this inside Slate: ``` /deepresearch what does the latest academic research say about the Fama-French five factor model out of sample performance in emerging markets from 2015 to 2026 ``` The graph that spins up here is different from /goal.  It is a parallel research fanout. Slate dispatches multiple worker agents at once. Each one owns a different angle of the question. One reads recent papers. Another checks arXiv q fin. Another pulls data from the Kenneth French library. Another cross references citations. They all report back to a central orchestrator that synthesizes the findings. The reason /deepresearch matters for this build is that it demonstrates the exact pattern you need for factor construction. Seven factor agents. Each owns a different factor. All running in parallel. All reporting to a central orchestrator. That is the multi factor graph, minus the quant specific tasks. Spend 30 minutes running /goal and /deepresearch on questions you actually care about. That is how graph engineering intuition happens.  ## Part 3: The Multi-Factor Alpha Graph Multi factor investing decomposes stock returns into systematic drivers plus a residual. The foundational version is the Fama French three factor model, published in 1993:  R_i is the return on stock i. R_f is the risk free rate. R_m is the market return. SMB is size premium. HML is value premium. The alpha α is what the model cannot explain. That residual is what you are hunting. Carhart added momentum in 1997. Fama and French added profitability (RMW) and investment (CMA) in 2015. Modern hedge funds run a seven factor stack. AQR, Two Sigma, Millennium, Bridgewater all run variants. Here are the seven factors that matter in 2026.  Factor 1: Market Beta. Rolling 60 month regression of stock excess return against market excess return. Factor 2: Size (SMB). Small cap outperforms large cap on a risk adjusted basis. Factor 3: Value (HML). High book to market outperforms low book to market over long horizons. Factor 4: Momentum (MOM). Recent 12 month winners keep winning for 3 to 12 months. Factor 5: Profitability (RMW). Robust operators outperform weak operators. Factor 6: Investment (CMA). Conservative asset growth outperforms aggressive expansion. Factor 7: Low Volatility. Low vol stocks earn higher risk adjusted returns than theory predicts. Every fund runs a version of this. Solo builders cannot because it needs a research team. ## Graph engineering solves that. Each factor becomes a node. Here is the full graph. Eleven nodes total. Factor Construction Nodes (run in parallel) > Node 1: Market Beta Agent. > Runs the rolling 60 month regression. Outputs a beta for every stock. > Node 2: Size Agent. > Sorts by market cap. Computes the small big spread. > Node 3: Value Agent. > Sorts by book to market. Computes the high low spread. > Node 4: Momentum Agent. > Computes 12 minus 1 month momentum. Constructs MOM from the decile spread. > Node 5: Profitability Agent. > Computes gross profitability. Constructs RMW. > Node 6: Investment Agent. > Computes annual asset growth. Constructs CMA. > Node 7: Low Vol Agent. > Computes trailing 60 day realized volatility. Constructs low vol from the decile spread. Coordination Nodes (run in sequence) > Node 8: The Validator. > Runs Newey West adjusted t statistics on each factor. Bootstrap resamples 10,000 iterations. Kills any factor with in sample versus out of sample degradation above 30 percent. Runs on a stronger reasoning model. The maker never validates the maker's own work. > Node 9: The Regime Auditor. > Segments the 20 year history into three regimes using a Hidden Markov Model on volatility and returns. Kills anything that only works in one regime. > Node 10: The Portfolio Constructor. > Combines surviving factors into a long short portfolio using risk parity weights. Enforces sector, beta, and dollar neutrality. > Node 11: The Risk Decomposer. > Regresses the portfolio against the seven factors plus style and macro factors. Reports residual alpha and t statistic. Only signals where the residual alpha survives factor decomposition are genuine new alpha. Everything else is repackaged style with extra steps. Eleven nodes. Each owns one job. They pass their outputs down the graph. The whole model runs on a single Slate Program that fires every 24 hours. ## Part 4: How To Build It Step By Step Here is the exact build. Follow along in your terminal. > Step 1: Install Slate Open your terminal and run: ``` npm i -g @randomlabs/slate ``` Slate is a global npm package. Install takes about 30 seconds. Verify with: ``` slate --version ```  > Step 2: Create Your Project Directory Multi factor research needs its own workspace. State files, historical factor tests, portfolio snapshots all live here. ``` mkdir ~/projects/multifactor-alpha cd ~/projects/multifactor-alpha ``` Do not run other Slate projects out of the same folder. State namespacing is per workspace. > Step 3: Launch Slate Type: ``` slate ```  > Step 4: Connect Your Providers Inside Slate, type: ``` /providers ``` This opens the provider configuration screen. Random Labs authenticates by default. You can also connect OpenAI Codex and GitHub Copilot directly.  Navigate to Codex with the arrow keys and hit enter to authenticate. Your existing subscription works. > Step 5: Connect Your Models Inside Slate, type: ``` /models ``` You see every model available across every provider connected. Random Labs hosts about 90 models. You want two model tiers. A fast tier for the seven factor construction agents. Claude Sonnet works. A stronger reasoning tier for the validator, regime auditor, and risk decomposer. Claude Opus works. > Step 6: Warm Up With /goal And /deepresearch Before you draft your own Program, spend 30 minutes with the two shipped example Programs. This is how graph engineering stops being a concept and starts being intuition. Try this /goal command inside Slate: ``` /goal write a Python function that computes Fama-MacBeth cross sectional regression coefficients and verify it matches the empiricalfin package on 20 years of monthly return data ``` Watch how the graph fans out. Watch the grader model check the work of the writer model. Watch what happens when the first attempt fails. Then try this /deepresearch command: ``` /deepresearch what does the academic literature say about the profitability factor RMW versus the quality factor as defined by MSCI and how do they differ empirically from 2015 to 2026 ``` Watch the parallel worker fanout. Watch the orchestrator synthesize. These two runs give you the mental model you need before you write your own Program. > Step 7: Draft The Multi Factor Program This is the most important step. You describe the graph in plain English and Slate drafts it with you. Type this exact prompt into Slate: ``` draft me a program that runs seven multi-factor research agents in parallel: market beta, size, value, momentum, profitability, investment, and low-volatility. After all seven complete, run a validator, a regime auditor, a portfolio constructor, and a risk decomposer in sequence. Use Claude Sonnet for the seven factor agents and Claude Opus for validator, regime auditor, and risk decomposer. Run the whole pipeline every 24 hours. Use file system as memory. Set a budget of $30 per run. Enforce Newey-West t-stat above 2.5, bootstrap 10,000 iterations, and reject any factor with in-sample versus out-of-sample Sharpe degradation above 30 percent. ``` Slate does not just start writing code. It reads carefully and asks clarifying questions.  Which data source. What backtest window. Which universe. What regime classifier. Whether to use overridable defaults. You answer in plain English. Slate writes the JavaScript. > Step 8: Review The Graph Diagram Once Slate has drafted the Program, it renders a diagram of the graph. You are not reading code to understand what will run. You are looking at the coordination structure. Seven factor nodes running in parallel from the orchestrator. A sync point. Four coordination nodes in sequence. A persistence step. A sleep node. A loop back to the top. Ask Slate questions about the diagram before you run anything: - Why is the validator running on Opus? - What happens if the momentum agent times out? - What state gets persisted between cycles? - What triggers the regime auditor to reject a factor? If any answer surprises you, ask Slate to change the graph. > Step 9: Save And Run Once the diagram matches what you want, tell Slate to commit the Program to a file. Then run: ``` slate run multifactor-alpha.js ``` The moment you hit enter, Slate spins up the graph. The seven factor agents fire in parallel. Feature engineering runs in parallel. Validation runs on the stronger model. The first run takes 15 to 25 minutes. Subsequent daily runs are faster because the state file already holds history. > Step 10: Set A Budget Inside Slate, type: ``` /budget $30/run ```  This caps total spend per run. If a run approaches the cap, Slate escalates before continuing. > Step 11: Debug When It Breaks Real Programs break. Mine broke three times in the first two weeks. The value agent got blocked because it could not interpret non US balance sheets. I told Slate. Slate patched the value agent to include a currency normalization step. The momentum agent occasionally returned zero surviving signals in momentum hostile regimes. I told Slate. Slate added a fallback that widens the momentum lookback window during those regimes. The portfolio constructor sometimes violated sector neutrality. I told Slate. Slate added a projection step to enforce neutrality before writing the portfolio. You do not chase a stack trace. You describe the problem to Slate. Slate patches the node. ## Part 5: What Actually Happened When I Ran It Here is the part I did not expect. I described the graph to Slate in one paragraph. Slate checked the available model identifiers first, activated the models skill, and picked claude-sonnet-4.6 for the fast agents and claude-opus-4.5 for the coordination stages. Then Slate drafted the entire Program in one pass. Not a rough draft. The full JavaScript. Eleven nodes wired together. Parallel factor construction. Sequential validation. Filesystem shared memory with timestamped run directories. Budget allocations. The whole thing.  Slate did not just write code and disappear. It came back with three specific decisions it wanted me to confirm before we ran it.  Decision 1: Portfolio constructor model. My draft prompt specified Opus for validator, regime auditor, and risk decomposer, but I did not name a model for the portfolio constructor. Slate defaulted it to Opus because the stage is heavy analytical work, but flagged it as a flip if I wanted Sonnet. Decision 2: Model versions. Slate used the current stable Sonnet and Opus (4.6 and 4.5) and offered to bump to newer versions if I preferred. Decision 3: Budget enforcement. This one surprised me. Slate explicitly told me that the $30 per run cap was advisory, not a hard kill switch. There is no real time cost metering primitive, so the budget gets enforced as a stated cap plus self reported spend that gets summed and flagged. If I wanted a hard abort mid run, Slate offered to design it explicitly. That third callout is why I trust this tool. Most agent frameworks would silently pretend the budget was enforced. Slate told me exactly what layer of enforcement it could actually provide. I confirmed all three defaults, renamed the Program to multifactor-research-pipeline and told Slate to commit it. Then I hit run.  The seven factor agents fired immediately. Each one showed up in the terminal with its own subagent ID and status timer. Slate confirmed the run in plain English: > "It's running in the background as multifactor-pipeline, starting with the seven factor agents in parallel on Sonnet, then the validator → regime → portfolio → risk sequence on Opus, with defaults (./research-memory, $30 budget, the three gates, perpetual 24-hour loop)." That single line captures why graphs beat scripts. I did not write coordination code. I did not chase a stack trace. I did not glue APIs together. I described the graph in plain English, answered three design questions, and Slate built it. Everything is overridable at launch. Interval, budget, gate thresholds, models, memory location, and a maxRuns cap if you do not want the graph running forever. Here is the full Program that Slate wrote for me. Study it, but do not copy it verbatim. Yours will look slightly different depending on the answers you gave to Slate's clarifying questions. ## Part 6: What Happens Every 24 Hours At 3am your time, the graph wakes up. The seven factor agents fire in parallel. Each one pulls the latest 24 hours of price and fundamental data. Updates its factor time series. Hands off to the validator. The validator runs Newey West t tests. Bootstraps 10,000 samples. Kills anything that failed out of sample. This step alone rejects roughly 80 percent of what looks promising on a first backtest. The regime auditor takes what survived. Segments history using the HMM. Recomputes Sharpe per regime. A factor that only works in one regime is not alpha. It is beta to that regime, dressed up as alpha. The portfolio constructor takes the surviving factors. Builds the long short portfolio with the neutrality constraints enforced. The risk decomposer takes the portfolio. Regresses it against the broad style and macro factor set. If the residual alpha t stat is above 2.5, the signal survives. If not, the day is logged as no signal and the graph sleeps until tomorrow. Every morning you wake up to a Slack message. Either you have a signal you can trade. Or you have documented evidence that today was noise. Both outcomes are useful. Neither required you to be at the keyboard. This is what a self running multi factor alpha model looks like in 2026.  ## The Blueprint If you remember nothing else, remember these seven moves in order. 1. Understand the progression. Prompts became loops. Loops became swarms. Swarms became graphs. 2. Know your factors. Market, size, value, momentum, profitability, investment, low volatility. Seven factors. Each one becomes a node. 3. Design eleven nodes. Seven factor agents in parallel. Four coordination agents in sequence. Draw the graph before you write a line of code. 4. Use different models for different nodes. Sonnet for factor construction. Opus for validation and decomposition. Maker never validates maker. 5. Enforce hard rules. Newey West t stat above 2.5. Bootstrap 10,000 iterations. Regime robustness across three HMM states. Residual alpha t stat above 2.5. 6. Warm up with /goal and /deepresearch. Graph engineering intuition comes from watching graphs, not from reading about them. 7. Let it compound. Month one is finding bugs. Month two is refining factors. By month three, your graph produces signals you can actually trade. ## Now Go Build It Install Slate tonight. Launch it. Run /goal on a real quant question. Run /deepresearch on a factor you are curious about. Then draft your own Program with the exact prompt from Step 6. Review the diagram. Run it. Set a $30 budget. By this time next week you will have your first self running multi factor graph. By this time next month you will have your first tradeable signal survive all eleven nodes. That is the trade. One weekend of setup for a compounding research system that never sleeps. Now go build it. If you get stuck at any part of the build, DM me here. You can find Slate at http://randomlabs.ai/rr. Follow @wearerandomlabs if you want to see every capability they ship. /goal and /deepresearch are the first two Programs. They will not be the last. ## 相关链接 - [Roan](https://x.com/RohOnChain) - [@RohOnChain](https://x.com/RohOnChain) - [318K](https://x.com/RohOnChain/status/2080296261576687751/analytics) - [Jul 6](https://x.com/RohOnChain/status/2074134246784921977) - [1.9M](https://x.com/RohOnChain/status/2074134246784921977/analytics) - [@wearerandomlabs](https://x.com/wearerandomlabs) - [http://randomlabs.ai/rr](http://randomlabs.ai/rr) - [http://randomlabs.ai/rr](http://randomlabs.ai/rr) - [@wearerandomlabs](https://x.com/wearerandomlabs) - [Upgrade to Premium](https://x.com/i/premium_sign_up) - [10:17 PM · Jul 23, 2026](https://x.com/RohOnChain/status/2080296261576687751) - [318.3K Views](https://x.com/RohOnChain/status/2080296261576687751/analytics) - [View quotes](https://x.com/RohOnChain/status/2080296261576687751/quotes) --- *导出时间: 2026/7/24 12:58:49* --- ## 中文翻译 # 如何利用图工程构建多因子 Alpha 模型 **作者**: Roan **日期**: 2026-07-06T14:11:54.000Z **来源**: [https://x.com/RohOnChain/status/2080296261576687751](https://x.com/RohOnChain/status/2080296261576687751) ---  我将准确拆解如何利用图工程构建一个对冲基金级别的多因子 Alpha 模型。 我们直奔主题。 > 收藏本文 - > 我是 Roan,一名后端开发者,专注于系统设计、高频交易(HFT)风格的执行以及量化交易系统。我的工作研究预测市场在负载下的真实行为。如有任何建议、深思熟虑的合作或伙伴关系,请私信联系我。 在上一篇文章中,我说过我会亲自指导前 20 位正在构建 AI 量化系统的建设者完成初始设置,我是认真的。 几位建设者已经与我深入合作。该提议仍然有效。 如果你正在构建图工程系统,或者即将开始,甚至只是在考虑,请在这篇文章下回复或私信我你当前的设置。我将亲自审查你的架构,并向你展示你现有的系统与能够自主狩猎 Alpha 的“蜂群”之间的差距。 如果我没有回复,那说明你不在前 20 名之列。动作要快。 多因子投资是华尔街每一家严肃的对冲基金创造收益的方式。他们不交易单一的想法。他们叠加因子。 这也是 AQR 运行的方式。Two Sigma 运行的方式。Bridgewater 运行的方式。这是第一次它能够由独立建设者执行。 问题在于,构建这样的系统一直需要一个研究团队。因子工程师。统计学家。投资组合构建专家。风险分析师。执行工程师。每个因子家族至少需要十个人,没有哪个独立量化分析师能组建这样的团队。 这就是为什么散户量化分析师坚持单一策略,而对冲基金则能印出 Alpha。 直到现在。 > **Roan@RohOnChain**: [原文链接](https://x.com/RohOnChain/status/2074134246784921977) > 在我之前的两篇文章中,我介绍了循环工程以及如何构建一个 24/7 狩猎 Alpha 的 AI 代理蜂群。 一旦你拥有了循环和蜂群,将它们作为一个整体系统粘合在一起的层级就是图。 > 图工程就是设计该层级的实践。你定义节点。你定义边。图自动运行。 在读完这篇文章时,你不仅会理解图工程。 你还将在你的笔记本电脑上拥有一个每 24 小时运行一次的自我运行多因子 Alpha 模型。 ## 第 1 部分:图工程到底是什么 每个使用 AI 的量化分析师都处于相同的发展路径上的某个位置。明确你所在的位置会让下一步该去哪里变得显而易见。  What Graph Engineering Actually Is > 阶段 1:提示词。你输入一个提示词。你等待。你阅读输出。你输入下一个。你就是循环本身。当你合上笔记本电脑,什么也无法存活。 > 阶段 2:循环。你编写一个脚本,封装提示词并按计划触发。循环持有状态。它在你合上笔记本电脑后依然存活。这是我的循环工程文章所教授的内容。一个代理,一项任务,永远运行。 > 阶段 3:蜂群。你将循环扩展为许多具有特定角色的代理。一个生成信号。一个验证信号。一个执行。这是我的 AI 代理蜂群文章所教授的内容。多个代理并行,通过 Python 胶水代码手动协调。 > 阶段 4:图。你描述一次协调结构。节点是代理。边是数据交接。图知道何时并行,何时等待,何时重试,何时升级。你不再需要接触胶水代码。 图工程就是设计这种协调结构的实践。 图不是脚本。这种区别比任何人告诉你的都重要。 脚本会在一个代理需要等待另一个代理时崩溃。脚本会在状态必须跨周期持久化时崩溃。脚本会在你希望在不同模型上并行运行六个循环时崩溃。每个尝试构建多代理系统的散户量化分析师都撞上了这三堵墙。 这堵失败的墙曾让我崩溃。当我的盈利代理因为需要解析 500 份资产负债表并触及速率限制而被阻塞时,整个流水线就死了。 第二天早上回来,我面对的是一个停止的进程,没有信号,也完全不知道失败源于何处。调试意味着阅读堆栈跟踪并猜测哪个代理位于崩溃的上游。 到了第二个月,我花在调试协调上的时间比做研究的时间还多。我差点要把整个项目搁置。 这就是每个多代理量化分析师都会遇到的失败状态。这也是图存在的原因。 > 图没有那些失败模式。并行是原生的。状态是持久的。故障被限定在节点内,而不是整个流水线。当一个节点损坏时,图的其余部分继续运行,你通过用通俗易懂的英语描述故障来修补损坏的节点。 这就是图工程的承诺。现在的问题是什么来运行这个图。 ## 第 2 部分:运行图的工具 图是架构图。它们不会自己运行。它们需要运行时。 运行时是大多数构建多代理系统的人搞砸的地方。 他们假设困难的部分是设计图。其实不是。困难的部分是找到能够实际执行它的基础设施。 我花了几周时间尝试不同的运行时,才找到一个能够端到端运行多因子图的工具。  我使用的那个工具叫 Slate。由 @wearerandomlabs 构建。在你的终端中运行。接管你现有的模型订阅并将工作分发给它们。 对这篇文章来说,重要的是他们最近发布的一项功能,叫做 Programs(程序)。Program 是一个用 JavaScript 编写的图,由 Slate 为你持续运行。 提示词运行一次就停止。Program 会一直运行直到任务完成。 你不仅仅是自己编写 Program。你用通俗易懂的英语告诉 Slate 你想要什么。Slate 起草图。 然后 Slate 向你展示一张图。你针对图提问。你更改节点。你调整模型。只有当你满意时,你才告诉 Slate 保存并运行它。 如果它崩溃了,你就故障与 Slate 聊天。Slate 修补图。 你可以在 http://randomlabs.ai/rr 找到 Slate。它现已可用。 在构建图之前,感受图工程的最好方法是运行 Slate 附带的两个示例程序。 > 它们分别叫 /goal 和 /deepresearch。 /goal - 运行直到验证完成的图 在 Slate 中输入: ``` /goal implement a Newey-West adjusted t-statistic function in Python and verify it matches the statsmodels implementation on ten random return series ``` Slate 不会向模型触发一个提示词。它会启动一个图。  > 一个节点编写函数。 > 另一个节点编写验证测试。 > 第三个节点运行两者。 > 第四个节点评估输出是否匹配。 如果不匹配,图会以具体的不匹配项作为反馈进行循环。它会一直运行,直到一个独立的小型评分模型确认目标已完成。 这就是运行时中的“复核员”模式。制作人从不给自己的工作打分。 /deepresearch - 并行化研究的图 在 Slate 中尝试这个: ``` /deepresearch what does the latest academic research say about the Fama-French five factor model out of sample performance in emerging markets from 2015 to 2026 ``` 这里启动的图与 /goal 不同。  这是一个并行研究分发。 Slate 立即分派多个工作代理。每个代理负责问题的不同角度。 一个阅读最近的论文。另一个检查 arXiv q fin。另一个从 Kenneth French 数据库提取数据。另一个交叉引用引用。 它们都向一个综合调查结果的中央协调器汇报。 /deepresearch 对这个构建之所以重要的原因在于,它展示了你进行因子构建所需的确切模式。 七个因子代理。每个拥有不同的因子。全部并行运行。全部向中央协调器汇报。 这就是多因子图,去除了量化特定的任务。 花 30 分钟在你真正关心的问题上运行 /goal 和 /deepresearch。这就是图工程直觉产生的方式。  ## 第 3 部分:多因子 Alpha 图 多因子投资将股票回报分解为系统性驱动因素加上残差。基础版本是 1993 年发表的 Fama French 三因子模型:  R_i 是股票 i 的回报。R_f 是无风险利率。R_m 是市场回报。SMB 是规模溢价。HML 是价值溢价。 Alpha α 是模型无法解释的部分。那个残差就是你狩猎的目标。 Carhart 在 1997 年增加了动量。Fama 和 French 在 2015 年增加了盈利能力(RMW)和投资(CMA)。 现代对冲基金运行一个七因子堆栈。AQR、Two Sigma、Millennium、Bridgewater 都运行其变体。以下是 2026 年重要的七个因子。  因子 1:市场 Beta。 股票超额回报对市场超额回报的滚动 60 个月回归。 因子 2:规模 (SMB)。 小盘股在风险调整基础上跑赢大盘股。 因子 3:价值 (HML)。 高账面市值比在长期跑赢低账面市值比。 因子 4:动量 (MOM)。 近期 12 个月的赢家会持续赢 3 到 12 个月。 因子 5:盈利能力 (RMW)。 稳健的运营商跑赢虚弱的运营商。 因子 6:投资 (CMA)。 保守的资产增长跑赢激进的扩张。 因子 7:低波动。 低波动股票产生的风险调整回报高于理论预测。 每个基金都运行这个的一个版本。独立建设者无法做到,因为它需要一个研究团队。 ## 图工程解决了这个问题。每个因子变成一个节点。 这是完整的图。总共十一个节点。 因子构建节点(并行运行) > 节点 1:市场 Beta 代理。 > 运行滚动 60 个月回归。输出每只股票的 beta 值。 > 节点 2:规模代理。 > 按市值排序。计算大小盘差值。 > 节点 3:价值代理。 > 按账面市值比排序。计算高低差值。 > 节点 4:动量代理。 > 计算 12 个月减 1 个月动量。通过十分位差构建 MOM。 > 节点 5:盈利能力代理。 > 计算总盈利能力。构建 RMW。 > 节点 6:投资代理。 > 计算年度资产增长。构建 CMA。 > 节点 7:低波代理。 > 计算过去 60 天的已实现波动率。通过十分位差构建低波组合。 协调节点(按顺序运行) > 节点 8:验证器。 > 对每个因子运行 Newey West 调整 t 统计量。自举重采样 10,000 次迭代。剔除任何样本内与样本外恶化超过 30% 的因子。 在更强的推理模型上运行。制作人从不验证自己的工作。 > 节点 9:制度审计员。 > 使用隐马尔可夫模型(HMM)基于波动率和回报将 20 年历史分为三个制度。剔除任何只在一个制度有效的因子。 > 节点 10:投资组合构建器。 > 使用风险平价权重将存活的因子结合为多空投资组合。强制执行行业、Beta 和美元中性。 > 节点 11:风险分解器。 > 将投资组合对七个因子加上风格和宏观因子进行回归。报告残差 Alpha 和 t 统计量。 只有那些残差 Alpha 经得起因子分解的信号才是真正的新 Alpha。其他所有东西都是经过额外步骤重新包装的风格因子。 十一个节点。每个拥有一个任务。它们沿着图向下传递输出。 整个模型在一个 Slate 程序上运行,每 24 小时触发一次。 ## 第 4 部分:如何逐步构建 这是确切的构建过程。在你的终端中跟随操作。 > 步骤 1:安装 Slate 打开终端并运行: ``` npm i -g @randomlabs/slate ``` Slate 是一个全局 npm 包。安装大约需要 30 秒。 验证: ``` slate --version ```  > 步骤 2:创建项目目录 多因子研究需要自己的工作空间。状态文件、历史因子测试、投资组合快照都住在这里。 ``` mkdir ~/projects/multifactor-alpha cd ~/projects/multifactor-alpha ``` 不要在同一文件夹下运行其他 Slate 项目。状态命名空间是按工作空间划分的。 > 步骤 3:启动 Slate 输入: ``` slate ```  > 步骤 4:连接提供商 在 Slate 内部,输入: ``` /providers ``` 这将打开提供商配置屏幕。Random Labs 默认已认证。你也可以直接连接 OpenAI Codex 和 GitHub Copilot。  使用箭头键导航到 Codex 并按回车进行认证。你现有的订阅有效。 > 步骤 5:连接模型 在 Slate 内部,输入: ``` /models ``` 你可以看到每个连接的提供商上可用的每个模型。Random Labs 托管大约 90 个模型。 你需要两个模型层级。 一个用于七个因子构建代理的快速层级。Claude Sonnet 可用。 一个用于验证器、制度审计员和风险分解器的更强推理层级。Claude Opus 可用。 > 步骤 6:用 /goal 和 /deepresearch 热身 在你起草自己的程序之前,花 30 分钟使用这两个附带的示例程序。 这就是图工程从一个概念转变为直觉的方式。 在 Slate 中尝试这个 /goal 命令: ``` /goal write a Python function that computes Fama-MacBeth cross sectional regression coefficients and verify it matches the empiricalfin package on 20 years of monthly return data ``` 观察图如何分发。观察评分模型如何检查编写模型的工作。观察第一次尝试失败时会发生什么。 然后尝试这个 /deepresearch 命令: ``` /deepresearch what does the academic literature say about the profitability factor RMW versus the quality factor as defined by MSCI and how do they differ empirically from 2015 to 2026 ``` 观察并行工作分发。观察协调器综合。 这两次运行为你提供了编写自己程序之前所需的心智模型。 > 步骤 7:起草多因子程序 这是最重要的一步。你用通俗易懂的英语描述图,Slate 与你一起起草。 在 Slate 中输入这个确切的提示词: ``` draft me a program that runs seven multi-factor research agents in parallel: market beta, size, value, momentum, profitability, investment, and low-volatility. After all seven complete, run a validator, a regime auditor, a portfolio constructor, and a risk decomposer in sequence. Use Claude Sonnet for the seven factor agents and Claude Opus for validator, regime auditor, and risk decomposer. Run the whole pipeline every 24 hours. Use file system as memory. Set a budget of $30 per run. Enforce Newey-West t-stat above 2.5, bootstrap 10,000 iterations, and reject any factor with in-sample versus out-of-sample Sharpe degradation above 30 percent. ``` Slate 不会只是开始写代码。它会仔细阅读并提出澄清问题。  哪个数据源。什么回测窗口。哪个股票池。什么制度分类器。是否使用可覆盖的默认值。 你用通俗易懂的英语回答。Slate 编写 JavaScript。 > 步骤 8:查看图图表 一旦 Slate 起草了程序,它会渲染图的图表。 你不是在阅读代码来了解将要运行什么。你是在看协调结构。 七个因子节点从协调器并行运行。一个同步点。四个协调节点按顺序运行。一个持久化步骤。一个睡眠节点。一个循环回到顶部。 在运行任何东西之前,向 Slate 询问关于图表的问题: - 为什么验证器在 Opus 上运行? - 如果动量代理超时会发生什么? - 周期之间保留什么状态? - 什么触发制度审计员拒绝因子? 如果任何答案让你惊讶,让 Slate 更改图。 > 步骤 9:保存并运行 一旦图表符合你的要求,告诉 Slate 将程序提交到文件。然后运行: ``` slate run multifactor-alpha.js ``` 当你按下回车的瞬间,Slate 启动图。七个因子代理并行触发。 特征工程并行运行。验证在更强的模型上运行。 第一次运行需要 15 到 25 分钟。随后的日常运行会更快,因为状态文件已经保存了历史记录。 > 步骤 10:设置预算 在 Slate 内部,输入: ``` /budget $30/run ```  这限制了每次运行的总花费。如果运行接近上限,Slate 会在继续之前升级处理。 > 步骤 11:在崩溃时调试 真实的程序会崩溃。我的在前两周崩溃了三次。 价值代理被阻塞,因为它无法解释非美国资产负债表。我告诉了 Slate。Slate 修补了价值代理,增加了货币归一化步骤。 动量代理有时在动量不利制度下返回零个存活的信号。我告诉了 Slate。Slate 增加了一个回退机制,在这些制度下扩大动量回看窗口。 投资组合构建器有时违反行业中性。我告诉了 Slate。Slate 增加了一个投影步骤,以便在写入投资组合之前强制执行中性。 你不需要追逐堆栈跟踪。你向 Slate 描述问题。Slate 修补节点。 ## 第 5 部分:当我运行它时实际发生了什么 这是我没有预料到的部分。 我用一段话向 Slate 描述了图。Slate 首先检查了可用的模型标识符,激活了模型技能,并为快速代理选择了 claude-sonnet-4.6,为协调阶段选择了 claude-opus-4.5。 然后 Slate 一次性起草了整个程序。不是粗略的草稿。完整的 JavaScript。十一个节点连接在一起。并行因子构建。顺序验证。带有带时间戳运行目录的文件系统共享内存。预算分配。所有东西。  Slate 不仅仅是写代码然后消失。它带着三个具体的决定回来了,希望我在运行之前确认。  决定 1:投资组合构建器模型。我的起草提示词指定了验证器、制度审计员和风险分解器使用 Opus,但我没有为投资组合构建器指定模型。Slate 将其默认为 Opus,因为该阶段是繁重的分析工作,但将其标记为如果我更喜欢 Sonnet 可以翻转。 决定 2:模型版本。Slate 使用了当前稳定的 Sonnet 和 Opus(4.6 和 4.5),并提议如果我愿意可以升级到更新版本。 决定 3:预算执行。这让我惊讶。Slate 明确告诉我,每次运行 30 美元的上限是建议性的,而不是硬性终止开关。没有实时成本计费原语,因此预算作为声明的上限加上自我报告的花费来执行,将它们相加并标记。如果我希望在运行中途硬性中止,Slate 提议显式设计它。 第三个调用点就是我信任这个工具的原因。大多数代理框架会假装预算被执行了。Slate 确切地告诉了我它能实际提供的执行层级。 我确认了所有三个默认值,将程序重命名为 multifactor-research-pipeline,并告诉 Slate 提交它。 然后我点击了运行。  七个因子代理立即触发。每一个都出现在终端中,带有自己的子代理 ID 和状态计时器。 Slate 用通俗易懂的英语确认了运行: > "It's running in the background as multifactor-pipeline, starting with the seven factor agents in parallel on Sonnet, then the validator → regime → portfolio → risk sequence on Opus, with defaults (./research-memory, $30 budget, the three gates, perpetual 24-hour loop)." 这一行概括了为什么图胜过脚本。 我没有编写协调代码。我没有追逐堆栈跟踪。我没有把 API 粘在一起。我用通俗易懂的英语描述了图,回答了三个设计问题,Slate 构建了它。 所有东西在启动时都是可覆盖的。间隔、预算、门限阈值、模型、内存位置,以及如果你不希望图永远运行时的 maxRuns 上限。 这是 Slate 为我编写的完整程序。研究它,但不要逐字复制。你的看起来会略有不同,这取决于你对 Slate 的澄清问题给出的答案。 ## 第 6 部分:每 24 小时会发生什么 在你的时间凌晨 3 点,图醒来。 七个因子代理并行触发。每一个拉取过去 24 小时的最新价格和基本面数据。更新其因子时间序列。移交给验证器。 验证器运行 Newey West t 检验。自举重采样 10,000 个样本。剔除任何在样本外失败的东西。 仅这一步就拒绝了大约 80% 在初次回测中看起来有希望的东西。 制度审计员接收幸存者。使用 HMM 分割历史。按制度重新计算夏普比率。 只在一个制度有效的因子不是 Alpha。它是该制度的 Beta,伪装成 Alpha。 投资组合构建器接收存活的因子。在强制执行中性约束的情况下构建多空投资组合。 风险分解器接收投资组合。将其对广泛的风格和宏观因子集进行回归。 如果残差 Alpha t 统计量高于 2.5,信号存活。否则,当天被记录为无信号,图进入休眠直到明天。 每天早上你醒来都会收到一条 Slack 消息。要么你有一个可以交易的信号。要么你有证据表明今天只是噪音。 两种结果都有用。都不需要你坐在键盘前。 这就是 2026 年自我运行多因子 Alpha 模型的样子。  ## 蓝图 如果你什么都记不住,请按顺序记住这七个动作。 1. 理解演进路径。提示词变成了循环。循环变成了蜂群。蜂群变成了图。 2. 了解你的因子。市场、规模、价值、动量、盈利能力、投资、低波动。七个因子。每一个都变成一个节点。 3. 设计十一个节点。七个因子代理并行。四个协调代理顺序。在写一行代码之前先画出图。 4. 为不同的节点使用不同的模型。Sonnet 用于因子构建。Opus 用于验证和分解。制作人从不验证自己的工作。 5. 强制执行硬性规则。Newey West t 统计量高于 2.5。自举重采样 10,000 次迭代。跨三个 HMM 状态的制度稳健性。残差 Alpha t 统计量高于 2.5。 6. 用 /goal 和 /deepresearch 热身。图工程的直觉来自于观察图,而不是阅读关于它们的内容。 7. 让它复利。第一个月是发现错误。第二个月是改进因子。到了第三个月,你的图产生你实际上可以交易的信号。 ## 现在去构建吧 今晚安装 Slate。启动它。在一个真正的量化问题上运行 /goal。在一个你好奇的因子上运行 /deepresearch。 然后使用步骤 6 中的确切提示词起草你自己的程序。查看图表。运行它。设置 30 美元的预算。 下周这个时候,你将拥有你的第一个自我运行的多因子图。 下个月这个时候,你将拥有你的第一个经受住所有十一个节点的可交易信号。 这就是这笔交易。一个周末的设置,换取一个永不休眠的复利研究系统。 现在去构建吧。 如果你在构建的任何部分卡住了,请在这里私信我。 你可以在 http://randomlabs.ai/rr 找到 Slate。 如果你想看到他们发布的每一项功能,请关注 @wearerandomlabs。/goal 和 /deepresearch 是前两个程序。它们不会是最后的。 ## 相关链接 - [Roan](https://x.com/RohOnChain) - [@RohOnChain](https://x.com/RohOnChain) - [318K](https://x.com/RohOnChain/status/2080296261576687751/analytics) - [Jul 6](https://x.com/RohOnChain/status/2074134246784921977) - [1.9M](https://x.com/RohOnChain/status/2074134246784921977/analytics) - [@wearerandomlabs](https://x.com/wearerandomlabs) - [http://randomlabs.ai/rr](http://randomlabs.ai/rr) - [http://randomlabs.ai/rr](http://randomlabs.ai/rr) - [@wearerandomlabs](https://x.com/wearerandomlabs) - [Upgrade to Premium](https://x.com/i/premium_sign_up) - [10:17 PM · Jul 23, 2026](https://x.com/RohOnChain/status/2080296261576687751) - [318.3K Views](https://x.com/RohOnChain/status/2080296261576687751/analytics) - [View quotes](https://x.com/RohOnChain/status/2080296261576687751/quotes) --- *导出时间: 2026/7/24 12:58:49*
构 构建自主 AI 同事的十大关键要素 本文基于作者使用 OpenClaw、Claude Code 和 GooseworksAI 的实践经验,深入探讨了构建真正自主的 AI 同事所需的系统架构。文章详细拆解了从运行环境、上下文持续同步、持久化记忆、技能封装到自动化调度、双向通信及反馈闭环等十个核心维度。作者指出,AI 本身已具备工作能力,瓶颈在于如何像工程师一样编排这些组件,使其能全天候、无需监管地协同工作。 技术 › Agent ✍ Shiv🕐 2026-04-19 AIAgentOpenClaw工作流编排自动化Autonomous系统设计Claude创业生产力
H Hermes Agent + Polymarket:从100到5000美元的自学交易机器人搭建指南 本文是一篇详细的技术教程,作者介绍了如何利用 Hermes Agent 搭建一个自动化的 Polymarket 天气交易机器人。文章首先阐述了 Hermes 相比 OpenClaw 的三大优势:持久化记忆、自我进化的技能生成能力以及全天候执行层。随后,作者列举了 Polymarket 上通过 AI 代理获得巨额回报的成功案例,并提供了从 VPS 准备开始的详细安装步骤。文章指出,Hermes 能够通过闭环学习不断优化交易策略,为用户带来自动化收益。 技术 › Agent ✍ Movez🕐 2026-04-17 HermesAgentPolymarket量化交易自学机器人AIOpenClaw教程量化自动化
用 用“女娲”Skill 蒸馏 Crypto 大佬交易人格,Agent 竞技场实战复盘 作者利用“女娲”Skill 将 Wintermute 创始人、Dragonfly 合伙人和 3AC 联合创始人的交易人格蒸馏为 AI Agent,并在同一交易竞技场进行 150 天回测与实盘。实验发现,蒸馏出的策略差异巨大,不仅复刻了真人的交易风格,也保留了其弱点,展示了 AI 在量化交易中的人格化应用潜力。 技术 › Agent ✍ MinMoss🕐 2026-04-08 AIAgentCrypto量化交易女娲Skill回测MOSSOpenClaw
重 重读 Agent 框架「pi」:对主流 Coding Agent 的反思与极简实践 本文分析了 Mario Zechner 开发的极简 Coding Agent 框架「pi」。文章分享了通用的 Agent 设计经验,包括保持提示词简洁、最小化工具集及文件化状态管理。同时详细介绍了 pi 的三层技术架构,以及其独特的反常规设计哲学,如采用 YOLO 模式、放弃 MCP 支持和内置 TODO,主张通过精简工具和增强可观察性来提升开发效率。 技术 › Agent ✍ badlogicgames🕐 2026-03-13 AIAgentCoding Agent架构设计ClaudeLLM工具与效率DevOps系统设计
装 装完 Codex 不知道干什么?这 6 个 GitHub Skills 让你做视频搞钱 文章介绍了 6 个适用于 Codex 的 GitHub Skills,涵盖动效生成、视频剪辑、批量制作、AI 生成及中文剪辑等工具,帮助用户构建自动化视频工作流以提升效率。 技术 › Codex ✍ Kay🕐 2026-07-30 Codex视频制作AgentSkill自动化HyperFramesRemotionAI剪辑工作流
H Hermes Agent Masterclass: 安装、配置与基础命令 本文介绍了开源 AI Agent Hermes 的安装与基础配置。Hermes 由 Nous Research 开发,支持多种模型和终端运行,具有会话复用和技能积累的独特设计。文章详细讲解了在 Windows、macOS 和 Linux 上的安装步骤、设置向导流程以及如何配置推理提供商。 技术 › Agent ✍ tonbi🕐 2026-07-29 HermesAgentAI安装教程CLI工具与效率开源
顶 顶尖VC 2026年动向观察:硬基建与深垂直的押注 文章分析了2026年顶尖独立VC机构的投资动向,指出资本正从浅层应用转向硬基建、物理世界和深垂直领域。通过分析赛道年龄、轮次和具体公司(如Atoms、Etched、Cognition等),揭示了AI创业窗口正在收窄,而推理芯片、机器人、企业Agent及特定垂直工作流成为投资热点。 投资 › 风投 ✍ snowboat🕐 2026-07-28 风投AI硬科技机器人Agent芯片垂直行业创业
如 如何利用AI构建和扩展单人企业 文章介绍了利用AI构建和扩展单人企业的完整蓝图。通过使用AI员工(如Viktor)在内容、项目、拓展、财务和广告五个领域实现自动化,只需保留决策环节。文章探讨了两种构建方式:快速路径和自定义构建,强调业务知识库和操作规则的重要性。 技术 › Agent ✍ Machina🕐 2026-07-26 AI单人企业自动化Agent生产力Viktor商业模式知识库LLM效率
金 金融中的图工程:设计稳健的Agent图 本文探讨了金融领域中Agent图的设计与实现。文章指出,Agent图解决了脚本在等待、重启和并行分支上的缺陷,并通过状态图而非DAG来实现条件路由和循环。重点讨论了状态管理、并行拓扑模式(如Fan-out、Supervisor)以及在金融任务中的实际应用。 技术 › Agent ✍ zostaff🕐 2026-07-25 Agent图工程状态管理并行计算金融LangChain拓扑模式
G Graph Engineering explained: what it is, when to use it and when not to 文章介绍了图工程的概念及其在AI工作流优化中的应用。图是由节点和边组成的计划,通过识别和消除伪依赖,可以显著提高工作流的并行性和效率。文章重点介绍了“钻石模式”,即扇出、归约和合成的模式,这是提升AI系统性能的关键技巧。 技术 › Agent ✍ Anatoli Kopadze🕐 2026-07-25 图工程工作流优化AI钻石模式并行计算节点边伪依赖扇出归约
管 管理 AI 员工团队:Ryan Carson 的高效工作系统 Ryan Carson 分享了如何作为唯一员工,通过管理云端 AI Agent 团队日处理 40 个 Pull Request 的经验。文章详细介绍了将工作迁移至云端、建立工作节奏、将重复检查自动化以及控制 Token 成本四个关键步骤,强调在 AI 时代,优秀的工程管理能力比以往任何时候都重要。 技术 › Agent ✍ The Startup Ideas Podcast (SIP)🕐 2026-07-25 AIAgentDevin工程管理自动化云端开发成本控制DevOpsLLM
我 我用 WorkBuddy 跑了 3 个活儿,发现它不是助手,是数字员工 文章通过三个真实任务评测了 WorkBuddy 的实际应用:视频 Skill 管理工具开发、电商数据清洗分析及竞品监控自动化流程。作者指出 WorkBuddy 不仅是聊天工具,更是集专家判断、专业 Skill 和自动化执行于一体的 AI 工作台,能有效提升处理固定流程任务的效率。 技术 › 工具与效率 ✍ 行者AI视频🕐 2026-07-24 WorkBuddyAI自动化数据分析实战评测效率提升Agent专家模式技能管理竞品监控