explaingit

thelightframework/coherence-chat

Analysis updated 2026-05-18

0JavaScriptAudience · researcherComplexity · 2/5LicenseSetup · easy

TLDR

A demo chat app that compresses long AI conversations into small 'Memory Cards' to keep context lighter and cheaper over long chats.

Mindmap

mindmap
  root((Coherence Chat))
    What it does
      Compresses chat history
      Shows Memory Cards
      Estimates context savings
    Tech stack
      Python
      FastAPI
      JavaScript
      OpenRouter
    Use cases
      Explore Coherence Framework
      Reduce chat context cost
      Demo memory summarization
    Audience
      AI researchers
      Framework builders
    Interface
      About page
      Memory view
      Savings view

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

Try out the Coherence Framework's memory compression idea in a live chat interface.

USE CASE 2

See how much context a conversation avoids resending by checking the Savings view.

USE CASE 3

Extend the frontend with a new theme, About section, or memory-card view.

USE CASE 4

Study the backend's structured memory extraction as a reference for building your own context-saving chat app.

What is it built with?

PythonFastAPIuvicornJavaScriptHTMLCSS

How does it compare?

thelightframework/coherence-chatabhishek-akkal/finovaadan-shahid/ecommerce_website
Stars000
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasymoderate
Complexity2/51/53/5
Audienceresearcherdeveloperdeveloper

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

How do you get it running?

Difficulty · easy Time to first run · 30min

Requires Python 3.10+ and an OpenRouter API key set in a .env file.

Free to share and adapt for non-commercial use with attribution under the same license, commercial use needs a separate paid license.

In plain English

Coherence Chat is a web-based chat application that demonstrates a memory compression approach to AI conversations called the Coherence Framework. In an ordinary AI chat, the full conversation history grows with every message, making later turns more expensive and harder for the model to process. Coherence Chat tries a different approach: after each exchange, the AI condenses the most important context into small structured summaries called Memory Cards. In subsequent turns, the app sends those compact cards instead of the full prior conversation, keeping the context window lighter while preserving meaning. The interface reflects this design. Users chat normally and can open a Memory view to see what the AI has retained, and a Savings view that estimates how much context was avoided compared to a full-prose chat history. When the AI presents numbered choices, the input field temporarily switches to buttons to prevent ambiguous one-word replies. The backend is a Python application using FastAPI and uvicorn, which handles receiving messages and memory cards from the browser, making requests to an AI model provider (OpenRouter by default), streaming responses back, extracting structured memory, and returning telemetry for the savings screen. The frontend is plain HTML, JavaScript, and CSS. Python 3.10 or newer is required. The Coherence Framework context files live in a cf/ folder that the backend loads at startup. The project is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 (CC BY-NC-SA 4.0), commercial use requires a separate license from the author.

Copy-paste prompts

Prompt 1
Help me set up Coherence Chat locally with FastAPI and an OpenRouter API key.
Prompt 2
Explain how Coherence Chat's Memory Cards reduce the context sent to the AI model on later turns.
Prompt 3
Show me how to change the OpenRouter model Coherence Chat uses in the .env file.
Prompt 4
Walk me through extending Coherence Chat's frontend to add a light mode.
Prompt 5
Help me understand the difference between the public layer and advanced layer described in Coherence Chat's design philosophy.

Frequently asked questions

What is coherence-chat?

A demo chat app that compresses long AI conversations into small 'Memory Cards' to keep context lighter and cheaper over long chats.

What language is coherence-chat written in?

Mainly JavaScript. The stack also includes Python, FastAPI, uvicorn.

What license does coherence-chat use?

Free to share and adapt for non-commercial use with attribution under the same license, commercial use needs a separate paid license.

How hard is coherence-chat to set up?

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

Who is coherence-chat for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.