← all repositories
aiwaves-cn/RecurrentGPT

An LSTM where the hidden state is a paragraph

It treats a frozen LLM as a recurrent cell—replacing vectors with paragraphs and gradients with prompt engineering—so humans and models can co-write stories that outgrow any context window.

1k stars Python Language ModelsAgents
RecurrentGPT
Not currently ranked — collecting fresh signals.
star history

What it does

RecurrentGPT is a co-writing framework that generates long-form text one paragraph at a time. At each step, a backbone LLM receives the previous paragraph, a brief plan for the next, and two natural-language memory banks: a short-term summary of recent events and a long-term summary of the entire story retrieved via semantic search. The model outputs the next paragraph, an updated plan, and fresh memory summaries, rolling forward like an unrolled RNN. A human writer can seed the topic, select from generated continuations, edit them, or override the plan entirely.

The interesting bit

The conceit is that it literalizes the LSTM metaphor: cell states and hidden vectors become plain-text paragraphs stored on disk, and the recurrence mechanism is purely prompt engineering. This is less a training framework and more an orchestration layer—glue code that keeps a story coherent by making the LLM rewrite its own cliff notes at every timestep.

Key highlights

  • Simulates an LSTM recurrence loop using only prompts and an off-the-shelf LLM.
  • Maintains a long-term memory of all previous paragraph summaries with semantic search retrieval, storable on hard drives.
  • Keeps a short-term memory of recent events that is rewritten at every timestep.
  • Supports human-in-the-loop interaction: writers choose, edit, or override generated continuations and future plans.
  • Ships with a Gradio web demo and hosted online versions for both writing assistance and interactive fiction.

Caveats

  • The core implementation is essentially prompt orchestration and API plumbing; the heavy lifting is delegated to the backbone LLM.
  • Local or fully offline use is not supported out of the box; the repo defaults to the OpenAI API and offloads local-LLM support to a third-party fork.
  • The README emphasizes shell-script deployment and demo links over code architecture or extensibility details.

Verdict

Novelists, game writers, or prompt engineers curious about structured long-form generation should take a look. If you need a trainable model or a fully offline pipeline, this is a conceptual demo rather than a foundation.

Frequently asked

What is aiwaves-cn/RecurrentGPT?
It treats a frozen LLM as a recurrent cell—replacing vectors with paragraphs and gradients with prompt engineering—so humans and models can co-write stories that outgrow any context window.
Is RecurrentGPT open source?
Yes — aiwaves-cn/RecurrentGPT is open source, released under the GPL-3.0 license.
What language is RecurrentGPT written in?
aiwaves-cn/RecurrentGPT is primarily written in Python.
How popular is RecurrentGPT?
aiwaves-cn/RecurrentGPT has 1k stars on GitHub.
Where can I find RecurrentGPT?
aiwaves-cn/RecurrentGPT is on GitHub at https://github.com/aiwaves-cn/RecurrentGPT.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.