M
Memovable

In-Memory Context Optimization for LLMs

Trims chat context down to strictly relevant items before calling Gemini, Gemma, or OpenAI.

Get Started Try Demo

Interactive Demo

Select a query scenario to see context optimization in real time.

Unfiltered Context 10 entries
[USER]: Our Auth service crashed around 10:00 AM due to OOM kill on instance auth-prod-01.
[ASSISTANT]: Auth service OOM incident logged for instance auth-prod-01 at 10:00 AM.
[USER]: We deployed v2.4.1 of the Payment gateway service at 10:15 AM.
[ASSISTANT]: Payment gateway deployment v2.4.1 recorded.
[USER]: Who updated the IAM roles for the database cluster last night?
[ASSISTANT]: DevOps engineer Alex updated the DB IAM policies at 11:30 PM yesterday.
[USER]: The Redis caching layer went down at 11:00 AM due to connection pool exhaustion.
[ASSISTANT]: Logged Redis cache incident: connection pool exhaustion at 11:00 AM.
[USER]: We decided to roll back the Payment gateway service to v2.4.0 due to high error rates.
[ASSISTANT]: Payment gateway rollback decision logged.
Original Tokens
184
Optimized Tokens
30
Reduction
83.7%
Filtered Context Sent to LLM
LLM Response

Quickstart

Integration snippet matching your current environment setup.

$ npm install memovable
index.ts
import { Memovable, createGeminiHandler } from "memovable";

const geminiHandler = createGeminiHandler({
  apiKey: process.env.GEMINI_API_KEY,
  model: "gemini-3.5-flash",
});

const memovable = Memovable({
  tokensPerOptimizationCall: 2048,
  modelHandler: geminiHandler,
});

const existingContext = [
  { role: "user", content: "Our Auth service crashed around 10:00 AM due to OOM kill on instance auth-prod-01." },
  { role: "assistant", content: "Understood. Auth service OOM incident logged for instance auth-prod-01 at 10:00 AM." },
  { role: "user", content: "We deployed v2.4.1 of the Payment gateway service at 10:15 AM." },
  { role: "assistant", content: "Payment gateway deployment v2.4.1 recorded." },
  { role: "user", content: "Who updated the IAM roles for the database cluster last night?" },
  { role: "assistant", content: "DevOps engineer Alex updated the DB IAM policies at 11:30 PM yesterday." },
  { role: "user", content: "The Redis caching layer went down at 11:00 AM due to connection pool exhaustion." },
  { role: "assistant", content: "Logged Redis cache incident: connection pool exhaustion at 11:00 AM." },
  { role: "user", content: "We decided to roll back the Payment gateway service to v2.4.0 due to high error rates." },
  { role: "assistant", content: "Payment gateway rollback decision logged." }
];

async function runScenario(queryText: string) {
  const result = await memovable.optimise(queryText, existingContext);
  console.log("Tokens:", result.tokens);
  console.log("Filtered Context:", result.context);
  console.log("Response:", result.response);
}

runScenario("What happened with the Redis cache instance?");

API Reference

Memovable(options)

Configures the engine with token limits and handler adapter.

createGeminiHandler(options)

Direct client initialization for Gemini API endpoints.