Research Preview

MemFlow Relay

A local proxy that sits between your AI tools and Gemini, optimizing context without sending your Gemini API key to any third party.

Quick Start

pip install memflow-relay

pip install memflow-relay

MEMFLOW_API_KEY / GEMINI_API_KEY

export MEMFLOW_API_KEY=lago_…
export GEMINI_API_KEY=…

Your GEMINI_API_KEY is never sent to LamoonAGI or MemFlow cloud services.

memflow-relay doctor

memflow-relay doctor

memflow-relay serve

memflow-relay serve

Operating Modes

Operating Modes
ModeDescriptionRequest modifiedMeasures savingsApplies optimization
shadowShadow mode — measure savings without changing requests.✗✓✗
safeSafe mode — apply conservative optimizations.✓✓✓ (conservative)
optimizeOptimize mode — apply full context optimization.✓✓✓ (full)

CLI Commands

  • memflow-relay serve
  • memflow-relay doctor
  • memflow-relay stats
  • memflow-relay benchmark

Security & Privacy

Your Gemini API key stays local

GEMINI_API_KEY is used only by the local relay to authenticate with Google Gemini. It is never transmitted to LamoonAGI or MemFlow cloud services.

MemFlow API key

MEMFLOW_API_KEY (lago_ prefix) authenticates your requests to the LamoonAGI optimizer API only.

In shadow mode, the request sent to Gemini is always identical to the original request.

All logs, telemetry, and error reports automatically redact API keys and sensitive values.

Fail-open by default: if MemFlow is unavailable, requests continue to Gemini unmodified.

Powered by LamoonAGI Context VMM technology

MemFlow Relay · Lamoon AGI