Docs menu

The day planner

Once its first day's work is done, the bot plans its own days. Code keeps a diary of what happened, the AI model reads it and picks what to do next, and code does the work.

The model only chooses. It picks from a fixed list of goals the bot already knows how to do, and every choice is checked before it runs. It never writes code and never moves the bot itself.

The diary

The bot writes one short line for each thing that matters, under the day and the part of the day (morning, afternoon, evening, night). The lines are written by code, not by the model.

What goes in:

  • What you said to it, and whether your order was done, failed or stopped by you.
  • Its own jobs: done, or given up when it got stuck.
  • Milestones reached, and ones that failed, with the reason and the place.
  • Plans made, and each step: done, failed, skipped or left out.
  • Deaths, with the place and the mobs that were near.
  • Nights spent in the shelter, things you gave it, and shifts of its job.
  • One line a day for what it picked up.

Reflexes and small chores are not written down. A line that repeats is counted instead of written again.

It keeps the last 3 days line by line, up to 100 lines a day, and a short summary of each of the last 30 days.

You sayIt answers
what did you do today?The last lines of today's diary. Answered in code, so it works without the model. "How was your day?" and "read me your diary" work too.
what happened yesterday?Yesterday's summary. This one goes through the model.

When it plans

The bot plans for itself only when its own life is on and the first-day milestones are done. See Its own life.

WhenWhat happens
At duskOnce a game day it plans tomorrow, whatever it's doing.
With nothing left to doWhen the plan is finished it asks for the next one, and stands still for the few seconds that takes.
After a failureA step that really failed asks for a new plan at once, so the model decides what to do about it.
After a deathIt plans again from where it stands.
When you joinA fresh plan for a day with you in the game.
When you askSay what you'd like its day to be. This plan replaces the old one right away.

what's your plan? tells you the plan it has, answered in code.

What the model reads

Every plan is made from the same picture of the bot's life:

  • Why it's planning, and what just failed, if anything did.
  • Where it is, the time of day, its health and food, and the mobs that can reach it.
  • Its tools, its shelter and bed, its job, what it carries and what's in its chests.
  • The milestones done so far and the last plan, step by step.
  • Today's diary in full, the earlier days it still has line by line, and every day summary.
  • Its lessons.
  • The list of goals, each marked possible or not possible right now.

What a plan is

A plan is 3 to 8 steps. Each step is one goal with its details and a short reason. With it come a sentence or two for you, said in chat when the plan changes, and a summary of the day so far for the diary.

GoalWhat the bot does
Reach a milestoneWorks toward one of its milestones.
Stock foodHunts, picks berries and cooks.
Rest and repairGoes home, mends the shelter, stores things, cooks, smelts and replaces worn tools.
Gather woodChops 4 to 64 logs.
Mine forMines until it carries the amount asked of coal, raw iron, diamonds or cobblestone.
CraftMakes an item, getting the materials first.
CollectGets a raw or smelted material, looking in its chests first.
ExploreWalks somewhere new, looking for animals or sheep.
HuntHunts one kind of animal: cows, pigs, sheep, chickens or rabbits.
Go fishingFishes from a shore, by day.
Tend the farmHarvests, sows again, mends the field and bakes bread.
Plant treesPlants the saplings it carries near its base.
Mend the mineRepairs, lights and seals its mine.

How a plan is checked and run

Before a plan is kept, code goes through every step:

  • The goal must be one of the list, with its details in range.
  • It must be possible now: the right pickaxe for the ore, a field before tending it, a recipe before crafting.
  • It must not be a job that already failed 3 times today.
  • It must not send the bot into a place you marked as off limits.

Steps that don't pass are left out and noted in the diary. If fewer than 3 are left, the next open milestones fill the plan up.

The steps then run one at a time, in order, each for 15 minutes at most. Your orders, the reflexes and the night cut in as they always do; the step picks up again afterwards.

  • A step is checked once more as it starts. If it can't be done from where the bot stands, like fishing with no water near, it's skipped. That isn't a failure.
  • When a new plan arrives, the step that's running finishes first. Only a plan you asked for stops it.
  • At night, after it has been attacked, only work in the mine goes on. The rest waits for morning.

When a step fails

A failed step is kept with its exact reason, the place and the time of day, and goes into the next plan's picture.

  • A new plan is asked for at once. If the next tries fail too with nothing done in between, the wait grows: 1, 2, 4, 8, then 15 minutes.
  • The same job failing 3 times in a day is off the list until tomorrow. A job is counted by what it's for, not by how much was asked: 10 iron and 20 iron are the same job.
  • Waiting is not failing. Being too hurt or too hungry for the mine, or being kept in at night, is written down but never counted, and the plan goes on.

Lessons

About once a game week, at dusk, the model rewrites a short list of lessons from the diary and the day summaries: at most 12, each a sentence or two. The first list is written once 3 days have summaries.

Every plan reads all of them, and so does the model when you chat with it.

The spending cap

The AI model costs money for every call. The bot counts each call at the model's list price and adds it to the month's total.

LLM_MONTHLY_CAP_USD is the most it may spend in a calendar month. The default is 10. At 0 it makes no model calls at all.

Its own planning is paced. Day plans and lessons may use up to 80% of the cap, spread over the month day by day; days it spent little carry over. The rest is always there for your chat. There's a second limit of 20 plans an hour. Plans you ask for and your chat are never paced.

At the cap, until the next month:

  • The words answered in code keep working: stop, come, follow me, status, where it is, its diary, its plan, its job and its spending. They're listed in Talking to the bot.
  • Any other message gets a short reply saying this month's budget is used up.
  • It makes no new plans and lives by its milestones.

how much have you spent? gives you the month's total, the cap, the number of calls, and the split between chat, day plans and lessons.

Without the model

  • With no OpenAI key the bot doesn't start.
  • If a planning call fails or takes longer than 45 seconds, it doesn't plan for 10 minutes and works on its next milestone. Steps of a plan it already has keep running.
  • If a chat call fails, it says so and you can try again. The words answered in code still work.
  • With its own life off, it doesn't plan at all.

The numbers on this page are the ones in the bot's code, in src/planner.