惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News | PayPal Newsroom
P
Proofpoint News Feed
Cyberwarzone
Cyberwarzone
C
Cisco Blogs
SecWiki News
SecWiki News
Know Your Adversary
Know Your Adversary
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Vercel News
Vercel News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
NISL@THU
NISL@THU
WordPress大学
WordPress大学
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Threat Research - Cisco Blogs
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
Security Archives - TechRepublic
Security Archives - TechRepublic
有赞技术团队
有赞技术团队
L
LINUX DO - 热门话题
Hacker News: Ask HN
Hacker News: Ask HN
V
V2EX
G
GRAHAM CLULEY
TaoSecurity Blog
TaoSecurity Blog
Hugging Face - Blog
Hugging Face - Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
F
Fortinet All Blogs
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
Latest news
Latest news
The Hacker News
The Hacker News
aimingoo的专栏
aimingoo的专栏
T
Troy Hunt's Blog
S
Schneier on Security
I
Intezer
Google DeepMind News
Google DeepMind News
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threatpost
爱范儿
爱范儿
The Register - Security
The Register - Security
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
宝玉的分享
宝玉的分享
Recent Commits to openclaw:main
Recent Commits to openclaw:main
美团技术团队
B
Blog RSS Feed

Steve Hanov's Blog

How this Canadian Startup Bought Millions of Impressions for $8,000 How to Run a Fellowship Program Into the Ground (and get 18M impressions in the process) My Waterloo Intern went back to school. I'll miss him dearly but here's how I replaced him with Hermes I learned Mandarin. Here's what it taught me about B2C SaaS. The VC's Waterloo Coffee Tour: Where to Find Canada's Next Unicorn How I run multiple $10K MRR companies on a $20/month tech stack How to Save a Gemini Canvas as Markdown I built a Chrome extension that lets an LLM “see” tweets Fighting Blog Comment Spam with Qwen3 and Ollama Make a web page screenshot service Automatically remove wordiness from your writing I found Security Vulnerability in your web application How to detect if an object has been garbage collected in Javascript My favourite Google Cardboard Apps O(n) Delta Compression With a Suffix Array Finding Bieber: On removing duplicates from a set of documents Let's read a Truetype font file from scratch A Quick Measure of Sortedness My thoughts on various programming languages A little VIM hacking
A Ralph Loop for Reading: Beating GPT 5.2 with a 4k Context Window (and 4 GPUs)
2026-02-06 · via Steve Hanov's Blog

I recently had a problem that could be solved with money, which is the worst kind of problem.

I am building a new venture called eh-trade.ca. To make it work, I needed deep financial research on 11,000 different stocks.

The "Enterprise" solution is to buy an API subscription. I looked into this. For my usage, the pricing is somewhere between "$200/month" and "Contact Sales". If you are a micro-preneur like me, "Contact Sales" means "You cannot afford this."

The "AI" solution is to ask an LLM to research each stock, which works really well. But 11,000 requests at $0.05 per research session is still $550. Plus, I don't like renting intelligence. I prefer to own it.

So I decided to use the hardware I already had: a home server with four RTX 3090s. It’s a 96GB VRAM beast that heats my basement and scares my birds.

image.png

There was just one problem. The models I can run locally (like qwen3 or phi4) have small context windows. Yes, on the model card they theoretically support 40k+ of context, but they would run very slowly on my hardware, so really, it's 4K -- enough for a few screenfuls of text. Moreover, even if I enabled the long contexts, the models struggle to reason over them. If you try to feed them ten search results about a company's balance sheet, the 'needle in the haystack' effect kicks in. They'll get confused and start hallucinating dividends that don't exist.

We need to optimize.

The Naive Solution: The Chatty Agent

Most "AI Agents" are built on a simple loop, often called ReAct (Reason + Act). It looks like this:

  • User: "Research Apple."
  • Agent: "I will search for Apple's revenue."
  • Tool: [Returns 500 words of search snippets and thinking]
  • Agent: "Okay, now I will search for Apple's debt."
  • Tool: [Returns another 500 words and thinking]

The problem is the Context Window. By step 3, your prompt looks like a Walmart receipt. By step 5, you have exceeded 8,000 tokens, and the model forgets what it was doing and starts making stuff up.

Sure, it works fine if you are OpenAI and have infinite GPUs. It does not work if you are running on a consumer card in a closet.

The Pivot: Graph Theory to the Rescue

A few months ago, I read a paper called GraphReader. It proposed a different way to think about long contexts. Instead of dumping everything into a chat log, why not treat information as a graph?

The core insight is that you don't need to remember everything. You only need to remember the Atomic Facts.

