


























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.

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.
Most "AI Agents" are built on a simple loop, often called ReAct (Reason + Act). It looks like this:
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.
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.
If we extract these facts and throw away the rest, we can compress megabytes of web pages into a few kilobytes of JSON.
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.
Laconic uses a specific strategy called graph-reader.
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)
}
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.
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:
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.
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.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。