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.
→ 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
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
- Brands
- Comparisons
- Audiences
- Problems
- Features
- Benefits
- Prices
- Alternatives
- Use cases
- Implementation
- Integrations
- Evidence
- General questions
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.
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
- Open the notebook in
notebooks/. - Upload it to Google Colab.
- Select Runtime → Run all.
- Enter your Bright Data API key when prompted.
- Enter your OpenAI API key when prompted.
- Enter the seed topic and run settings.
- 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.
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 labOpen:
notebooks/Autonomous_Reddit_Fanout_Content_Briefs.ipynb
Run the notebook from top to bottom.
- 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.
Do not commit:
- API keys
.envfiles- generated output folders
- raw research data you do not intend to publish
See SECURITY.md for details.
Working research prototype.
The full workflow has been tested through Reddit collection, Luna fan-out, classification, embedding clustering, theme generation, and DOCX brief export.