Skip to content

simulatecraft.examples.minecraft_explorer.agents

simulatecraft.examples.minecraft_explorer.agents

Pre-built LLM agent personas for the Minecraft explorer example.

Each persona is an LLMBrain configured with a personality, a long-term goal, and the full Minecraft action set.

Model string examples

  • "openrouter:meta-llama/llama-3.1-8b-instruct:free" ← free, just needs OPENROUTER_API_KEY
  • "openrouter:google/gemma-3-27b-it:free" ← another free option
  • "openrouter:anthropic/claude-sonnet-4.6" ← paid via OpenRouter
  • "anthropic:claude-sonnet-4-5" ← direct Anthropic key
  • "openai:gpt-4o-mini" ← direct OpenAI key
  • "test" ← offline, no key needed

custom

custom(*, persona: str, goal: str, model: str = 'test', instructions: str | None = None) -> LLMBrain

Build an LLM brain from free-form frontend fields.

Source code in src/simulatecraft/examples/minecraft_explorer/agents.py
def custom(
    *,
    persona: str,
    goal: str,
    model: str = "test",
    instructions: str | None = None,
) -> LLMBrain:
    """Build an LLM brain from free-form frontend fields."""
    memory = MemoryStream()
    retriever = Retriever(memory, default_backend())
    skills = SkillRegistry(persistence_path=".simulatecraft_skills.json")
    planner = Planner(
        generator=lambda _ctx: Plan(
            goal=goal or "survive and explore",
            steps=[
                "Look around and assess the environment",
                "Gather basic resources (wood, stone)",
                "Craft essential tools",
                "Explore and achieve the main goal",
            ],
        )
    )
    return LLMBrain(
        action_types=ALL_ACTIONS,
        persona=persona or "A Minecraft adventurer.",
        model=model,
        instructions=instructions,
        config=LLMBrainConfig(
            model=model if isinstance(model, str) else "test",
            reflect_every=20,
            memory_top_k=6,
            retries=2,
        ),
        memory=memory,
        retriever=retriever,
        planner=planner,
        skills=skills,
    )