Jason Davenport published the electric-sheep repository — a working demo project for long-term memory for AI agents based on Google ADK 2.0. The architecture uses an offline memory consolidation pattern: agent sessions are aggregated via BigQuery ML and then stored as embeddings in Cloud Spanner with search latency of less than 10 ms and zero LLM token consumption.

image
image

What happened

Jason Davenport published an article on Substack and the electric-sheep GitHub repository under the Apache 2.0 license. The project implements the AI Dreams concept — a memory consolidation mechanism similar to REM sleep in humans. Agent sessions are logged in BigQuery, then BigQuery ML via ML.GENERATE_TEXT with the Vertex AI Gemini 3.5 Flash Lite model offline-aggregates transcripts, extracts structured user preferences, and stores 768-dimensional embeddings in Cloud Spanner. The PreferenceAgent searches memory via COSINE_DISTANCE vector search in Spanner. The system includes two agents — InterviewAgent and PreferenceAgent, a Material Light web interface, Terraform IaC, and is deployed on Google Cloud Run in the davenport-boutique project.

Context

Long-term memory remains one of the key challenges for AI agents: without it, every dialogue starts from a blank slate, and agents lose context between sessions. Existing approaches — LangChain Memory, Mem0, and similar — usually require deploying specialized vector DBs (Pinecone, Weaviate, Qdrant) and consume LLM tokens on every search. The offline consolidation pattern proposed in electric-sheep moves all the heavy summarization work to an asynchronous stage, and memory search at runtime is done without an LLM call. This is analogous to the process of human memory consolidation during sleep: data is processed 'at night', and in the morning the agent has access to structured knowledge.

Why this matters for the industry

The project demonstrates a production-ready architecture pattern in which standard GCP services fully cover the agentic memory task without additional dependencies. Using Cloud Spanner for vector search instead of specialized vector DBs is a non-standard approach, showing the potential of managed BDDS with vector search support for enterprise scenarios. The pattern is applicable to any agentic framework, not just Google ADK. If confirmed under production loads, this could cause a shift towards using cloud databases instead of separate vector DBs, especially for teams on GCP. Google may document and promote this pattern as a best practice for ADK agents.

Why this matters for users

The electric-sheep project is a fully working reference with ready-made code, Terraform templates, and a step-by-step guide. Developers can deploy the demo to their own GCP project via Terraform and test the agent dreams concept in real scenarios. A working UI service is available at ui-service-834476222725.us-central1.run.app. The architecture can be adapted to existing GCP projects with agents without changing the main logic.

What is still unknown / limitations

This is a demo prototype with 13 stars on GitHub, not a production-ready solution. Load testing, memory extraction quality benchmarks, and a governance layer are missing. The embedding dimensionality — 768 dimensions — is relatively low, and without information about the embedding model, it is impossible to assess the loss of semantic information. The architecture creates a lock-in to the Google ecosystem. The cost of BigQuery ML and Spanner on real data volumes has not been evaluated.

Sources

Author

Look at AI, editorial team