Neocortex Logo
Build a Stardew Valley AI villager mod with SMAPI and Neocortex: villagers who remember you, festival story beats, farming quizzes and voice commands.

Stardew Valley AI Villager Mod: Open Dialogue and Voice Commands

ModdingStardew ValleyAI NPC

Stardew Valley villagers have some of the best handwritten dialogue in any farming game, and players still run out of it by the second year. A Stardew Valley AI villager mod keeps those characters talking: open conversation that remembers your hearts, your gifts and the time you forgot a birthday. Neocortex gives your SMAPI mod AI characters, Conversation Flows for festival scenes, a quiz engine and on-device voice commands.

Stardew Valley in-game screenshot Screenshot: Stardew Valley © ConcernedApe

What you could build with Neocortex in Stardew Valley

Villagers who remember the relationship

Walk into the saloon and ask Abigail how her week went. At two hearts she is polite and short; at eight she brings up the cave you explored together and teases you about the amethyst you gave her three days in a row.

Your mod sends the facts with each message: heart level, gifts this week, season and day, the weather, and recent events like "player won the Egg Festival". The character keeps the session, replies with text and an emotion tag for the portrait, and can return actions your mod runs, such as { "name": "GIVE_ITEM", "targetId": "coffee" }. The handwritten dialogue stays; open conversation fills the gaps between it.

A festival scene as a Conversation Flow

The Luau is a natural fit. Mayor Lewis greets you, asks what you are adding to the potluck soup, and walks you through the Governor's tasting. A Conversation Flow steers the scene through checkpoints and returns keywords like INGREDIENT_ADDED, GOVERNOR_TASTED and VERDICT_GOOD. Your mod reacts to each one: a friendship bump for the whole town on a good verdict, an awkward silence and a grumpy Lewis on a bad one.

A farming trivia quiz

Add a trivia booth at the Stardew Valley Fair. A host asks "Which of these regrows after harvest: blueberries or melons?" and "How many days does a parsnip take to grow?" The quiz engine (Team plan) runs the questions, scoring and a leaderboard, and your mod pays out star tokens to players who know their crops.

Voice commands for farm tasks

Design a command set with actors ("farmhand", "me"), actions ("water", "harvest", "pet", "plant", "equip") and objects ("crops", "cows", "parsnip seeds", "watering can"). "Water the crops and pet the cows" arrives as two commands; "plant twenty parsnip seeds" arrives with the quantity attached. Your mod runs them on a helper NPC or on the player's own tools.

How Stardew Valley modding works

Almost every Stardew Valley mod runs on SMAPI (GitHub), the Stardew Modding API. In October 2026 the current release is the 4.5 line, for Stardew Valley 1.6.14 or later. Version 1.7 of the game has been announced without a release date.

SMAPI mods are C# projects on .NET 6 with a manifest.json. Your entry class subscribes to game events (day started, menu changed, button pressed, rendered) and reads game state directly. Because it is plain .NET, a mod can call a web API with HttpClient, show replies in the game's own dialogue box or a custom menu, and play a returned WAV clip through the game's MonoGame audio. SMAPI also reads a config.json for each mod, which is where the player's API key belongs.

Content Patcher (GitHub) loads content packs that edit game data, images and maps without changing game files. Use it for new portraits, a festival booth or handwritten fallback lines, and keep the AI logic in your SMAPI mod. The Stardew Valley Wiki modding pages cover both in depth.

Stardew Valley in-game screenshot Screenshot: Stardew Valley © ConcernedApe

How Neocortex fits in

  • Dialogue. The mod reads game state, sends it to a Neocortex character through /v3/chat, shows the reply as dialogue, plays the voice from /v3/audio/generate or /v3/audio/stream, and runs the actions the character returns.
  • Conversation Flows. Flows steer festival scenes and story beats and return checkpoint keywords the mod reacts to.
  • Quizzes. The quiz engine runs question-and-answer games through /v3/quiz.
  • Voice commands. The Neocortex Voice Commands library on the player's machine turns spoken phrases into game actions without a cloud round trip.

A minimal chat call from a SMAPI mod:

private static readonly HttpClient Http = new() { BaseAddress = new Uri("https://api.neocortex.link/v3/") };

private async Task<JsonElement> TalkTo(string characterId, string npcName, string text)
{
    var body = new {
        characterIds = new[] { characterId },
        message = text,
        playerId = Game1.player.UniqueMultiplayerID.ToString(),
        sessionId = this.sessionId,
        events = new[] { new { priority = 1, content = $"{Game1.currentSeason} {Game1.dayOfMonth}, hearts: {Game1.player.getFriendHeartLevelForNPC(npcName)}" } }
    };
    using var req = new HttpRequestMessage(HttpMethod.Post, "chat") { Content = JsonContent.Create(body) };
    req.Headers.Add("x-api-key", this.Config.ApiKey);
    using var res = await Http.SendAsync(req);
    var json = await res.Content.ReadFromJsonAsync<JsonElement>();
    this.sessionId = json.GetProperty("sessionId").GetString();
    return json.GetProperty("messages")[0]; // lines, actions, flowState
}

Characters are built in a visual node editor with personality, emotion, knowledge and voice nodes, so you can feed Linus a text file about his tent and his past. Up to six characters can share a conversation on Pro and Team plans, which suits a saloon night with Pam, Gus and Emily. See our comparison page for how Neocortex differs from other AI character platforms.

Getting started

  1. Install SMAPI and set up a C# mod project from the wiki's modder guide.
  2. Design your villagers in the Neocortex dashboard, plus a Luau flow and a farming question set. Test them in the browser.
  3. Design a command set for farm tasks, with a few example phrases per action.
  4. Connect from the mod. Call /v3/chat without blocking the game loop, reuse the sessionId, and map actions to game code.
  5. Keep the API key in config.json, filled in by the player, never hard-coded in a shared mod.
  6. Test on a single-player save with push-to-talk before anything else.

Voice Commands is a licensed SDK: contact us for a Voice Commands license.

Mod policy and fair play

Keep the mod free and non-commercial, and follow the rules of the site you publish on, such as Nexus Mods or ModDrop. Build for single-player saves; in co-op, use it only with friends who have the mod and agree to it. Each player uses their own Neocortex API key.

For the voice side in more depth, read on-device voice commands for game mods. Building for a different colony? See our RimWorld AI colonist dialogue mod and Minecraft AI NPC mod guides, or the full AI NPC and voice command mods index.

Tool versions and links checked October 2026. Modding tools change often; check each project's page for the latest release.

Frequently Asked Questions

Can you add AI dialogue to Stardew Valley villagers?

Yes. SMAPI mods are C# code that can read friendship, gifts and the calendar, call a web API and show text in the game's dialogue box. A Neocortex character can then reply as the villager, in character, with the relationship in mind.

Do Stardew Valley AI mods need SMAPI or Content Patcher?

You need SMAPI, because only C# code can make network calls and react to replies. Content Patcher is for content packs that edit data, images and maps, so it pairs well for portraits or handwritten lines, but the AI side runs in your SMAPI mod.

Will AI villagers remember my relationship with them?

They can. Your mod sends heart levels, recent gifts and events with each message, and Neocortex keeps the conversation session. The villager reacts to what actually happened on your farm.

Can I farm with voice commands in Stardew Valley?

A mod can turn speech into farm actions. Neocortex Voice Commands runs on the player's PC, matches phrases like "water the crops and pet the cows" offline, and hands your mod each command. It is a licensed SDK, so contact us for a license.

Written by

Neocortex

Date

Oct 20, 2026

Updated

Oct 20, 2026

Read time

6 min

Similar Posts

Read More