X Posts to KG Ingestion Workflow
Searches X posts for a given query and ingests the content, author metadata,
engagement statistics, and extracted concepts directly into the Knowledge Graph.
Uses the UniversalKnowledgeClassifier for importance scoring and
XIngestionBridge for structured persistence.
Architecture
graph LR
A["User Query / URL"] --> B["x_search / browse_x_post"]
B --> C["XIngestionBridge"]
C --> D["UniversalKnowledgeClassifier"]
D --> E{Tier?}
E -->|critical/high| F["SocialPostNode\n(permanent)"]
E -->|standard| G["SocialPostNode\n(decays)"]
E -->|ephemeral| H["SocialPostNode\n(fast decay)"]
F --> I["EvolutionCandidateNode"]
I --> J["→ knowledge-assimilation"]
Execution Steps
Step 0: x-search-agent
Search X using x_search for a topic query, or browse a specific post URL
using browse_x_post with auto_ingest=True.
For topic search:
Use x_search with query: "{{task}}"
For specific post:
Use browse_x_post with url: "{{task}}", auto_ingest: true
When auto_ingest=True, the browse tool automatically:
- Retrieves the post via xAI Responses API (grok-4.3)
- Classifies content via UniversalKnowledgeClassifier
- Creates SocialPostNode + Person + KBConcept nodes
- Creates EvolutionCandidateNode if evolution potential ≥ 0.6
Expected: posts with content, engagement metrics, classification results
Step 1: graph-os
For search results (not auto-ingested), manually ingest each result into the KG using the XIngestionBridge pattern.
For each result from Step 0:
- Create SocialPost node:
Use mcp_graph-os_graph_write with action: "add_node",
node_type: "SocialPost",
node_id: "social:x:<post_id>",
properties: '{
"post_id": "<id>",
"author_handle": "<handle>",
"content_text": "<text>",
"post_url": "<url>",
"post_type": "tweet|article|thread",
"importance_score": <classifier_score>,
"is_permanent": <true|false>,
"evolution_potential": <score>
}'
- Create Person node and link:
Use mcp_graph-os_graph_write with action: "add_node",
node_type: "Person", node_id: "person:x:<handle>"
Use mcp_graph-os_graph_write with action: "add_edge",
source_id: "social:x:<id>", target_id: "person:x:<handle>",
rel_type: "CREATED_BY_PERSON"
For each extracted concept, create KBConcept + ABOUT edge
For X Articles (long-form content), fetch full article:
Use read_url_content with url: "<article_url>"
Then ingest via:
Use mcp_graph-os_graph_ingest with action: "ingest", target_path: "<url>"
Link SocialPost → Article via PROMOTES_RESEARCH edge.
Expected: cypher, ingest, concepts linked Depends On: Step 0
X Article Detection
X Articles are long-form posts (up to ~100K chars) that the xAI API returns as tweets but contain article links. The bridge detects these by:
- Content length > 3000 characters
- URL patterns matching
x.com/*/articles/*
When detected, the article is fetched via browser/read_url_content and ingested through the full KBIngestionEngine pipeline, producing:
Articlenode with summary, content, word countKBConceptnodes for extracted conceptsKBFactnodes for atomic factsPROMOTES_RESEARCHedge from the originating SocialPost
Classification Tiers
| Tier | Importance | Permanent | Decay | Evolution |
|---|---|---|---|---|
| Critical | ≥ 0.9 | ✅ | None | Auto-trigger |
| High Value | 0.7–0.9 | ✅ | None | Flagged |
| Standard | 0.4–0.7 | ❌ | 5%/day | No |
| Ephemeral | ≤ 0.3 | ❌ | 10%/day | No |
References
- knowledge-assimilation — Full evolution pipeline
- The package-specific X architecture guide is owned by
agent-utilitiesatdocs/guides/x-assistant.md; it is not bundled with this workflow.
Execution
Run this workflow as a dependency-ordered DAG. Steps with no unmet depends_on run in parallel; dependents run after their prerequisites complete.
- Run first (in parallel): Step 0 — x-search-agent; Step 1 — graph-os
Execution: If graph-os is reachable, offload the whole DAG via graph_orchestrate action=execute_workflow (or the kg-delegate skill) for true parallel/swarm execution. Otherwise execute the steps natively in dependency order: run steps with no unmet depends_on in parallel, then their dependents.