Mental model
Design your app before you ask AI to build it
A volunteer needs a part for a repair. Who can ask for it? Who can approve the cost? What should the screen say while the answer is missing? You can decide all of that before anyone writes code.
RSX helps you build apps for the Internet Computer. Use this repair café example to make the decisions your AI will need, then check the plan it gives you.
Run by the café
Run by the treasurer
Give each fact an owner
An actor is a running part of your app with its own records and the final say over changes to them. On the Internet Computer it runs in a canister. Start with one canister. Split when you have a reason, such as separate control or a service that several apps share. Each split can add a step that needs a message and a reply.
In this example, the café runs Bench and the treasurer runs Fund. Bench keeps repair tickets. Fund alone decides whether to set aside money for a part.
Inside Bench, Tickets keeps the repair and who claimed it. Volunteers keeps the list of eligible volunteers. These are modules. Each acts on its own saved records and offers functions others can use. RSX keeps the saved records separate from the working code that is set up again on start or upgrade. If the volunteer list changes shape, the Tickets module can still ask the same eligibility question.
Say who can ask, and what answer they get
A canister method is an action someone can call. Name who may call it, what they provide, what comes back, and when it refuses. The app checks permission in the canister itself. Private module records control which code can reach the data. The canister’s permission rules control what each caller can see or change.
Anyone can open a repair ticket. An eligible volunteer can claim an open ticket if they hold fewer than two. Bench can check eligibility and record the claim in one local step without waiting. It checks before writing so a refusal leaves the records as they were. Only Bench can ask Fund about a part request, and only the treasurer can add to the budget.
Draw any step that needs a reply
The assigned volunteer asks Fund to reserve £12 for a part through their Bench ticket. Bench records the request as pending and messages Fund. Bench can handle other requests while it waits. Fund might already have decided by the time Bench hears back.
Give the request a fixed ID. Fund saves the decision under that ID with any change to its budget. On a repeat of the same request, Fund returns the saved decision. The budget changes once at most. If the reply goes missing, Bench keeps showing that it’s checking and looks up the outcome with Fund using the same ID. Until Fund has a decision, the ticket stays pending.
What does the volunteer see?
- Fund
- £12 reserved
- Bench shows
- Checking with the fund
Fund saved the decision. The reply went missing. Bench can ask Fund for the saved answer.
- Fund
- £12 reserved
- Bench shows
- Part funded
The approval reached Bench. The volunteer can order the part.
- Fund
- Budget unchanged
- Bench shows
- Funding declined
The fund had less than £12 available and sent a refusal to Bench.
Pick a tool for the job you need
| When your plan calls for… | Ask the AI about… |
|---|---|
| Seeing where each parts request is waiting | Takt saves a workflow’s progress so you can inspect its steps and decide what evidence moves it forward. |
| Queuing and retrying messages between canisters | Reactor handles delivery. A receipt for delivery can mean Fund stored the request. The funding decision is a separate result. |
| Checking the history of approvals and top-ups | Rechain can record accepted changes in order. You decide what history the app exposes and to whom. |
| Keeping each part request linked to a real ticket, or finding the oldest tickets | Ashroot can enforce that relationship with a foreign key when both records live in one database. An ordered index lets you read tickets oldest first. |
You can start with the basic canister and modules. Each tool earns its place by solving a problem in your plan.
Rehearse changes with saved records
Say you want to add an urgency level next month. Decide what urgency existing tickets get. Ask the AI to version the saved records and define their conversion. RSX checks that the new version expects the memory the canister already has.
Fill a test copy with realistic tickets. Try upgrading while funding is unresolved and check that the app refuses the upgrade safely. Settle it, then rehearse converting the old tickets and opening a new one. Test that a deliberately failed upgrade leaves the old release and data in place. Give the AI sample inputs and expected results for both the rules and the release.
Give your AI a brief it can plan from
Copy the brief and add what people need to do, who’s allowed to do it, and what rules must hold. For the repair café, one rule is “An eligible volunteer can hold at most two open tickets.”
Help me plan an app with RSX for Internet Computer canisters. My app and rules follow. Explain the plan in plain English before writing code. Check it against the RSX docs in this checkout.
Give each important fact one owner. Start with one canister and explain any split. Say who controls each canister, what each module saves, and which rules it checks. For each action, list who may ask, what they send, what they get back, and when it’s refused.
For a step that waits for another canister, show what the user sees on success, refusal, and no reply. Explain what keeps repeat requests from changing things twice and how we find out what happened. Suggest an RSX tool only if it meets a named need.
Give me tests with expected results for success, refusal, repeats, and a version change on existing records. Include what happens to open work during the upgrade. List the decisions I still need to make.Check the plan before asking for code
You should be able to point to who can change each record, trace a request when the reply goes missing, and explain what happens to old records on a new release. Ask for a worked example wherever the plan is vague.
- Add a feature. “Let volunteers transfer a ticket. Who can approve that, and how do we keep the two-ticket limit?”
- Walk through a failure. “The fund approved the part but the reply went missing. Show what the volunteer sees and how we find the saved decision.”
- Test a release. “Show the tickets you’d put in the old version, how the upgrade changes them, and how you’d check the new behavior.”
See the decisions in another app
Quickstart
Build a scores canister
Use the release tools to build and test a scores canister, or install the RSX skills in your app to guide a coding agent.
Compare how the SDKs keep data
RSX, Motoko, and DFINITY Rust
Three ways to keep canister data
All three can save state across upgrades. Which code you write depends on where you keep the data.
Scroll the table sideways to see all three approaches.
| Design question | RSX | Motoko | DFINITY Rust CDK |
|---|---|---|---|
| What you write | Rust with cdk-rsx | Motoko | Rust with ic-cdk |
| Where data lives | Each module owns the data it saves. Modules attach to one canister root. | The runtime keeps persistent actor fields in the retained heap. | You choose a stable-memory format or use collections from ic-stable-structures. |
| Changing saved data | The SDK checks which memory is installed. You write the conversion when the saved shape changes. | The runtime checks upgrade compatibility. Use an explicit migration for more complex changes. | You define the format and write the migration when that format needs to change. |
Store upgrades Motoko persistence DFINITY Rust CDK Stable structures