How I Built the Restate Tutorial
When I started to learn Restate, I tried to use Kilo Code to build a simple framework on top of the Restate Go SDK. I find the Go SDK to be terse it borders on being poetic. The Restate examples serve as a good starting point, but they serve as more of placeholder for business logic and its structure. Being familiar with fluent-based programming from NodeJS, I tried to shoehorn that into the framework, but it didn't work out. The idea is to emulate Motia.dev's approach to building workflow automation, but with Go. I tried all free tier of popular LLMs (ChatGPT, Claude, Deepseek, Qwen, GLM, Kimi) and for some reason only Kimi made it to compile. See https://github.com/PithomLabs/restate-tutorial/blob/master/claude/examples/kimi/fxkimi.go
Next I also tried to emulate Delphi 7 style of event-driven programming. See https://github.com/PithomLabs/restate-tutorial/blob/master/claude/examples/delphi7/framework.go
I haven't found those examples appealing and I felt I am missing out on the bigger picture. After learning that Saga pattern is just a special case of a workflow, it dawned on me that this is the most complex of all the Restate service types and I need to get this done right if the framework would be useful to anyone.
I am trying to use the abovementioned LLMs and this time, the combination of Kimi and Claude made it to compile. The next step I did to make the LLM evaluation more effective was to use the llms-full.txt at https://docs.restate.dev/develop/ai-assistant#llms-txt-and-llms-full-txt, summarize it as do's and don'ts using NotebookLM and then use it to guide the LLMs in generating the code for the framework.
That was the insight to context engineering. Have the LLM a basis to evaluate its own output and make it better. I combined the do's and don'ts with the Restate AGENTS.MD and named it as DOS_DONTS_MEGA.MD.
I was doing all using the free tier available from Kilo Code. GitHub Copilot is also available and once you used all the free tier credits, that's the time to purchase credits from OpenRouter. That was for a month and then came along Antigravity IDE from Google.
The generous free tier made all the difference. I was cruising at high speed. I found that LLMs would make all crazy suggestions and I would have to reject them.
But one particular feature with Antigravity is that in planning mode, I will ask it to analyze the code, give a high level overview of the code and document its process as markdown files. That is in essence a sort of spec-driven development. You review the LLM's proposal and then you can either accept it or reject it.
One thing I made sure to do is to have the LLM ask me when to compile the code. Sometimes the LLM is overwilling to do its job and compile the code that is outside of the current folder.
You have to rein in the LLM and give it clear instructions on what to do and what not to do.
Next, I asked the LLMs to critique the flaws and limitations of the framework. Without clear evaluation guidelines like the DOS_DONTS_MEGA.MD, the LLMs would make nasty suggestions that the code is not worthy beyond what the standard Restate Go SDK provides. This reminded me of the Challenger mindset that led to its explosion and it won't be productive.
I have to establish a clear evaluation criteria for the LLMs to follow and that is the insight of DOS_DONTS_MEGA.MD. Sure the framework is not perfect, but it is a good starting point. It sure has its own flaws and limitations and that is exactly the point. Vibe coding, prompt engineering and context engineering will reach its limitations and that's where software engineering steps in.
The tutorials folder are all generated by LLM and not tested. The aim here is to skim the code and get a feel for the framework. There's even a bizplan folder on how to profit from this tutorial!
Under gemini/examples folder, the real meat is at rea-06-sonnet45 folder. I retained the old folders for reference while I am iterating on the framework. Some code compiles, some don't. The purpose is to put your QA hat and start tinkering.
I don't expect PRs for this repo. I expect you to profit from this tutorial and share your experience with the community.
However, I expect PRs for the pithomlabs/rea framework and that is where your support at https://ko-fi.com/pithomlabs will go a long way.
If we can build a market for technical support around this Restate tutorial repo and the Rea framework, the better and more successful we will be.
Please email at pithomlabs at gmail dot com, follow me at x.com/ibm2100.