Give your coding agent a memory
As I work more intensively with coding agents, I've realized that a long-term memory is important. Without it, agents are limited to knowing only what's happened in the current session.
Every day, new tools emerge on GitHub to solve this problem. To find the best tool for your needs, you'll need to try them out. My go-to tool is Engram, a Go binary with an SQLite backend that includes FTS5 full-text search capabilities and can be accessed via CLI, HTTP API, an MCP server implementation, and an interactive TUI.
Installing Engram
To get started with Engram, download the latest release from the GitHub releases page.
Configuring your Coding agent
Engram supports a variety of different agents, in my case I am using OpenCode. For OpenCode the installation procedure is as follows:
engram setup opencode
This command adds Engram as an MCP server to your coding agent's config file and installs a plugin for the chosen agent. The plugin ensures the memory is regularly updated.
Usually, the Coding agent plugin will make sure to update the memory in regular intervals. However, if you tell the agent to do so manually, it will also work. I sometimes do this to make sure the latest learnings are documented for future use.
Why Engram?
I chose Engram for several reasons:
- As a standalone binary with no extra dependencies, Engram is easy to install
- Engram integrates seamlessly with my coding agent, and the interaction via the agent is smooth
- The TUI mode is helpful for viewing documented memories
- Memory Sharing: Memories can be shared via Git with the development team or by running Engram as a self-hosted service
By using Engram, I've improved my coding agent's long-term memory, enabling it to learn and remember over time. Give Engram a try to see how it can enhance your coding agent's capabilities.
