Files
..

University Organization Pipeline

This repository crawls university organization websites and extracts structured staff, project, news, and keyword information.

Pipeline stages

For one configured entity, the pipeline executes:

  1. Generate crawl seeds from the accepted hierarchy.
  2. Crawl all seed URLs and their allowed internal links.
  3. Store responses as WARC files.
  4. Build a redirect lookup.
  5. Upload HTML content to Elasticsearch.
  6. Load the accepted organization hierarchy.
  7. Classify crawled URLs with the configured LLM.
  8. Extract staff, projects, and news.
  9. Extract focused keywords for extracted content.

The hierarchy under src/data/hierarchies is the authoritative source. The pipeline must mount that data directory at /data, so accepted hierarchy edits made by the service are visible to the pipeline container.

Restarting a run

Pipeline data is stored below runs/<entity>/. Use --auto-resume to keep existing data and continue from the stages recorded in pipeline_state.json. This also keeps data when the previous run used different limits or was marked completed. If the state file is missing or invalid, the pipeline keeps the existing files and reruns the stages because no completed stages can be known.

Use --fresh when you explicitly want to delete the entity's existing run directory and start over. Without either option, the pipeline creates a new state file without deleting existing data.

When this pipeline is launched by the background-job runner with --auto-resume and no persistent_dir is configured, the runner automatically mounts its named persistent volume at /app/orgminer_pipeline/runs.

The service data volume must also be mounted into the pipeline container at /data. Use the same named volume in both containers; the default is smartguide-data, configurable with ORGMINER_DATA_VOLUME. The pipeline mounts it read-only because the service owns accepted hierarchy updates.

For local development, recreate the service with the shared volume:

docker volume create smartguide-data
docker run ... -v smartguide-data:/data ...

The background-job runner mounts that same volume automatically for OrgMiner jobs. In CI/CD, create or provision a volume with the same configured name and mount it at /data when starting the service.

Requirements

  • Python environment containing Scrapy, scrapy-warcio, warcio, Elasticsearch, OpenAI client, Trafilatura, YAKE, langdetect, tiktoken, and project dependencies.
  • Elasticsearch credentials.
  • LLM endpoint and API key.

Create .env in the repository root:

ES_PASSWORD=...
ES_HOST=https://your-elasticsearch-host:443
ES_USERNAME=elastic

llm_api=https://your-llm-api/v1
llm_key=...