Skip to content

About

No description or website provided.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

DemandTrace

Turn real Reddit questions and actual AI search fan-out into content themes and ready-to-use article briefs.

DemandTrace is a bounded autonomous content research agent. You give it one seed topic, a Bright Data API key, and an OpenAI API key. It runs the complete research and brief-generation workflow without requiring manual sorting between stages.

What it does on its own

→ Searches Reddit for discussions around the seed topic using Bright Data
→ Removes API errors, blank records, duplicate post IDs, and exact duplicate titles
→ Joins each Reddit title and body into one contextual combined_prompt
→ Sends every cleaned prompt to GPT-5.6 Luna with web search left on AUTO
→ Captures the actual backend search queries Luna performs
→ Keeps each fan-out query connected to the Reddit post that triggered it
→ Combines the original Reddit prompts and fan-out queries into one dataset
→ Classifies the signals into 13 content categories
→ Creates embeddings and clusters semantically related questions and searches
→ Turns those clusters into content themes and recommended content types
→ Generates structured DOCX briefs with metadata tables and detailed outlines

Workflow

Seed topic
    ↓
Collect Reddit posts through Bright Data
    ↓
Remove obvious errors and duplicates
    ↓
Join title + body into combined_prompt
    ↓
Send every prompt to GPT-5.6 Luna
    ↓
Keep web search on AUTO
    ↓
Capture actual web_search_call queries
    ↓
Combine Reddit prompts and fan-out queries
    ↓
Classify and cluster with embeddings
    ↓
Create content themes
    ↓
Generate content briefs

Classification categories

  • Brands
  • Comparisons
  • Audiences
  • Problems
  • Features
  • Benefits
  • Prices
  • Alternatives
  • Use cases
  • Implementation
  • Integrations
  • Evidence
  • General questions

Outputs

Each run produces:

reddit_raw.json
reddit_cleaned.csv
fanout_queries.csv
themes.csv
content_briefs.docx

The notebook also packages the run into a downloadable ZIP.

Repository structure

demandtrace-agent/
├── notebooks/
│   └── Autonomous_Reddit_Fanout_Content_Briefs.ipynb
├── docs/
│   └── architecture.md
├── outputs/
│   └── .gitkeep
├── .github/
│   └── workflows/
│       └── validate-notebook.yml
├── .gitignore
├── requirements.txt
├── SECURITY.md
└── README.md

Run in Google Colab

  1. Open the notebook in notebooks/.
  2. Upload it to Google Colab.
  3. Select Runtime → Run all.
  4. Enter your Bright Data API key when prompted.
  5. Enter your OpenAI API key when prompted.
  6. Enter the seed topic and run settings.
  7. Download the generated ZIP when the workflow finishes.

The notebook asks for keys through hidden getpass prompts. It does not require keys to be written into the code.

Run locally

Create an isolated environment:

git clone https://github.com/johnne32/demandtrace-agent.git
cd demandtrace-agent

python3 -m venv .venv
source .venv/bin/activate

python -m pip install --upgrade pip
python -m pip install -r requirements.txt

jupyter lab

Open:

notebooks/Autonomous_Reddit_Fanout_Content_Briefs.ipynb

Run the notebook from top to bottom.

Required services

  • A Bright Data account with access to the Reddit Posts dataset
  • An OpenAI API account with access to the model configured in the notebook

The current notebook is configured with:

GENERATION_MODEL = "gpt-5.6-luna"
EMBEDDING_MODEL = "text-embedding-3-small"

Change these values in the settings cell if your account uses different model identifiers.

Security

Do not commit:

  • API keys
  • .env files
  • generated output folders
  • raw research data you do not intend to publish

See SECURITY.md for details.

Project status

Working research prototype.

The full workflow has been tested through Reddit collection, Luna fan-out, classification, embedding clustering, theme generation, and DOCX brief export.

About

No description or website provided.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages