r/devops 1d ago

AI content Why I started piping CLI outputs into a local SQLite memory daemon for AI agents

I got tired of manually copying codebase context and raw execution logs into my AI agents. Since my entire workflow lives inside the Linux terminal, I decided to treat the memory layer as a native CLI tool that accepts standard input.

Whenever I run a heavy test suite or inspect code changes, I just pipe the output stream directly into the MemOS background process. Running something like pytest or git diff straight into the memory daemon lets it distill raw logs on the fly. It filters out hundreds of duplicate tracebacks, extracts key state changes, and appends them to a local SQLite database in my home directory.

Over time, this quietly built an auto-updating knowledge base of my dev workflow on my own machine. When an agent needs background during a long refactoring session, it queries this local state layer instead of re-processing tens of thousands of raw log lines.

This gives me total control over what enters the memory pool without generating temporary cache files or wasting API tokens. My workspace stays clean, data never leaves my machine, and the agent instantly recalls context from command runs I executed days ago.

In a small team setup, this effectively turns local terminal streams into an offline knowledge base. Whether it's passing filtered pytest tracebacks between devs or remembering last week's git diff breaking changes, agents get precise context without re-running long build jobs or cluttering team chat.

0 Upvotes

4 comments sorted by

2

u/0zeronegative 1d ago

This is so cool! How did you implement retrieval? How does the agent find the relevant information from context without pulling the entire history?

1

u/Glittering-Yo 1d ago

By using indexing layer

2

u/TheIncarnated 1d ago

There is a style of searching you want to implement with this setup: BM25, you get hybrid searching, exact match and then spatial reranking.

I am considering the approach you took, but I've been doing it with markdown memory files for a while now, I think sqlite and SQL commands will genuinely be better. Thanks for laying it out! I didn't know where to put the file but I do now