Intro0:00
Hey everyone, welcome back to another Latent Space Lightning Pod. This is Alessio, partner and CTO at Decibel. And today, I have Akshay Agrawal from Marimo on the studio. Welcome.
Thanks, Alessio. Really happy to be here.
Yeah. Uh, thanks to Samuel Calvin from Pydantic to, for the introduction. You know, we saw him at the AI engineer summit in New York, and he was like, "You should have, you should have these guys on, on the pod."
So, um, and we've had previously, you know, Brian Bishop from Hex, who's now at Tier VC. So we covered notebooks in the past, and I think there's now a resurgence of AI plus previous data you access. We have a quadratic episode on the spreadsheet side.
So welcome to the show and maybe give people an introduction on Marimo and what you guys do.
Yeah, definitely. So Marimo is an open source notebook for Python, uh, that's built entirely from scratch, so it has no dependencies on Jupyter and is designed specifically for AI and data work. So some of the main things that are different from like traditional notebooks is, uh, Marimo has like reactive execution.
So you run a cell, Marimo knows what other cells need to run and also has built-in UI elements. And like the upshot of these things is that it lets you work with data and AI models in entirely new ways.
And it, it like really puts your data front and center i-in a way that sort of you don't see in, in traditional notebooks. And these things are a lot easier to demo, so we'll jump into a few demos in a bit.
But I guess a couple other things I'll say about Marimo and, and sort of the things that are, um, fueling sort of the, the strong traction that we're seeing is that, um, not only are they really good for rapid prototyping, they also let you go from prototype to production.
So they're like stored as pure Python, so you can version them with Git, you can share them as data apps, you can execute them as scripts or pipeline. Uh, you can... They have SQL built in, and you can connect to your own databases or data lakes.
So you can think of it as a modern replacement for not only Jupyter, but also Streamlit, Gradio, Papermill. And yeah, so w-we, we are seeing pretty strong traction this year. I think last I checked, over three hundred thousand monthly downloads on PyPi.
More GitHub stars than Jupyter Notebook for whatever that's worth. And we're used at companies like OpenAI, Hugging Face, Cloudflare, BlackRock, universities like Stanford and Berkeley. That's the-
Yes
... high-level overview.
Origin Story2:22
Yeah. How did you decide on the notebook shape? I think there is many critiques of Jupyter Notebooks from the kernel and like the way it interacts with AI models and IDEs. What was kind of like the initial idea maze that got you here?
Yeah. So I started working on Marimo after... So I, I was at Google Brain. It was a while ago, but I was an engineer on TensorFlow. And then after that, I did a PhD at Stanford in machine learning research.
And you know, one thing I noticed, and even for myself too, is that like people have a lot of complaints about Jupyter Notebooks, and you know, I did too, which is sort of why I'm working on Marimo today.
But at the same time, they, they provided something that was really invaluable for people who work with data and AI, which is the ability to, to write code and like interact with the output of the code, interact with your data in an iterative way.
And I think one thing that's constant, like, you know, back then it was machine learning, now it's more generative AI. The thing that's, that has been true is that you gotta look at your data, and notebooks are like really good for that, even though they, they have traditionally had like a lot of problem, other problems like hidden state, reproducibility issues, the file format making it, you know, unable to version with Git.
So after finishing my PhD, I noticed that, look, not only does a lot of data work start in notebooks, you know, with, you know, the rise of AI. So at that time, that was end of 2021, so ChatGPT, you know, was just bursting onto the scene.
I think it became clear, clear to me that people were gonna spend even more time working with data, evaluating model outputs and stuff. So I thought I wanted to design something that kept the interactivity that, that notebooks are really great for, but that had sort of the guardrails that like regular software has, like reproducibility, no hidden state.
You can actually reuse your notebooks as apps, as, as scripts. And yeah, so that, that sort of, that was the genesis of the idea.
Cool. Yeah, let's jump into a demo. I think, you know, most of the audience is technical, so feel free to, um, keep it engineering focused.
Awesome. So let me share my screen.
MNIST Demo4:27
Cool.
So I can share a few demos. So this is an example of a Marimo notebook.
You have cells of Python code, you have some markdown, and then you have some visual outputs. So this is, we're gonna start with classical machine learning with MNIST dataset, and then we'll go to some generative AI applications. So over here, we're looking at a, a scatter plot of a, a 2D embedding of MNIST, which is a dataset of numerical digits.
And so each different color in this scatter plot corresponds to a different digit. So one thing that is immediately different between how a Jupyter Notebook works and a Marimo notebook works is that this notebook is gonna react to my UI interactions and also my code interactions.
So what I'm gonna do here is I'm gonna hide the code. I'm gonna click this button, and then I get a at view sort of my notebook. One thing that I can do is that I can actually make a selection in this scatter plot.
And as I make this, you can see down below, I'm getting a live preview of the underlying images that have been embedded into 2D.
And workflows like this are like, one, I think really important whenever you work with data. Like you actually really need to see your data. And two, like very painful to like get working in traditional notebooks that are sort of based on Jupyter.
And in contrast, like if you look at the code for this notebook, it's really quite simple. Just a few lines of code, you create an Altair chart, and then you just wrap it in one special Marimo function. And that, that makes this thing totally interactive.
And then what's happening behind the scenes is that I have this chart object, it has a value property, and that value is just the data that's been selected. So if I select here, you'll see that a data frame gets sent back to Python, and you can see a, a visualization of it.
And then you have downstream code that can manipulate that data in any way. And so that's what I m-mean by reactive. I interact with a notebook, and then Marimo knows how to automatically update outputs.
And this is, um, one-to-one compatible with notebooks. So if I already have a notebook, I can just kind of copy-paste the cells over or what's the process?
Almost. So our file format is different. But yeah, you can copy past-- paste the, the files o- or the, the cells over, or we have a command line utility, Marimo convert my notebook to IPUMB to my notebook.py, and it'll do the conversion.
There are s- there are some restrictions on the kind of code that Marimo lets you write. Because Marimo does have a dependency graph basically on your cells, that's how it knows what cells to run, you can't redefine variables across multiple cells.
Uh, but our conversion tool will fix that up for you. And we have things like local variables and other things that sort of make that work.
Yeah. Um, awesome.
Yeah. And so I have these other little UI widgets here. I can click this widget, for example, and it changes the embedding. Again, like, if you were doing this in a Jupyter notebook, you would probably have copy-pasted the, all like six cells like multiple times, and then you wouldn't even have the sort of drill down interactivity.
Custom Widgets7:39
So that, that's one way, uh, that Marimo brings data to life in sort of a more classical sort of machine learning context. You can look at another demo. This one is pretty fun. It was made by Vincent Wormerdam, who is Marimo's resident creative genius.
And so this one-- Okay, so if you're looking at this, first thing you might notice is, okay, wait a minute. Notebooks are traditionally linear. You're looking at some columns here on the screen. We have three columns of code and outputs.
Um, Marimo is actually pretty flexible in like the way you can arrange your code, and we recognize that like, hey, monitors are wide, and you might wanna use that screen real estate. So you can configure it to show things in columns.
And the way that the order of execution works is just based on variable declarations and references, kind of like Excel in some sense, right? So you can have columns, things just kinda execute in the right way. So this notebook is is kind of fun.
So what we have here, we have a few cells. We have a little custom widget that Vincent vibe coded. It's Microsoft Paint in a Marimo notebook. And so what I'm gonna do here is I'm gonna draw in this widget.
And first thing you should see, um, as I'm drawing, my image is being rendered here on the right, and that's based on that reactivity. I'm gonna draw a little graph, and then this graph is gonna be used as part of the input to a query that I'm gonna make to a multimodal model.
And I'll ask Gemini to give me a representation as a mermaid. Okay. There we go. So I have the markdown code for the mermaid graph. And like, this is the kind of thing that you really don't think, if you think Jupyter Notebook, you don't envision yourself being able to make workflows like this for yourself.
But like, so I, I, I hope, like, a demo like this shows like how Marimo really makes you rethink what a notebook can do and really sort of brings your data to, to life in new ways.
Do you, do you have any kinda like AI native utilities to call these models or are people just writing like all the API calling code or do you think that's kinda like an interesting direction?
AI Utilities10:09
Yeah. So we do have some AI native capabilities to write these, uh, call these models. So I guess it's in a couple of modalities. So right now, this notebook is just calling the client API.
If you want to, you can just generate code. So speaking of, um, a recent podcast that y'all did for on Quadratic, the AI spreadsheet, you know, there we saw a lot that you could use natural language to generate code, and actually Marimo lets you do similar things.
So like I could...
There's a Generate with AI button here at the bottom, right? So I could write some code, I can tag data frames and other things that I have.
And, uh, I'm actually not sure what I wanna ask it to, to show here, but I could say, you know, create
matplotlib plot of a sine curve. And I can just do that. I'm missing some packages here that I'll need to install. And then we can try again.
Yeah. How do you do all the packaging? Is it there's like a requirements, a TXT file just like you would in a-
Actually it's-
Python script or?
Yeah. It's a little cooler actually than that. So we'll see if this ti-- So one thing that you'll notice that when I tried to run that Generate with AI code button and I didn't have a package installed, there was like a little toast that like said, "Hey, we can install this package for you."
And it just kinda did it. So we actually have a tight integration with, um, the UV package manager from Astral. So we can actually store dependencies in line in the notebook file itself, in like the notebook header, and this is something that UV supports.
So then you can just actually ship a notebook file around, and it contains all its dependencies. That's like kinda opt-in, uh, but that's o-one way... thing that like really
Makes notebooks a lot more reproducible. And so we'll see again, we don't have the packages, but I can install them.
And then there we go. They're installed, the cell reran, and I have sort of my output.
Um, yeah. So when you're asking AI to generate any AI-generated cell can kind of like, doesn't have to think about the broader requirements of the project.
Yeah. Yeah, that's right.
Nice.
And the AI has context to sort of like, uh, all, all the data frames, all the variables, uh, that you already have imported into your notebook as well. But yeah, it can, it can readily use
other modules, and will just sort of do the right thing.
Controller Demo13:07
I have another fun demo also made by the one and only Vincent Warmerdam, uh, that I kinda wanna show, and this is a, a demo s- sort of in the vein of bringing sort of data to life and like really working with your data.
This is like a data annotation demo. And one thing that you'll notice actually, so in my hands here, I've got a PS5 controller.
Yeah.
And you'll see this little thing here, MoPad widget, and it says, "GamePad connected." And I'm moving around my mouse, and you see some like inputs changing here. And so like to really drive home how interactive Marimo is and like how many different ways we can use to sort of interact.
Like, not only can you use your mouse to change UI interactions, you can build custom extensions to control your, the applications you make in a Marimo notebook with anything including a PS5 controller. So this demo here, we have like a bunch of papers from Archive, and we've indexed them using ChromaDB into like a, a basic vector database.
And now what we're gonna do is we're gonna make a query to get a bunch of papers related to data quality. And there's two embedding models, and the goal is to compare like which embedding model do, do we prefer.
So the embedding model embeds the query and then, you know, uses vector search to pull related papers. So if I submit this, I get a, a, a summary of the paper. In this case, it says, "We provide an overview of the standard data resources for training multilingual reasoning and out-- language models."
That seems sort of related to data quality, so I'm gonna accept this. And I could accept by clicking this button, but I can also accept it by pushing X on the gamepad. So I push X here.
Oh, way more fun.
Yeah. You see that goes through. You see that I have this editable data frame thing here that shows me the,
the annotation result. And I can just keep going.
I don't know. This one also seems sort of related to data quality. So maybe I'll say Accept.
This doesn't seem as related, so I'll say Reject. And what's happening over here is that I'm plotting the beta distribution of the two models to sort of get a belief of which model is better. And I can just kinda jam this quite quickly in a way that, you know, would be really annoying if I were using my mouse, and I would just quickly get carpal tunnel syndrome.
So another way that, like, Marimo really brings your data to life and really makes, makes your work a lot more interactive than it might be otherwise.
That's great. Can we maybe talk about the blank canvas AI use cases? So, you know, I wanna do some data analysis.
Blank Canvas15:52
Yeah.
I like the notebook-like UI. How do I start from scratch?
Yeah. That, that's actually perfectly teed up. That was the next demo. So this is how you'd start from scratch. This is an empty Marimo notebook. I'm gonna zoom in a bit. And so there is a code cell, and there's this Generate with AI button.
So to get started, I will just like populate this with some data. Um, and I'm gonna use Vega datasets. There we go. Import a data frame about cars. Okay, so I have a data frame. And I'm saying I'm kinda new to Polars.
I don't really know the syntax, but I kinda know what I wanna do. So you can click this Generate with AI button, and you can just start typing. So maybe the first thing I wanna do is get a histogram maybe of one of these columns just, just so I can see it sort of in more detail.
Uh, so I can say something like, "Generate a histogram of miles per gallon maybe
from..." And then I can give the data frame as context to, to whatever model I have connected. So I can just tag it with at, and you'll see here that if I, if I tag @df, it actually, it's gonna pass in all these columns and their data types as context to the la- to the language model.
If I do that, I hit Enter. It's gonna churn a little bit, generate some code. I can edit it a little bit, uh, to sort of clean it up. Don't need to convert it to pandas, then I can accept and just run it and then boom.
So you, you have your, you have your code. And so that, that kind of
really accelerates rapid prototyping, and you don't really have to leave your tab and go to ChatGPT. You can just do it entirely in here. And you can like just sort of vibe code your way through your entire analysis in this way.
And I guess like one thing that's kinda interesting to talk about that maybe is kinda subtle, but like if you think about doing something like this, um, I don't know, in Cursor or ChatGPT or something like this, what's unique about doing it in Marimo is the fact that not only does Marimo see your code, but it sees all the variables in memory, and it can also see your database connections, et cetera.
So it can really provide rich,
rich completions. So like it knows the name of the columns, for example.
How, how are you doing the context formatting? Like when you do at DF, are you showing that to the, to the model when you send it over?
Um, we like-- Basically, I think we do like DF.head to just like get like a preview of the columns, the data types, and then like a few sample rows, and just kinda shove that into the context window. Yeah.
So let's see. I can ask like another query, like maybe I can say something like, uh...
So this data set has cars by a bunch of different countries as well, and maybe I wanna understand sort of average statistics by country of cars. Like are US cars more efficient or less efficient than cars from Japan, et cetera.
So I can say something like, uh,
let me understand, uh, average statistics for, for DF
across origin column, which is the country. And then boom, it starts writing. Again, what's kinda cool is that you'll see it knows all the column names here. And then again, I can fix up the code a little. Accept.
Try it out. And there it is. Um, a lot faster than going to, to the API docs.
And we have other workflows too for, for working with AI. So you can also-- There's like a chat bar here where if you don't necessarily... If you want to sort of have a multi-turn conversation, you can execute it here as well.
And you-- We have a bring your own keys model. So right now I'm using an OpenAI key, but you can also use local models with Ollama or anything that you like really.
Sorry for jumping in late here.
WASM & MoLab20:15
Oh.
I think you probably guys-- Yeah, you guys probably discussed this earlier, uh, but this is all running in WebAssembly, right?
Um, actually not ex- not entirely. Marimo's actually... This is running just on my laptop, but we can run it in WebAssembly. So I guess similar to a Jupyter Notebook, Marimo is an open source package that you can just install and run wherever you like.
So pip install Marimo, run it on your laptop, run it on a cloud server, wherever you like. But to make Marimo really easy to share, we've also made it possible to run it entirely in WebAssembly. So actually, if you go to marimo.new, this opens a little notebook playground in your browser, and this is running entirely in WebAssembly.
So you can just...
Yeah, I was, I was just kinda curious if there's any part of the Python ecosystem that, you know, is not, uh, compatible with this. I'm not aware of what the restrictions are.
Yeah. No, so that's a great question. So if you're using Marimo, just the local library on your laptop, on the cloud server, you can use-
Everything. Yeah
... any kind of Python package you want. If you're using it in WebAssembly, so for example, in this playground, there are restrictions. So if you try to import Torch, it's not gonna work. It's not gonna be able to install it.
There are certain packages that just don't work. And actually, for that reason, so whereas I, I think the WebAssembly really like democratizes interactive computing to a large extent, it doesn't totally. So for that reason, our team has actually been really hard at work building a cloud-hosted Colab-like, uh, notebook that we're gonna give away to our community for free, and we're calling it MoLab.
This is like a preview of the page and-
Great name.
Yeah. It's a, it's a funny story. So Mo for Marimo, um, and it's at molab.marimo.
It's a pretty simple service. You can create a new notebook. You can import a notebook locally or from GitHub. And these run in cloud instances. Currently, they're running on modal. And so here you can use any package you like, but you can have configurable CPU and RAM.
You can also upload your own data, and we store them in Cloudflare R2 buckets.
You know, the name, I mean, one thing that's actually kind of funny for the origin story of this is that a lot of our users were asking us for something like Colab but based on Marimo. Actually, if you go to Google Colab's GitHub issues page, um, they have one, and sort by thumbs up, we are like, I guess the sixth or seventh most upvoted issue, support Marimo in Google Colab.
And I don't think Google was ever gonna do that anytime soon. So we decided to kinda just do something like that on our own. Uh, so that's sort of the origin for where MoLab came from. Yeah, it's a funny-- The, the issue was opened in June of last year.
It was one of our users who we've communicated with over our GitHub for, for some time. Um, yeah.
Amazing.
Future Plans23:21
What's kinda like missing here in your mind as you think about other things that you wanna add to it, like features or like maybe trying to break out of old habits? I think you've done a great job of keeping the familiarity of like cell-based execution, but adding things like column and things like that.
Um, yeah, what do, what do you think is next?
Yeah. So a bunch of... There could be a bunch of things. So in terms of like breaking out of old habits, you know, we talked a little bit about how Marimo has some restrictions on the kinda codes you-- code you write, and actually that ends up leading to much better code, 'cause you can't reuse-- you can't redefine variables.
You kinda have to write things in a functional way. So, so in that sense, it does sort of break some old, maybe bad habits. One of our users called this gentle parenting. Um, a-and another way of breaking out of the notebook that, that we actually do have, so I mentioned notebooks are stored as pure Python.
So if I go, uh, let's... I can open a notebook file, and we can take a look at what it actually looks like. Oops. You'll see it has a PY extension Embedding MNIST.py. I'm gonna zoom in, and you'll see it's just pure Python.
And this is generated for the user, but you can also edit it yourself. Every cell is decorated in an @.cell decorator, and there is an app.run sort of at the bottom, which suggests you can run this as a script, and, like, indeed you can.
So if I go to my terminal, and I can just use UV run embedding MNIST.py.
It just starts executing as a script. It loaded a cache data, so it did some other stuff that it didn't print to, to the terminal. So that's, that's one way that we help folks break out of a notebooking workflow.
The other way is you can actually run any Marimo notebook as a data app, uh, similar to Streamlit. So I can say Marimo run embedding MNIST.py, and then it'll, it'll run it as a read-only web app in my browser that you can also deploy and share with other, other users or, you know, maybe non-technical folks.
Do you see a world in which you made these write too?
So, so the, when I meant read-only, it just means that the, the consumer of the app can't change the code. But yeah, you can have, like... You can write to databases from the application and things like that. So definitely you can have write back, yeah.
Um, yeah. Other things that we're working on besides MoLab, we need to talk about improving, like, going further with the AI assistants that we have, you know. Agents are obviously sort of a natural thing to, to think about.
There's actually a really cool project by a PhD student at Stanford where they, they work in genomics, and they actually forked Marimo. They have a project called Marimo Agents, and they added a new type of cell, an agent cell, where you can type English, and then it kicks off an agent that generates your Python code and then adds it to your notebook, and then you have a record of the prompt.
So things like that we're looking into exploring too.
Outro26:45
Nice. Um, awesome. I thought this was great. Any call to action for folks? Are you hiring? Are you looking for obviously more users? Uh, anything?
Yeah, we're always looking for more users. So if you wanna try Marimo, easiest way to get started on your own machine is to pip install it and then just write Marimo tutorial intro. Pip install Marimo, Marimo tutorial intro will get you s- get you going.
Try out MoLab if you want a cloud-hosted experience of being able to use any package, sharing notebooks with links, like, just like you would with Colab. So that will be at molab.marimo.
Otherwise, we love contributors. We have over a hundred open source contributors. Come follow us on socials. We're, uh, marimo_io on Twitter.
Yeah, I think this, this mission is great. And no, I think notebooks are still underrated by a lot of people and, like, requires a dedicated team with, like, a strong vision like you have to reinvent one of the core workflows of most, uh, research scientists and engineers.
Appreciate it.
Awesome, Akshay. Thank you so much.
Thank you, guys.





