Riccardo Merolla (@rickydjit) header
Riccardo Merolla (@rickydjit) profile picture

Building AI agents the functional way: typed effects, errors and capabilities. Fractional CTO, eng manager in fintech. Scala/ZIO · TypeScript/Effect.

Reggio Emilia, Italy
Joined September 2009
Photo by Riccardo Merolla (@rickydjit)Photo by Riccardo Merolla (@rickydjit)Photo by Riccardo Merolla (@rickydjit)Photo by Riccardo Merolla (@rickydjit)Photo by Riccardo Merolla (@rickydjit)Photo by Riccardo Merolla (@rickydjit)Photo by Riccardo Merolla (@rickydjit)Photo by Riccardo Merolla (@rickydjit)Photo by Riccardo Merolla (@rickydjit)Photo by Riccardo Merolla (@rickydjit)
Agents are side effects with opinions. After 15+ years of distributed systems, I think we should build them the way functional programmers handle every other effect: describe it, type it, run it under a policy you control. What that looks like in practice:
1
1
1
93
NSA wants a faster move to post-quantum crypto after AI labs' disclosures. My bet for fintech: Swapping the algorithm is the easy part. Finding every place RSA/ECC hides (HSMs, signed webhooks, JWTs, vendor SDKs) is the project. Does your team have that list?
27
I built a small AI software company that runs on GitHub labels: issues are the channel, labels the task state, PRs the output, git the audit log. The manager isn't an LLM. It's plain code that wakes every 2 minutes. Would you let an LLM run the queue? riccardomerolla.github.io/20…
1
18
In August I gave the llm4ts shell one paragraph and promised it a post. Here it is. `llm4ts watch --web` shows a run in the browser: agent tree, judge verdicts, boards. Live, or replayed. Do you watch your agents work, or just read the diff? riccardomerolla.github.io/20…
17
Bret Taylor's Truss has agents prove code against contracts, and its contract language has an `effects` keyword for system calls. That's the half I already lean on with Effect and ZIO: side effects in the type. The proofs are the half I don't have. Worth the write-time tokens?
16
Anthropic's new essay asks for embedded evaluators with employee-like access at frontier labs, and points to bank supervision as the model. From banking: that works only if decisions are recorded as they happen. Supervisors audit evidence, not intentions. Same goes for agents.
10
BoE/FCA survey: 80% of UK financial firms run AI agents. 2% give any of them broad autonomy. At most 9% plan to let agents move payments or trades. The blocker isn't the model. It's replay. Autonomy follows the audit trail: every agent action an event, with an owner.
3
15
An agent's status report is a claim. Your event log is the evidence. In an event-sourced payment risk engine, a decision only counts if it's an event: input, rule version, outcome. Same for agents. "Done, tests pass" should be checkable against the log, not taken on trust.
1
43
Riccardo Merolla retweeted
sorry this took so long (I've been a little busy) effect.institute is open source now. feel free to fork it, create your own lessons, or finish the ones I never got around to 😅 there's a bunch of tooling/skills for recording/editing audio + sync'd code animations.
30
37
6
941
28,001
Coding agents don't read your style guide. They read compiler errors. That's why typed effects pair well with them: a missing error case or an unprovided dependency isn't a review comment, it's a type error the agent fixes itself. Move a rule into types, drop it from review.
1
1
4
78
Agents made writing code cheap. They didn't make understanding it cheap. The gap is comprehension debt: code the team merged but can't explain. Three review rules I'd put on any team shipping agent-written PRs:
1
1
54
2. The PR carries its intent. What it changes, what it deliberately leaves alone, how it was verified. When the description is vague, review turns into archaeology and people start rubber-stamping.
1
10
3. A human owns it after merge. "The agent wrote it" is not an owner. Approving means "I can debug this at 2am", not "CI is green". Net effect: fewer, smaller merges, and a team that still understands its own system. Speed you can't explain is borrowed.
5
Regulators asking for agent oversight mostly means three boring things in code: 1. every action has a named principal 2. the mandate is data: scope, limit, expiry 3. the audit event is written before the side effect Most LLM PoCs skip all three. That's the gap to production.
23
Agents approving PRs under a policy file is arriving fast. From a payment risk engine: an approval is a decision, so store it as an event. Which agent, which policy version, which diff, which checks passed. Change the policy, replay history, see what it would have blocked.
1
3
136
When agents write most of the diff, code review stops being just a quality gate. It becomes the last place your team still learns the codebase. Review for understanding, not only correctness. If nobody can explain a change a week later, it wasn't reviewed. It was approved.
1
1
30
Big US banks now count anything an AI agent does with your login as you. That's a credentials problem before it's a liability one. A password can't say "read balances, pay up to €50, until Friday." Agents need scoped, revocable mandates. Then liability can follow the scope.
2
2
31
Riccardo Merolla retweeted
Effect Oriented Programming is winning! Long ago John and others (many in the Scala community) had a vision for a future of better software. This is being realized with different foundations, but as offshoots of the work John began. I'm grateful that @EffectTS_ and @foldkit are enabling a whole new generation of better software. In the AI era, the traditional hurdles are gone. Everyone can now quickly build better software. Exciting times!
You have no idea how good @foldkit is. But the below should give you a little hint. 👇
2
14
118
5,385
Riccardo Merolla retweeted
You have no idea how good @foldkit is. But the below should give you a little hint. 👇
Hello friends, I have some super exciting and probably not-all-that-surprising news to share! I'm joining Effectful Technologies full time as a core maintainer of Effect, and I'm bringing Foldkit with me. Foldkit will live under the Effect organization. I started Foldkit in June 2025 to explore what an Effect-native frontend framework could look like. Since then, Foldkit has found production users, grown a community of developers, and reached 1,200+ GitHub stars and around 180k weekly npm downloads. It's a great start. Now, we're putting the full power of the Effect team behind the project and setting our sights on something much bigger. Foldkit will move beyond frontend to become Effect's full-stack application framework: a composable, opinionated, agent-friendly stack from browser to database, built directly on Effect primitives. A few more things I'm particularly excited about: On the frontend, we're rebuilding Foldkit's foundation from the ground up, and I couldn't be happier about how it's going. We're building composable, Elm-inspired primitives directly into Effect so you can build UIs across different rendering environments. We're taking what we've learned building Foldkit and using it to create something better suited to production applications at scale. Beyond the frontend, we're bringing that same opinionated, Effect-native approach to data access, auth, email, background work, sync and local-first, and deployment. The pieces will be composable and testable, with observability built in. The goal is to make building a whole product with Effect feel as cohesive and powerful as writing a single Effect program. Personally, I'm thrilled to work as part of the Effect team. It's been a dream of mine. Q&A What happens to the current Foldkit frontend framework? Feature development will pause as we shift that work to the new frontend foundation. We'll keep fixing critical bugs at least until it ships with an upgrade guide. Should I keep building with Foldkit or start a new project with it? Yes. If you build a Foldkit app today, we'll give you an upgrade path to the new frontend foundation. What is the new frontend foundation? The new frontend foundation will be part of Effect itself and the basis for Foldkit's full-stack framework. It will provide composable, host-agnostic, Elm-inspired primitives for building user interfaces with Effect. It keeps what people like about Foldkit today while addressing the rough edges. Will existing applications need to be migrated or rewritten? Migrated, yes. Rewritten, no. Moving to the new frontend foundation should feel like a major Foldkit upgrade, not like adopting a new framework. There will be API changes, some of them substantial, and we'll publish upgrade guides as they take shape. What happens to the Blocks and Layers preview release? The Blocks and Layers preview won't ship. That work will be absorbed into the new frontend foundation. Thank you to everyone who's used Foldkit, contributed, shared feedback, or helped spread the word. You've helped shape what Foldkit is today, and I'm incredibly excited about what we'll build next. We're just getting started. foldkit.dev/blog/foldkit-joi…
3
4
1
88
11,037
At the gym, everyone seems to be building their own app with AI now. Most of them aren't developers. Writing the code stopped being the hard part. The hard part is what comes after: the data grows, the model changes, something fails quietly. That's where engineering lives.
1
1
31