An Atomic Fact is a single, indivisible truth.

  1. "Apple CEO is Tim Cook." -> Fact.
  2. "Apple revenue is $416B." -> Fact.
  3. "I searched for Apple and found a cool blog." -> Noise.

If we extract these facts and throw away the rest, we can compress megabytes of web pages into a few kilobytes of JSON.

Enter Laconic

I built a library called laconic to implement this. I wrote it in Go, because the rest of my projects are all in Go. Plus, my python environments always end up as a tangled mess of pip install errors.

Laconic doesn't keep a chat history. It keeps a Notebook. The context window size is O(N), where N is the number of facts, not the number of words.

The "Magic" Algorithm

Laconic uses a specific strategy called graph-reader.

  1. Plan: The LLM breaks the question into Key Elements (e.g., "Revenue", "CEO", "Competitors").
  2. Explore: It creates a queue of search queries (Nodes).
  3. Extract: For every search result, it extracts Atomic Facts and adds them to the Notebook.
  4. Refine: If a fact is fuzzy, it adds a new search query to the queue.
  5. Answer: Once the Notebook has enough facts, it stops.

The beautiful part? The LLM never sees the full history. It only sees the current Notebook and the current search result. This means I can run complex, multi-step research tasks on a model with a tiny 4k context window, and it never forgets a thing.

Here is the code to run a research agent on my home server using Ollama:

package main

import (
    "context"
    "fmt"
    "github.com/smhanov/laconic"
    "github.com/smhanov/laconic/search"
)

func main() {
    // 1. Connect to the Beast (Ollama)
    model := laconic.NewOllamaProvider("qwen3:32b", "http://localhost:11434")

    // 2. Build the Agent
    agent := laconic.New(
        laconic.WithPlannerModel(model),
        laconic.WithSynthesizerModel(model),
        // Use DuckDuckGo because it is free
        laconic.WithSearchProvider(search.NewDuckDuckGo()), 
        // Use the Graph Reader strategy
        laconic.WithStrategyName("graph-reader"),
    )

    // 3. Profit
    ans, _ := agent.Answer(context.Background(), "What is the P/E ratio of SHOP.TO?")
    fmt.Println(ans)
}

Proof of Concept: The 4B Model

To really test if this strategy works on constrained hardware, I ran a research question using qwen3:4b—a tiny 4-billion-parameter model.

Without the agentic loop, the model cannot answer this question. If you ask it directly, it responds that "the 2024 Nobel Prize in Chemistry has not been announced."

However, with the agent, it autonomously searches, extracts atomic facts, and synthesizes this:

**Prompt:** Who won the 2024 Nobel Prize in Chemistry, what specific contribution were they recognized for, and what institution or company are they affiliated with?

Answer: The 2024 Nobel Prize in Chemistry was awarded to David Baker (University of Washington, Howard Hughes Medical Institute), Demis Hassabis, and John M. Jumper (Google DeepMind). David Baker was recognized for computational protein design. Demis Hassabis and John Jumper were awarded for protein structure prediction using AlphaFold2.

The agent found all three laureates, their exact affiliations, and their distinct contributions — information entirely outside the model's training data — by exploring multiple search queries and accumulating verified facts in a structured notebook.

Is this Ralph?

If you hang out in the parts of the internet where people try to make AI write code without hallucinating, you might have heard of the Ralph Loop.

Popularized by Geoffrey Huntley, the Ralph Loop (often named after Ralph Wiggum) is a brute-force solution to the context problem. You write a bash script that:

  1. Spins up an AI agent.
  2. Gives it one task from a progress.txt file.
  3. Waits for it to finish and commit the code to Git.
  4. Kills the process.

Then it starts over. Fresh context. Zero memory leak. The "memory" is the file system.

Laconic is essentially a Ralph Loop for reading.

Instead of a bash script, it's a Go loop. Instead of git commit, we update a JSON Notebook. But the philosophy is identical: The Context Window is a liability.

Most frameworks try to manage the context window like a precious resource. Ralph and Laconic treat it like a disposable napkin. Use it once, wipe the slate clean, and grab a fresh one.

It turns out that if you treat an LLM like a goldfish with a notepad, it becomes significantly smarter.

Conclusion

By treating context as a scarce resource and using a data structure (a Graph of Facts) instead of a text dump, we can make small, cheap models outperform the giants.

I am currently running this loop on 11,000 tickers that I'm missing basic information on. It will take a week, and cost some power, but I would have left the machine on anyway because I am running a few other things on it.

And if you want to find stocks that are going up, keep an eye on eh-trade.ca. My customers tell me I should brag more, so I'm up 280% in seven months following momentum strategies that it's showing on the main page.

I'll have the data soon, assuming my basement doesn't catch fire.