How digitalmethodsinitiative/4cat works
4CAT is a web-based research toolkit for collecting social-platform data, importing datasets, and analyzing them with downloadable processors and visualizations. The documented user flow is to create or upload a dataset, then download it or run further analysis. The graph preserves those product stages and the job, configuration, and LLM layers visible in the sampled source. Some web-to-backend wiring and unsampled subsystem internals are not shown, so those connections are omitted rather than inferred.
Main entry points: worker.py Worker execution · webtool Web application · datasources Platform sources · search.py Search framework
Components 21
User interface
- Web application
webtool - Web views
webtool/views
Collection and import
- Platform sources
datasources - Search framework
backend/lib/search.py - Data imports
datasources/upload - Item mapping
common/lib/item_mapping.py
Dataset analysis
- Analysis processors
processors - LLM prompting
processors/machine_learning/llm_prompter.py - LLM adapter
common/lib/llm/adapter.py - Dataset results
common/lib/dataset.py
Runtime services
- Processor runtime
backend/lib/processor.py - Job manager
backend/lib/manager.py - Worker execution
backend/lib/worker.py - Job queue
common/lib/queue.py - LLM model manager
backend/workers/llm_manager.py
State and models
- Dataset management
common/lib/dataset.py - Database access
common/lib/database.py - Configuration
common/config_manager.py - LLM server client
common/lib/llm/llm_client.py
Other components
- Researcher
- LLM servers
Connections 17
- Researcher → Web application: uses
- Web application → Web views: presents
webtool/views/views_llm.py - Researcher → Platform sources: selects source
- Researcher → Data imports: uploads data
- Platform sources → Search framework: implements searches
datasources/bsky/search_bsky.py - Search framework → Item mapping: maps items
datasources/bsky/search_bsky.py - Researcher → Dataset management: creates dataset
- Dataset management → Analysis processors: analyzes dataset
- Analysis processors → Processor runtime: uses runtime
processors/text-analysis/generate_embeddings.py - Job manager → Worker execution: starts workers
backend/lib/manager.py - Worker execution → Job queue: uses queue
backend/lib/worker.py - Worker execution → Database access: opens connection
backend/lib/worker.py - Configuration → Database access: reads settings
common/config_manager.py - LLM prompting → LLM adapter: uses adapter
processors/machine_learning/llm_prompter.py - LLM model manager → LLM server client: manages models
backend/workers/llm_manager.py - LLM server client → LLM servers: sends requests
common/lib/llm/llm_client.py - Researcher → Dataset results: downloads or analyzes