Google Cloud’s Always-On Memory Agent Replaces RAG and Embeddings With Continuous LLM Consolidation on Gemini 3.1 Flash-Lite
Most AI brokers neglect. They course of a request, reply it, then drop the context. Google Cloud’s generative-ai repository now ships a sample that tackles this directly. It is the Always-On Memory Agent, a reference implementation that treats reminiscence as a operating course of.
Always-On Memory Agent
Fundamentally, the mission is a light-weight background agent that by no means stops. It runs 24/7 as a steady course of, not a one-shot name. It is constructed with Google ADK (Agent Development Kit) and Gemini 3.1 Flash-Lite. Notably, it makes use of no vector database and no embeddings. Instead, an LLM reads, thinks, and writes structured reminiscence into SQLite. The mannequin selection targets low latency and low price for steady background work.
How It Works: Ingest, Consolidate, Query
Architecturally, an orchestrator routes each request to considered one of three specialist sub-agents. Each sub-agent owns its personal instruments for studying or writing the reminiscence retailer.
First, the IngestAgent handles incoming content material. It makes use of Gemini’s multimodal capabilities to extract a abstract, entities, subjects, and an significance rating. That structured file then lands within the recollections desk.
Next, the ConsolidateAgent runs on a timer, each half-hour by default. Like sleep cycles, it evaluations unconsolidated recollections and finds connections between them. Then it writes a synthesized abstract, one key perception, and these connections to the database. Consequently, the agent builds new understanding whereas idle, with no immediate.
Finally, the QueryAgent solutions questions. It reads all recollections and consolidation insights, then synthesizes a response. Importantly, it cites the reminiscence IDs it used as sources.
Supported Inputs
Beyond textual content, the IngestAgent accepts 27 file varieties throughout 5 classes. Simply drop any supported file into the ./inbox folder for automated pickup.
| Category | Extensions |
|---|---|
| Text | .txt, .md, .json, .csv, .log, .xml, .yaml, .yml |
| Images | .png, .jpg, .jpeg, .gif, .webp, .bmp, .svg |
| Audio | .mp3, .wav, .ogg, .flac, .m4a, .aac |
| Video | .mp4, .webm, .mov, .avi, .mkv |
| Documents | .pdf |
How It Compares to RAG, Summaries, and Knowledge Graphs
To make clear the distinction, it frames three widespread reminiscence approaches. Each solves a part of the issue, but leaves a niche.
| Approach | How it shops | Active processing | Main limitation |
|---|---|---|---|
| Vector DB + RAG | Embeddings in a vector retailer | None | Passive; embeds as soon as, retrieves later |
| Conversation abstract | Compressed textual content | None | Loses element; no cross-reference |
| Knowledge graphs | Nodes and edges | Manual repairs | Expensive to construct and keep |
| Always-On Memory Agent | Structured rows in SQLite | Continuous consolidation | Query reads as much as 50 latest recollections |
Unlike RAG, this agent processes reminiscence actively, not solely on retrieval.
Use Cases With Examples
Practically, the sample suits any workload needing sturdy, evolving context. Consider three examples.
- A analysis assistant ingests PDFs, assembly audio, and screenshots all week. Later, it hyperlinks a value goal to a reliability drawback on its personal.
- A private information base absorbs notes, articles, and photos constantly. Over time, consolidation surfaces themes you by no means explicitly linked.
- A assist agent shops previous tickets as structured recollections. Then it solutions new questions with cited references to earlier instances.
Getting Started
With the design clear, setup stays minimal for early-level engineers. Install dependencies, set your key, then begin the method.
pip set up -r necessities.txt
export GOOGLE_API_KEY="your-gemini-api-key"
python agent.py
Once operating, the agent watches ./inbox, consolidates each half-hour, and serves an HTTP API on port 8888. Therefore, you can even feed it over HTTP.
# Ingest textual content
curl -X POST http://localhost:8888/ingest
-H "Content-Type: utility/json"
-d '{"textual content": "AI brokers are the long run", "supply": "article"}'
# Ask a query
curl "http://localhost:8888/question?q=what+do+you+know"
Additionally, the API exposes /standing, /recollections, /consolidate, /delete, and /clear. An optionally available Streamlit dashboard provides ingest, question, browse, and delete controls. CLI flags change the watch folder, port, and consolidation interval.
python agent.py --watch ./docs --port 9000 --consolidate-every 15
Key Takeaways
- No vector DB, no embeddings — an LLM reads, thinks, and writes structured reminiscence into SQLite.
- Runs 24/7 on Google ADK + Gemini 3.1 Flash-Lite as a light-weight background course of.
- Three sub-agents beneath one orchestrator: Ingest, Consolidate, and Query.
- Consolidates each half-hour — hyperlinks associated recollections and writes new insights whereas idle.
- Ingests 27 file varieties throughout textual content, photos, audio, video, and PDFs, dropped into
./inbox.
Check out the FULL CODES here. Also, be happy to comply with us on Twitter and don’t neglect to affix our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.
Need to companion with us for selling your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar and so on.? Connect with us
The put up Google Cloud’s Always-On Memory Agent Replaces RAG and Embeddings With Continuous LLM Consolidation on Gemini 3.1 Flash-Lite appeared first on MarkTechPost.
