Skip to main content

Evidence-first discussion intelligence tooling.

Project description

ThreadSense

ThreadSense is an evidence-first discussion intelligence pipeline for turning long community threads into structured, inspectable product intelligence.

The current implementation supports:

  • Reddit thread ingestion through the public JSON API
  • canonical normalization and persisted artifacts
  • deterministic analysis with evidence-linked findings
  • optional local-model summary generation through an OpenAI-compatible runtime
  • JSON and Markdown report generation
  • reproducible batch runs
  • a local HTTP API surface

ThreadSense is local-first. It is optimized for operator workflows, replayability, and evidence traceability rather than cloud-first convenience.

Happy Path

Run the full single-thread workflow with one command:

uv run threadsense run reddit <reddit-url> \
  [--with-summary] \
  [--summary-required] \
  [--format markdown|json]

Example:

uv run threadsense run reddit \
  "https://www.reddit.com/r/ClaudeCode/comments/1ro0qbl/anyone_actually_built_a_second_brain_that_isnt/" \
  --format markdown \
  --with-summary \
  --summary-required

What It Does

ThreadSense runs a staged pipeline:

  1. fetch a Reddit thread
  2. persist the raw artifact
  3. normalize it into a canonical thread model
  4. run deterministic analysis
  5. optionally run local inference for summary synthesis
  6. persist a JSON or Markdown report

Artifacts remain separate at each stage so the pipeline is inspectable and rerunnable.

Architecture

Core modules:

Supporting docs:

Requirements

  • Python >=3.11
  • uv
  • optional local OpenAI-compatible runtime at http://127.0.0.1:8080/v1/chat/completions

Installation

uv sync

Run the CLI through uv:

uv run threadsense --help

Quickstart

1. Validate local setup

uv run threadsense preflight

Skip runtime probing if you only want config validation:

uv run threadsense preflight --skip-runtime

2. Run the full workflow

uv run threadsense run reddit \
  "https://www.reddit.com/r/ClaudeCode/comments/1ro0qbl/anyone_actually_built_a_second_brain_that_isnt/" \
  --format markdown

The command prints one JSON payload containing the stage outputs and final artifact paths.

Use --with-summary --summary-required if you want the final report to require a live local-model summary.

Usage Reference

For the detailed command-by-command reference, including:

  • preflight
  • fetch
  • normalize
  • analyze
  • infer
  • report
  • inspect
  • batch run
  • serve
  • run reddit

see docs/usage.md.

Configuration

Default config file:

Important sections:

  • [runtime]: local inference backend URL, path, model, timeout, repair retries
  • [reddit]: user agent, timeout, retries, backoff, request delay, listing limit
  • [storage]: raw, normalized, analysis, report, and batch directories
  • [batch]: worker count, max jobs, fail-fast behavior
  • [api]: host, port, request size limit
  • [limits]: runtime concurrency guard

Common environment overrides:

  • THREADSENSE_RUNTIME_ENABLED
  • THREADSENSE_RUNTIME_BASE_URL
  • THREADSENSE_RUNTIME_CHAT_PATH
  • THREADSENSE_RUNTIME_MODEL
  • THREADSENSE_REDDIT_TIMEOUT
  • THREADSENSE_REDDIT_REQUEST_DELAY
  • THREADSENSE_STORAGE_ROOT
  • THREADSENSE_BATCH_MAX_WORKERS
  • THREADSENSE_BATCH_MAX_JOBS
  • THREADSENSE_API_PORT
  • THREADSENSE_RUNTIME_CONCURRENCY

Artifact Layout

Default storage root:

  • .threadsense

Default structure:

  • .threadsense/raw/reddit/<thread-id>.json
  • .threadsense/normalized/reddit/<thread-id>.json
  • .threadsense/analysis/reddit/<thread-id>.json
  • .threadsense/reports/reddit/<thread-id>.json
  • .threadsense/reports/reddit/<thread-id>.md
  • .threadsense/batches/<run-name>.json

Local Runtime Contract

ThreadSense expects a local OpenAI-compatible chat completion endpoint.

Default target:

  • base URL: http://127.0.0.1:8080
  • chat path: /v1/chat/completions
  • resolved endpoint: http://127.0.0.1:8080/v1/chat/completions

The local runtime contract is documented in docs/local-runtime-contract.md.

Validation

Run the full local validation stack:

uv run ruff check
uv run ruff format --check .
uv run mypy --strict src tests
uv run pytest
./scripts/validate.sh

Tests

The repo includes:

  • unit tests for config, connectors, normalization, analysis, inference, reporting, observability, batching, and API validation
  • integration tests for fetch, normalization, inference, reporting, batch runs, and API workflows
  • fixture-backed Reddit payloads and replay manifests under tests/fixtures

Current Limits

The current system is intentionally constrained:

  • only Reddit is implemented as a source
  • analysis is still a deterministic heuristic baseline
  • the main product unit is still a single thread or local batch run
  • the API is local-first and not hardened for untrusted callers
  • report presentation is Markdown and JSON, not yet an interactive HTML review surface

Roadmap Direction

The completed phased plan established the system backbone. The next high-value areas are:

  • claim-level evidence attribution
  • evaluation and replay benchmarking
  • corpus-level analysis across threads
  • better decision-oriented report presentation
  • stronger onboarding and developer ergonomics

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

threadsense-0.1.0a0.tar.gz (84.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

threadsense-0.1.0a0-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file threadsense-0.1.0a0.tar.gz.

File metadata

  • Download URL: threadsense-0.1.0a0.tar.gz
  • Upload date:
  • Size: 84.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for threadsense-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 dfb6ed54e3254a1d63687cf5f8a29689ffd96c01b68fc23f95463a47060f60ad
MD5 2b1ad30c0b61dfea1d77054e5efad6b0
BLAKE2b-256 f937a22219968cab5da6ab56ccafd48907be936191bff7b451878f7779805289

See more details on using hashes here.

File details

Details for the file threadsense-0.1.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for threadsense-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 26cea5bda5c4c2f4d2a67d28f83897d2c5445d4f158d732e313ffa37e2e72ca6
MD5 562e9fb631ef96922f66503f8375e0c4
BLAKE2b-256 5baa9ffe1467fb11ccdae096bf2c975523b6ba655e8c0495fa3756eeeb40f778

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page