Run search + enrichment — the approach depends on how many platforms are requested:
Single platform (non-X)
Run the search directly, then enrich in the main conversation:
cd community-search && uv run python search.py --platform <name> --since YYYY-MM-DD --until YYYY-MM-DD --verbose
Then proceed to step 5 (enrich), step 6 (merge — skipped for single platform), and step 7 (render).
Single platform (X only)
X search uses the x-mcp MCP server instead of the Python script. Run the search in the main conversation:
-
Build the search query for each keyword in config.py (SEARCH_KEYWORDS):
cd community-search && uv run python platforms/x_mcp_normalize.py --build-query --keyword Dapr --since YYYY-MM-DD --until YYYY-MM-DD
-
Call the search_twitter MCP tool with:
query: the query string from step 1
product: "Latest"
count: 100
-
Paginate: If the response includes a cursor, call search_twitter again with that cursor. Repeat until no cursor is returned or 5 total calls have been made.
-
Save raw results: Collect all posts from all pages into a single JSON array and write it to /tmp/x_mcp_raw.json.
-
Normalize and filter:
cd community-search && uv run python platforms/x_mcp_normalize.py --input /tmp/x_mcp_raw.json --output reports/YYYY-MM-DD-x-community-content.json --since YYYY-MM-DD --until YYYY-MM-DD --verbose
-
Proceed to step 5 (enrich), step 6 (merge — skipped for single platform), and step 7 (render).
Multiple platforms (parallel pipeline)
Launch one Agent subagent per non-X platform in parallel (use a single message with multiple Agent tool calls). Each subagent handles the full search-and-enrich pipeline for its platform independently, so fast platforms (e.g., Bluesky) complete without waiting for slower ones (e.g., LinkedIn).
For X: Run the X search in the main conversation first (using the x-mcp MCP tool as described in "Single platform (X only)" steps 1-5 above), then launch an enrichment-only subagent for X in parallel with the other platform subagents.
Each non-X platform subagent prompt should be:
You are enriching Dapr community search results for the <PLATFORM> platform.
1. Run the search:
cd community-search && uv run python search.py --platform <PLATFORM> --since YYYY-MM-DD --until YYYY-MM-DD --verbose
2. Check the output. The script writes a JSON file to the reports/ directory
(e.g., reports/YYYY-MM-DD-<PLATFORM>-community-content.json).
If the platform fails with a FileNotFoundError about missing auth state,
or logs a warning about being redirected to /login, report the error and stop.
3. Enrich the JSON file:
- Read the platform JSON file.
- For each post, determine three fields:
- "sentiment": one of "positive", "neutral", or "negative" based on tone.
- "relevancy_score": one of "high", "medium", or "low":
- high: clearly about Dapr (distributed application runtime) or Dapr Agents (Python library for agentic AI).
- medium: mentions Dapr in passing or discusses related distributed systems topics alongside Dapr.
- low: not relevant to Dapr (slang, different topic, accidental keyword match).
- "summary": one concise sentence summarizing the post (under 100 characters).
**CRITICAL — Writing enrichment data back to JSON:**
NEVER use the Write tool to write JSON files directly — post text often contains quotes,
newlines, and special characters that will produce invalid JSON if not properly escaped.
ALWAYS use the `enrich.py` helper script which uses `json.dump` for correct escaping.
Write the enrichment array to a temporary JSON file first (this is safe because enrichment
objects only contain short strings with no special characters), then pass it to `enrich.py`:
cd community-search && uv run python enrich.py <json_path> --data-file /tmp/enrichments_.json
The --data-file argument must point to a JSON file containing an array with one object per
post (same order as the report file), each with only the three enrichment fields.
If the file has more than 15 posts, use batched enrichment:
- Split: cd community-search && uv run python batch_split.py <json_path> --batch-size 15
- Launch one Agent subagent per batch in parallel to enrich each batch file.
- Merge batches back: cd community-search && uv run python batch_merge.py --pattern "reports/<base>_batch_*.json" --output <json_path> --delete-batches
4. Verify the enrichment by running:
cd community-search && uv run python verify.py <json_path>
Report the JSON file path and verification output when done.
The X enrichment-only subagent prompt should be:
You are enriching Dapr community search results for the X platform.
The search has already been completed and the JSON file is at reports/YYYY-MM-DD-x-community-content.json.
1. Read the JSON file and enrich each post with:
- "sentiment": one of "positive", "neutral", or "negative" based on tone.
- "relevancy_score": one of "high", "medium", or "low":
- high: clearly about Dapr (distributed application runtime) or Dapr Agents (Python library for agentic AI).
- medium: mentions Dapr in passing or discusses related distributed systems topics alongside Dapr.
- low: not relevant to Dapr (slang, different topic, accidental keyword match).
- "summary": one concise sentence summarizing the post (under 100 characters).
**CRITICAL — Writing enrichment data back to JSON:**
NEVER use the Write tool to write JSON files directly.
ALWAYS use the `enrich.py` helper script:
Write the enrichment array to /tmp/enrichments_x.json, then run:
cd community-search && uv run python enrich.py <json_path> --data-file /tmp/enrichments_x.json
If the file has more than 15 posts, use batched enrichment:
- Split: cd community-search && uv run python batch_split.py <json_path> --batch-size 15
- Launch one Agent subagent per batch in parallel to enrich each batch file.
- Merge batches back: cd community-search && uv run python batch_merge.py --pattern "reports/<base>_batch_*.json" --output <json_path> --delete-batches
2. Verify the enrichment by running:
cd community-search && uv run python verify.py <json_path>
Report the JSON file path and verification output when done.
After all platform subagents complete, proceed to step 6 (merge) and step 7 (render).