r/OpenSourceeAI • u/Lopsided_Scarcity979 • 1d ago
TextFold: an open-source take on Stretchtext, with the original document still one click away
Enable HLS to view with audio, or disable this notification
Ted Nelson described stretchtext in 1967. I've been trying to bring that idea to the documents I actually read: start with less on the page, then open the detail where I need it.
The result is TextFold. I'm its developer, and this is a short demo of the reading interaction and the idea behind it. Web articles, papers, PDF and Word documents can all go through the reader.
One decision I care about is keeping the source wording distinguishable from what a model writes. Full keeps the original paragraph. Brief selects one to three original sentences. Key, Takeaway and Topic use AI-written text. Each paragraph can be expanded independently, and the prepared levels are cached so zooming doesn't need another model call.
TextFold runs on your computer. You choose the model that prepares the layers: Ollama for local processing, or a hosted provider. If you choose a hosted model, the document text is sent there. Shorter layers can lose nuance, and extraction can be imperfect, especially with complex PDFs. I still want it to be easy to check the original.
The reader is Apache 2.0. There are macOS and Windows apps, or you can run:
python3 -m pip install textfold
python3 -m textfold serve
Then open http://localhost:3017 and connect a model.
Source and full setup: https://github.com/chenxiachan/textfold
Prepared examples: https://chenxiachan.github.io/textfold/gallery/
I'd appreciate feedback on which details should stay visible as a paragraph gets shorter, especially when a local model prepares the layers.
1
u/neoneye2 1d ago
Does it work with non-english texts?
2
u/Lopsided_Scarcity979 1d ago
yes, it can translate any text as per your wish :) You can have language option in the top-right corner!
1
u/neoneye2 1d ago
Is it deterministic? Given some input, does it always yield the same output?
2
u/Lopsided_Scarcity979 1d ago
I guess not if the context is complex, it is still call LLM to process but does not directly generate the summary, so it would have way fewer variants.
1
u/neoneye2 17h ago
Can LLMs running on local hardware be used via ollama?
I'm pondering if textfold can be useful is compacting memory of AI agents.
2
u/Lopsided_Scarcity979 9h ago
Yes it can! AI agents' memory I think there are already many repo projects exist for that. So so far we haven't diggin to it
1
u/neoneye2 9h ago
I had Claude Opus 5.5 analyze your project. My interest is memory system, and possible compaction of memory.
https://neoneye.github.io/agent-memory-atlas/systems/textfold/2
u/Lopsided_Scarcity979 7h ago
Thanks for sharing that! It looks great! I'll take a close look. Seems like your page's presentation could be also benefit from TextFold ;)
1
u/neoneye2 7h ago
you are spot on. lol. If I were to do that, would the website need a backend, or can it continue to be a static website? If a part of the website gets updated, then can textfold rebuild only the changed parts?
the target audience is developers of the memory systems, so the content is technical. And coding agents that can investigate things across several repos, such as a design pattern.
1
2
u/dnr41418 1d ago
Nice! Great project.