Inkstone LogoInkstone
v0.1.6 Documentation

Under the Hood

Everything that happens between you tapping Send and a character responding — explained without anyone needing an engineering degree.

00

The Big Picture

The TL;DR for the beautifully impatient.

Inkstone is a fully local AI roleplay companion. It connects to whatever AI provider you choose, wraps your characters and settings into carefully crafted instructions, and manages your conversations — all without a server. Everything lives on your device.

Your AI Provider

The service that generates responses

Your Characters

Who you're talking to

Your Persona

Who you are in the story

The Prompt Engine

How everything becomes AI instructions

Your Chats

Where conversations live and breathe

Five systems, zero servers. That's the whole philosophy in one sentence.

01

The AI Provider System

Inkstone doesn't ship with a brain. It lets you pick one.

Inkstone talks to whichever AI service you've set up, using the OpenAI API format — the industry standard most providers support. OpenRouter, DeepSeek, Z.AI, OpenAI, or any custom endpoint. Your API key is stored in your device's secure credential storage (the same system your phone uses for saved passwords). Never logged, never exposed.

Streaming

Watch responses appear word by word in real time. The parser is lenient — most providers work out of the box, even if they skip some metadata fields.

Error Handling

When something goes wrong, Inkstone extracts the most useful error it can. For streaming requests, it falls back to the HTTP status message. Always something actionable, never "Unknown error."

02

The Character System

More than a name and a greeting.

Characters are the heart of Inkstone. Each one is a structured card containing everything the AI needs to portray that role convincingly.

Anatomy of a Character Card

Name

Used wherever {{char}} appears

Description

Personality, appearance, background

Personality

Short, punchy personality summary

Scenario

The world context for the story

First Message

Opening line when a chat starts

Example Dialogs

Sample exchanges showing how they speak

System Prompt

Character-specific AI instructions

Post-History Instructions

Placed after chat history for extra influence

03

The Persona System

Not an existential question. Just a name and a description.

Your persona is who you are in the story. A name and a short description — that's it. It gets substituted wherever {{user}} appears in prompts and character cards.

One active persona applies across all your chats. Switch whenever you want, but the AI only sees the new one in messages that come after the switch.

Think of it as your nametag at a party. You can change it, but the people you already talked to will remember the old one.

04

The Prompt Engine

The most complex system you'll never have to think about.

Every time you send a message, Inkstone assembles your system prompt, character card, lorebook entries, and chat history into one coherent block that gets sent to the AI. Here's how.

Tokens

The chunks an AI processes text in. ~4 characters per token. "Roleplay" = 2 tokens. A paragraph = ~75.

Context Window

The AI's working memory. A desk with limited space. When it's full, something comes off the edge to make room.

Context Assembly Order

Every message you send, this stack gets built from top to bottom:

1
Pre-History Content
Your system prompt's opening section
2
Lorebook (Before Char)
World info injected before the character
3
Character Card
The full character — always protected
4
Lorebook (After Char)
World info injected after the character
5
Example Dialogs
First to go when space gets tight
6
Chat History
Your conversation — oldest trimmed first
7
Post-History Instructions
Character's final whisper
8
Post-History Content
MOST INFLUENTIAL position

The post-history position carries the most weight. Instructions placed there are the last thing the AI reads before responding — they have the strongest influence.

05

System Prompt Modes

Three flavors. All delicious.

A system prompt tells the AI what role to play, how to write, and what's allowed. Writing a good one from scratch is genuinely hard. Inkstone offers three modes so you don't have to.

Default

Evening-Truth

Carefully designed, lightweight, and character-driven. Five three-state toggles for content control (encouraged / allowed / forbidden).

SexualViolenceImmoralLanguageSFW Switch
Advanced

Marinara

Highly structured with six configurable settings. For those who want granular control over narration style.

TypeNarrationTenseLengthPOVContent
Blank Canvas

Custom

Two text fields — pre-history and post-history — that you fill however you want. Full macro support. Import SillyTavern presets here.

Pre-HistoryPost-HistoryFull Control

The SFW switch in both Evening-Truth and Marinara doesn't guarantee SFW-only content — it stops the model from being pushed toward NSFW. For strictest protection, use Evening-Truth with all categories set to "forbidden."

06

The Macro System

{{char}} walks into a bar...

Macros are placeholders in double curly braces. Write a prompt once with {{char}} and it stays accurate across every character and conversation. Inkstone resolves them at the last possible moment, right before the request is sent.

