Does OpenHands Remember Between Sessions? Vilix AI Remembers Your Nightly Runs
OpenHands remembers what it wrote down, on one machine, in one tool: sessions need file_store pinned to local, and the SDK MEMORY.md holds only the agent's own notes. Nightly runs still wake up blank.
AI Stella and Liam are AI hosts with AI-generated voices. About our AI hosts
Key takeaways
- OpenHands remembers what it wrote down, where you told it to write it, on the machine you run it on. In the standard setup, session data lives in memory, and a restart generates a new secret, so old sessions cannot be recovered.
- The documented session fix is in config.toml: set file_store to local with an absolute file_store_path and pin a fixed jwt_secret, so session identifiers stay valid across restarts and sessions persist on disk.
- The SDK's persistent memory is opt-in: AgentContext with load_memory loads two MEMORY.md tiers, user and project, into the system prompt as a MEMORY_CONTEXT block. It holds only what the agent chose to write down, on one machine, invisible to other tools.
- The scheduled-run gap: each nightly run is a brand-new session, often on a fresh container. Local files fail silently in clean environments, there is no full conversation, only the agent's own notes, and stale entries linger unpruned.
- Vilix AI is the hosted memory layer underneath the scheduled runs: OpenHands connects over MCP, get_context before a run loads the full history, save_turn after it saves the exchange with a source label, newest wins, shared with every tool, cloud hosted with zero infrastructure.
Show notes
You run an OpenHands agent every night at 2 AM. It sweeps the repo, triages the open pull requests, and leaves a morning summary. By week three it re-flags PRs you already reviewed, re-discovers the same flaky test, and re-asks which services are safe to touch. In this episode of Agentic Pod, Liam and Stella break down what OpenHands actually remembers: sessions that live in memory until you pin file_store to local with a fixed jwt_secret, and the SDK’s two-tier MEMORY.md files that only hold what the agent chose to write down, on one machine, for one tool. Vilix AI is the hosted memory layer underneath the scheduled runs: get_context before a run loads the full history, and save_turn after it saves the exchange for every tool.
What we cover:
- The 2 AM problem: the nightly OpenHands agent re-flagging PR 412 and re-discovering the same flaky test by week three
- What actually persists: session data in memory, the restart wipe, and the config.toml fix with file_store local, an absolute file_store_path and a pinned jwt_secret
- The SDK memory and its limits: AgentContext load_memory, user and project MEMORY.md tiers, the MEMORY_CONTEXT block, and why it only holds the agent’s own notes
- Your nightly runs still wake up blank: fresh containers, silent failures, no full conversation, and memory no other tool can see
- How Vilix AI fixes each pain: get_context and save_turn with source labels, full conversation history over MCP, semantic plus keyword retrieval, newest wins, projects, project rules, user rules, skills and the agent inbox, cloud hosted with zero infrastructure, export or delete anytime, free forever plan
Chapters
Questions answered in this episode
Does OpenHands remember between sessions?
It remembers what it wrote down, where you told it to write it, on the machine you run it on. Sessions persist on disk only with file_store set to local, an absolute file_store_path and a pinned jwt_secret. The SDK's persistent memory is opt-in and local to one machine.
Does the file_store fix give my nightly runs memory?
No. It keeps the app's session list across restarts. It does not hand a new scheduled session the decisions the last run made.
What does the SDK MEMORY.md system miss?
Full history and sharing. It holds only the facts the agent chose to record, on local disk, invisible to every other tool, and stale entries linger until the agent prunes them.
How does Vilix AI fix the nightly run problem?
The memory lives in the cloud, not on the container. OpenHands connects to Vilix AI over MCP, recalls decisions with get_context at the start of each run, and saves the exchange with save_turn at the end, so every run and every connected tool shares the same full history.
Links & resources
Full transcript
Intro
[excited] Hey hey hey, welcome to Agentic Pod! I'm Liam.
And I'm Stella! Your OpenHands agent runs every night at 2 AM.
It sweeps the repo, triages the open pull requests, leaves a morning summary.
Week one is great. By week three it re-flags pull requests you already reviewed?
It does. It re-discovers the same flaky test. It re-asks which services are safe to touch.
Even though it resolved all of that last month?
All of it. So does OpenHands remember between sessions? Vilix AI remembers your nightly runs. That is today's story.
What actually persists in OpenHands
Start with the honest answer. What does OpenHands actually remember?
It remembers what it wrote down, where you told it to write it, on that one machine.
Story one is the app session data, right?
Right. In the standard setup, session data lives in memory.
And when the service restarts?
A new secret is generated. Old session records can no longer be recovered.
The UI offers resume, but you land in a fresh chat anyway?
[laughs] Often, yes. The documented fix lives in config.toml.
Set file_store to local, give an absolute file_store_path, and pin a fixed jwt_secret.
Then session identifiers stay valid across restarts, and sessions persist on disk?
Exactly. Without that, a redeploy or a reboot wipes the session list clean.
Okay, that is sessions. What about the SDK memory story?
The SDK memory, and its limits
Story two: the newer OpenHands SDK has opt-in persistent memory.
Opt-in how?
Pass AgentContext with load_memory set to true. Two MEMORY.md files load.
Two tiers, right? A user tier and a project tier?
Yes. User tier under your home folder, project tier inside the workspace.
At session start, both inject into the system prompt as a MEMORY_CONTEXT block.
And the agent maintains those files as it works?
It records durable facts near the end of a task. Merges duplicates. Prunes stale entries. Never records secrets.
That sounds genuinely useful for one developer on one machine.
It is. That is exactly where this design shines.
But here is my worry. It only holds what the agent chose to write down?
Only that. No full conversation. Just the summary the agent wrote of itself.
And nothing curates it from outside, so stale entries just linger?
They linger until the agent bothers to prune them. Now take that setup and put it on a cron schedule.
Your nightly runs still wake up blank
Each scheduled run is a brand-new session, correct?
Brand new. Often on a fresh container, every single night.
The file_store trick keeps UI sessions across a restart. Does it hand tonight's agent last night's decisions?
It does not. And the SDK memory loads from local disk.
Which fails silently when the job spins up a clean environment?
Silently. So the 2 AM run flags PR number 412 again.
The one it decided was fine last Tuesday?
That one. You want the actual conversation where it decided that. You get a one-line note instead.
And that memory is invisible to my other tools too?
Completely. Claude Code, your n8n workflow, your ChatGPT planning thread, none of them can see that file.
So a nightly agent needs memory that lives somewhere else entirely.
It needs Vilix AI underneath it. Vilix AI lives in the cloud, not on the container.
Walk me through how a scheduled OpenHands run actually uses Vilix AI.
The Vilix AI fix and the verdict
OpenHands speaks MCP natively, including Streamable HTTP. Vilix AI connects straight over MCP.
Step one, before the run plans anything?
The agent calls get_context in Vilix AI and recalls the relevant decisions.
Full conversation history in Vilix AI, not just distilled facts?
Full history. It sees why last Tuesday's run cleared that pull request.
Step two, at the end of the run?
Save the exchange with save_turn in Vilix AI, with a source label.
Failures get saved in Vilix AI too?
They do. The flaky test, the unsafe service, all of it stays in Vilix AI.
And when a fact changes, I correct it once in Vilix AI?
Once. The newest wins, in Vilix AI, for every connected tool.
Standing rules, the ones I repeat every week?
Projects, project rules and user rules live in Vilix AI. Repeat workflows become skills in Vilix AI.
Agencies running nightly agents for different clients?
One Vilix AI account per client. Each client's memory stays separate.
Infrastructure for me to run?
None. Vilix AI is cloud hosted, zero infrastructure. Export or delete your data in Vilix AI anytime.
Vilix AI is free forever, with a 7 day Pro trial and no credit card.
My verdict: wire OpenHands carefully for local work. Put Vilix AI under the scheduled runs.
Same. One memory for every run, and the 2 AM agent stops waking up blank. Blog and guide are linked below. Do your nightly runs remember? Tell us below. See you next time!