Basics of LLMs
An LLM is not a brain; it is an incredibly powerful token calculator. Treat it accordingly.
What it is
A Large Language Model (LLM) is a neural network trained on vast amounts of text data to predict the next word (or "token") in a sequence. When you give it a prompt, it calculates the highest-probability continuation based on the patterns it learned during training.
It does not "think" or "know" facts in a human sense. It maps statistical relationships between concepts. Understanding this probabilistic nature is essential for building robust agents, as it explains why models can hallucinate, get confused by poor formatting, or require specific phrasing to perform well.
Why it matters in production
If you assume an LLM is a reasoning engine with perfect recall, you will design fragile systems. Because they are probabilistic, LLMs will confidently invent APIs, hallucinate facts, or drift away from instructions if the context window gets too noisy.
In production, you cannot rely on an LLM to self-correct without explicit instruction. You must design fallback mechanisms, retry loops, and validation steps. A raw LLM is a vulnerability; an LLM governed by a strict state machine is a tool.
How Agenthood implements it
Agenthood abstracts the complexities of LLMs behind the ILLMProvider interface, allowing you to swap between the 7 shipped providers (OpenCode Go, OpenCode Zen, Anthropic, Groq, OpenAI, OpenRouter, and Ollama) without rewriting your agent logic.
The ILLMProvider interface is implemented at src/llm/ILLMProvider.ts (shipped in v2.0.0):
By forcing all LLMs through a unified interface, Agenthood ensures that provider-specific quirks do not pollute the core logic of the Society's members.
Hands-on example
To see how the Society interacts with LLMs under the hood, you can inspect the configuration of an existing member:
Or in TypeScript (available since v2.0.0):
Further reading
- ADR-005 — Orchestrator pattern
src/llm/ILLMProvider.ts— source implementation (shipped in v2.0.0)- Anthropic: Introduction to Prompting — excellent foundational knowledge