Character & User Macros

{{char}}

Character's name

{{user}}

Your persona's name

{{description}}

Character description

{{personality}}

Personality summary

{{scenario}}

Scenario field

{{persona}}

Your full description

{{mesExamples}}

Example dialogs

Dynamic Macros

{{time}}

Current time

{{date}}

Today's date

{{weekday}}

Day of the week

{{lastMessage}}

Most recent message

{{lastUserMessage}}

Your last message

{{lastCharMessage}}

Character's last reply

{{random::a::b::c}}

Random from your list

Macro Playground

Type macros below and watch them resolve in real time. Try {{char}}, {{user}}, {{date}}, or any from the list above.

Resolved output

Dear Ibara, it's Monday and I, Adventurer, want to tell you something...

Legacy SillyTavern shorthand (<USER>, <BOT>, <CHAR>) also works for compatibility with imported content.

07

The Lorebook System

A filing cabinet next to the AI's desk.

A lorebook is a collection of facts, lore, or instructions that get added to the context automatically — but only when they're relevant. Most of the time the drawers stay closed. When something in the conversation matches a keyword on a folder, that folder gets pulled out and placed on the desk.

Keyword Matching

Inkstone scans the last 2 messages (by default) for keywords. Matched entries get injected before or after the character card.

Budget Management

Default budget: 2500 tokens. Entries sorted by priority. When the budget's full, lower-priority entries sit this round out.

Constant

Always included. No keyword needed.

Selective

Needs primary + secondary keyword match.

Recursive

Matched entries trigger more matches. Use carefully.

You can see what lore is currently active in any chat via the Active Lore Entries panel in the chat options menu. It shows each entry and its remaining TTL turns.

08

The Chat System

Messages in, stories out.

Chats are where everything comes together. Each one pairs a character and a persona, holds the full history of your conversation, and stores every message locally the moment it's created.

Alternatives

Every response can have multiple versions. Regenerate and swipe between them — nothing gets overwritten.

Regenerate

Creates a new alternative for the last character message using the same context. Different roll, same setup.

Edit

Change the content of any message directly. Saved immediately, token count updated on the spot.

09

SillyTavern Import

We accept your preset baggage.

SillyTavern is the most popular AI roleplay desktop app. Inkstone can import its system prompt presets, but they need a translation layer — the converter turns them into Custom system prompts you can use and edit.

1

Reads all prompt blocks from the file

2

Resolves SillyTavern's variable macros ({{setvar}}, {{getvar}})

3

Strips structural markers and metadata

4

Sorts blocks into pre-history (opening) and post-history (closing)

5

Combines into a clean Custom system prompt

Always read the resulting prompt after import. The converter does its best, but complex presets may need manual tweaking.

10

Settings & Onboarding

Levers, switches, and a friendly wizard.

First Launch Wizard

Welcome
Provider
API Key
Persona
Ready!
11

Your Data

No cloud. No account. No drama.

Inkstone stores everything locally. There is no cloud account to delete, no support ticket to file. Your conversations, characters, API key, and settings never go anywhere except directly to the AI provider you configured.

Windows

C:\Users\[You]\AppData\Roaming\com.inkstone

Contains the SQLite database (chats, characters, lorebooks, settings, personas, prompts) and encrypted API key. Folder is hidden by default — press Win+R, type %APPDATA%, Enter.

Android

com.inkstone.inkstone (private storage)

Lives in the app's private internal storage. Not directly browsable without root — Android's sandboxing keeps apps from reading each other's data. API key encrypted via Android Keystore.

12

The Full Journey

From the moment you tap Send to the moment you see a response.

Every step happens on your device. Inkstone has no servers of its own.

You tap Send

Your message begins its journey

Saved locally

Stored in your device's database

Lorebook scan

Keywords checked against recent messages

Context assembled

8 layers stacked in the right order

Macros resolved

{{char}} becomes Ibara, {{date}} becomes today

Sent to your AI

The assembled context hits your provider

Response arrives

Streaming word by word, or all at once

Thinking separated

Reasoning content stored privately

Message saved

New alternative ready to view

UI updates

Swipe, regenerate, or keep the story going

Pop Quiz

When the context window fills up, what does Inkstone remove first?

That's the whole machine. Each system is designed to stay out of your way when you don't need it and be there when you do.