explaingit

se7en3595-bit/memory-optimizer

Analysis updated 2026-05-18

0TypeScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

Middleware that automatically compresses long AI conversations by offloading heavy content to files and inserting short references.

Mindmap

mindmap
  root((memory-optimizer))
    What it does
      Token compression
      Content offloading
      On demand retrieval
    Tech stack
      TypeScript
      Newmax
      Mermaid
    Use cases
      Long conversations
      Debugging artifacts
      Drop in install
    Audience
      AI tool developers
      Newmax users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Reduce token usage in long AI chat sessions that include lots of search results or code.

USE CASE 2

Debug what content was offloaded by reading the stored .md and .mmd files directly.

USE CASE 3

Drop the middleware into an existing Newmax setup without changing the conversation logic.

USE CASE 4

Retrieve offloaded content on demand using the memory_retrieve function.

What is it built with?

TypeScriptNewmaxMermaid

How does it compare?

se7en3595-bit/memory-optimizer0xradioac7iv/tempfsabboskhonov/hermium
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires an existing Newmax installation to plug the middleware into.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

This is a token compression middleware for an AI conversation platform called Newmax. In AI chat tools, tokens are the units of text the AI processes, and there is a limit to how many tokens can fit in a conversation at once. Long sessions with many search results or code snippets can fill that limit quickly, which can degrade quality or cause errors. The tool automatically monitors conversations as they grow and detects sections containing heavy content, such as search results or code, then moves that content out of the active conversation window into external files stored on disk. In place of the removed content, it inserts a compact reference using a Mermaid format diagram node and a short identifier. When the AI needs to look something up from the offloaded content, it calls a memory_retrieve function to fetch it back on demand. The offloaded content is stored as readable .md files organized by conversation ID, plus .mmd canvas files that capture a task graph for the session. This makes debugging straightforward, since all stored artifacts are human-readable text rather than a hidden database. According to the benchmark table in the README, this approach reduced token usage by about 61 percent on a search-heavy test case called WideSearch, 33 percent on SWE-bench, and 31 percent on AA-LCR, with task success rates improving by up to 51.52 percent. Installation is described as a drop-in single-file middleware: copy the files into the Newmax skills directory, then register the middleware and tools in configuration files. The library is written in TypeScript and released under the MIT license.

Copy-paste prompts

Prompt 1
Explain how the memory_retrieve function fetches offloaded content back into a conversation.
Prompt 2
Walk me through installing memory-optimizer into my Newmax skills directory.
Prompt 3
Show me the configuration options for min_token_count and preserve_types in this project.
Prompt 4
Help me interpret the benchmark results comparing original and optimized token counts.

Frequently asked questions

What is memory-optimizer?

Middleware that automatically compresses long AI conversations by offloading heavy content to files and inserting short references.

What language is memory-optimizer written in?

Mainly TypeScript. The stack also includes TypeScript, Newmax, Mermaid.

What license does memory-optimizer use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is memory-optimizer to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is memory-optimizer for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.