DEV Community

Cover image for Building GODS vs AGENTS: an architecture for belief under uncertainty
Harish Kotra (he/him)
Harish Kotra (he/him)

Posted on

Building GODS vs AGENTS: an architecture for belief under uncertainty

How do you make a simulation about religion without reducing humans to rules and canned dialogue? GODS vs AGENTS starts with one boundary: physics can be deterministic; meaning cannot.

The app is an interactive research simulation where the player is an unseen force. You can send rain, split a tree with lightning, heal someone, or darken the sky. You cannot explain why. The village must do that work itself.

The central system decision

The easiest version of this app would assign “faith +5” after a lightning strike. That is precisely the version we are avoiding. Belief is not a score; it is a changing set of claims with causes, confidence, relationships, memories, and social provenance.

The central system decision

The same strike may create several competing theories. A farmer may see an angry sky spirit; a healer may see an ordinary storm; a politically ambitious priest may see an opportunity. The server does not declare which explanation is “correct.” It records that a tree split, and agents reason from their own context.

The current product slice

The first shipped slice is deliberately honest: a specimen world rather than fake autonomy. The visual system is a ritual atlas—an illustrated field, archival notes, and an omen wheel—because an operations dashboard would undermine the premise. The player is meant to watch an unknowable force’s consequences, not manage a spreadsheet.

The web app is built with Next.js, React, TypeScript, CSS, and Framer Motion. The small FastAPI service models the deterministic world contract.

@app.post("/miracles", response_model=WorldState)
async def invoke(command: Invoke):
    effects = {
        Miracle.rain: ("weather", "rain"),
        Miracle.drought: ("food_supply", -.12),
        Miracle.heal: ("health", .09),
    }
    # Mechanics are explicit, deterministic, and easy to test.
Enter fullscreen mode Exit fullscreen mode

The frontend does not receive or store credentials. Its “cognition awaiting a mind” state is a product requirement, not just an onboarding state. Without a model, the user can explore the specimen and trigger visual effects, but it cannot claim that anyone thought anything new.

The planned agent loop

Agno is a natural fit because every citizen can be modeled as an independently configured agent with a provider abstraction. A production action should be small and observable:

async def interpret(citizen, event):
    memories = await memory.search(citizen.id, event.embedding, limit=6)
    response = await citizen.agent.arun(
        make_prompt(profile=citizen.profile, event=event, memories=memories)
    )
    claims = parse_claims(response.content)
    await belief_graph.upsert(citizen.id, claims, source_event=event.id)
    await memory.store(citizen.id, summarize(response.content))
    return claims
Enter fullscreen mode Exit fullscreen mode

The crucial optimization is memory retrieval. Forty agents with entire histories would be slow, expensive, and incoherent. Store structured memories and LLM summaries, retrieve only the few most relevant items, and periodically compress old material. The belief graph should preserve provenance: “Mara believes X because she saw Y and later heard Z from Oren.”

A provider-neutral architecture

Provider configuration stays server-side and supports hosted or local inference. A user with no cloud key can use Ollama or LM Studio via an OpenAI-compatible base URL. The rest of the system should only know about an interface such as generate() or an Agno model object—not whether the provider is OpenAI, Anthropic, or a laptop-local model.

A provider-neutral architecture

Where contributors can help

The best next contributions are structural: SQLite repositories, a versioned belief graph, Agno provider adapters, and a WebSocket event stream. Creative contributions are equally welcome once they preserve the core rule: miracles change the world; agents create the explanations.

That separation is what makes the project more than a simulation. It is an instrument for watching causality become culture.

Code & more: https://www.dailybuild.xyz/project/214-gods-vs-agents

Top comments (0)