Iterative clustering, LLM-based analysis, graph construction, and analytical search
Python
0
1 commits
updated Sep 19, 2026
Turn social-media posts or documents into a structured, explorable 3D graph — and ask analytical questions in natural language, with citations and a confidence score. No predefined categories, no manual annotation.
Install · Quick start · How it works · Documentation
HeronLoom combines iterative clustering, LLM-based analysis, graph construction, and analytical search in a single pipeline. It tracks how topics and narratives evolve over time, identifies the signals driving those changes, and makes every conclusion traceable to the underlying corpus.
Built for corpora of up to 50,000 posts or documents. The pipeline favours clustering quality and analytical depth over raw throughput — larger corpora may work but have not been systematically validated.
A complete run on Reddit WallStreetBets Posts by Gabriel Preda, using raw posts from September 29, 2020 to April 1, 2021. After date filtering, the pipeline processes 43,976 posts covering the January 2021 GameStop short squeeze. No categories, keyword seeds, or manual annotations are provided to the system. Every cluster, name, narrative chain, and pool shown below is produced by the pipeline.
Two real questions asked to the system using this corpus — full answers with confidence scores below, no editing:
Note: Because the corpus (r/wallstreetbets) may contain offensive language, source quotes have been removed from these two examples. The quotes are retrieved from the corpus and are not part of the LLM's response.
Requirements
heavy model,
unless a local endpoint is configured. For large corpora, a model with
a 1M-token context window is recommended.git clone https://github.com/korries/HeronLoom.git
cd HeronLoom
python -m venv .venv
source .venv/bin/activate
On Windows:
.venv\Scripts\activate
python -m pip install -U pip
python -m pip install -r requirements.txt
Optional, for GPU acceleration — installing this later, in a new terminal?
Activate the virtual environment again first (step 2): you should see (.venv)
at the start of your prompt.
Example for CUDA 13.2:
python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu132
python -m pip install cupy-cuda13x
cp .env.example .env
ollama pull qwen3-embedding:8b
ollama pull qwen3.5:9b
Configure model slots in config/config.yaml before the first run. API keys go
in .env, never in configuration files. Provider setup, model selection, and
parallelism: Configuration.
Place your files in data/raw/ — see Input format below.
Then launch the dashboard:
python dashboard.py
Open http://127.0.0.1:8000 and select New run. From there: launch the run,
ask questions, and open the 3D graph, all on the same page. See
Dashboard.
For scripting or automation, use the CLI instead — same data/raw/ folder, no
dashboard needed:
python pipeline.py --input data/raw/
python reload.py search <run_id> "What were the main topics of discussion and the overall sentiment in the 48 hours following Robinhood's trading restrictions in late January 2021?"
A clustering_only mode is also available, for clustering purposes exclusively
— it skips the LLM analysis stages (Nova & ADEPT).
For the full flag reference, run python pipeline.py --help for the pipeline
or python reload.py --help for resume, restart, relabel, and search. See
CLI reference for details.
A stage-flow diagram is in Architecture.
Accepted: .json, .csv, .tsv, .txt, .md, .pdf. Only text content is
required.
{
"id": "post_001",
"content": "Text of the post.",
"timestamp": "2026-06-01T14:30:00Z",
"engagement": 142
}
id, timestamp, and engagement are optional; timestamps and engagement
enrich the graph when present. Non-standard field names can be mapped via
field_mapping in config.yaml.
HeronLoom's refinement loop is adapted from TopiCLEAR's ADR loop (Fujita et al., 2026): clusters are repeatedly refined instead of being fixed after a single pass. TopiCLEAR itself builds on the Adaptive Dimension Reduction (ADR) framework introduced by Ding & Li (2007), which alternates between an LDA-based discriminant projection and k-means/GMM clustering within that subspace.
HeronLoom replaces the original closed-form LDA step with LDA-GO (Shen & Dong, 2025), which learns the discriminant subspace through gradient-based optimization instead. This matters most on high-dimensional text embeddings — and especially when the number of clusters is large relative to the sample size — where the closed-form LDA solution routinely hits an invertibility failure and becomes unreliable. LDA-GO avoids that failure mode and makes the loop converge reliably in production.
The integration of LDA-GO into the TopiCLEAR-style refinement loop, along with the surrounding implementation and stability engineering, represents HeronLoom's own contribution.
Full mathematical treatment: Algorithms.
The dashboard listens on 127.0.0.1 by default. Binding it to 0.0.0.0 to
expose it on a network does not add authentication on its own — read
Security first.
Thanks to the authors of TopiCLEAR and LDA-GO for their open-source contributions.
HeronLoom is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file.
Third-party code and dependencies keep their own licence terms. See Third-party notices.
For questions, suggestions, or collaboration, please feel free to reach out: korprotech@gmail.com
1 commits
Python
67.3%
JavaScript
24.7%
CSS
4.5%
HTML
3.6%
Iterative clustering, LLM-based analysis, graph construction, and analytical search
Python
0
1 commits
updated Sep 19, 2026
Turn social-media posts or documents into a structured, explorable 3D graph — and ask analytical questions in natural language, with citations and a confidence score. No predefined categories, no manual annotation.
Install · Quick start · How it works · Documentation
HeronLoom combines iterative clustering, LLM-based analysis, graph construction, and analytical search in a single pipeline. It tracks how topics and narratives evolve over time, identifies the signals driving those changes, and makes every conclusion traceable to the underlying corpus.
Built for corpora of up to 50,000 posts or documents. The pipeline favours clustering quality and analytical depth over raw throughput — larger corpora may work but have not been systematically validated.
A complete run on Reddit WallStreetBets Posts by Gabriel Preda, using raw posts from September 29, 2020 to April 1, 2021. After date filtering, the pipeline processes 43,976 posts covering the January 2021 GameStop short squeeze. No categories, keyword seeds, or manual annotations are provided to the system. Every cluster, name, narrative chain, and pool shown below is produced by the pipeline.
Two real questions asked to the system using this corpus — full answers with confidence scores below, no editing:
Note: Because the corpus (r/wallstreetbets) may contain offensive language, source quotes have been removed from these two examples. The quotes are retrieved from the corpus and are not part of the LLM's response.
Requirements
heavy model,
unless a local endpoint is configured. For large corpora, a model with
a 1M-token context window is recommended.git clone https://github.com/korries/HeronLoom.git
cd HeronLoom
python -m venv .venv
source .venv/bin/activate
On Windows:
.venv\Scripts\activate
python -m pip install -U pip
python -m pip install -r requirements.txt
Optional, for GPU acceleration — installing this later, in a new terminal?
Activate the virtual environment again first (step 2): you should see (.venv)
at the start of your prompt.
Example for CUDA 13.2:
python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cu132
python -m pip install cupy-cuda13x
cp .env.example .env
ollama pull qwen3-embedding:8b
ollama pull qwen3.5:9b
Configure model slots in config/config.yaml before the first run. API keys go
in .env, never in configuration files. Provider setup, model selection, and
parallelism: Configuration.
Place your files in data/raw/ — see Input format below.
Then launch the dashboard:
python dashboard.py
Open http://127.0.0.1:8000 and select New run. From there: launch the run,
ask questions, and open the 3D graph, all on the same page. See
Dashboard.
For scripting or automation, use the CLI instead — same data/raw/ folder, no
dashboard needed:
python pipeline.py --input data/raw/
python reload.py search <run_id> "What were the main topics of discussion and the overall sentiment in the 48 hours following Robinhood's trading restrictions in late January 2021?"
A clustering_only mode is also available, for clustering purposes exclusively
— it skips the LLM analysis stages (Nova & ADEPT).
For the full flag reference, run python pipeline.py --help for the pipeline
or python reload.py --help for resume, restart, relabel, and search. See
CLI reference for details.
A stage-flow diagram is in Architecture.
Accepted: .json, .csv, .tsv, .txt, .md, .pdf. Only text content is
required.
{
"id": "post_001",
"content": "Text of the post.",
"timestamp": "2026-06-01T14:30:00Z",
"engagement": 142
}
id, timestamp, and engagement are optional; timestamps and engagement
enrich the graph when present. Non-standard field names can be mapped via
field_mapping in config.yaml.
HeronLoom's refinement loop is adapted from TopiCLEAR's ADR loop (Fujita et al., 2026): clusters are repeatedly refined instead of being fixed after a single pass. TopiCLEAR itself builds on the Adaptive Dimension Reduction (ADR) framework introduced by Ding & Li (2007), which alternates between an LDA-based discriminant projection and k-means/GMM clustering within that subspace.
HeronLoom replaces the original closed-form LDA step with LDA-GO (Shen & Dong, 2025), which learns the discriminant subspace through gradient-based optimization instead. This matters most on high-dimensional text embeddings — and especially when the number of clusters is large relative to the sample size — where the closed-form LDA solution routinely hits an invertibility failure and becomes unreliable. LDA-GO avoids that failure mode and makes the loop converge reliably in production.
The integration of LDA-GO into the TopiCLEAR-style refinement loop, along with the surrounding implementation and stability engineering, represents HeronLoom's own contribution.
Full mathematical treatment: Algorithms.
The dashboard listens on 127.0.0.1 by default. Binding it to 0.0.0.0 to
expose it on a network does not add authentication on its own — read
Security first.
Thanks to the authors of TopiCLEAR and LDA-GO for their open-source contributions.
HeronLoom is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file.
Third-party code and dependencies keep their own licence terms. See Third-party notices.
For questions, suggestions, or collaboration, please feel free to reach out: korprotech@gmail.com
1 commits
Python
67.3%
JavaScript
24.7%
CSS
4.5%
HTML
3.6%