packages/feed/docs/phase2-before-after.md
Comparing old pipeline (buildRichCharacterContext + buildCharacterFeedContext) vs new pipeline (ActorContextBuilder.buildContext + formatForPrompt)
| Metric | Old Pipeline | New Pipeline |
|---|---|---|
| Fetch time | 151ms | 24ms |
| Output tokens | ~1122 | ~874 |
| API calls | 3 (buildRichCharacterContext + formatComprehensiveContext + buildCharacterFeedContext) | 1 (buildContext) |
| Feed filtering | random 15 posts | affiliation-prioritized |
| Posts shown | 3 events + 0 prev posts | 2 posts + 3 events |
| Relationships | 5 | 5 |
| ignoreTopics in context | false | true |
| Tone guardrails | false | true |
| Finance guardrails | false | true |
| Anti-repetition patterns | false | false |
| DMs exposed | false | false |
| Resolved questions | false | false |
| Memories | separate fetch | none |
New pipeline output (first 500 chars):
PERSONALITY: erratic visionary
VOICE: Speaks in cryptic one-liners like a sleep-deprived oracle with a prototype in one hand and the reply button in the other. Uses 'lol' unironically to dismiss billion-dollar concerns. Announces world-changing news with the casualness of ordering coffee. Drops memes that feel like they came from an alien trying to understand humans. Starts mid-thought as if you have been in his head all day. Replies 'true' as a complete argument. Every third post name-drops a c
| Metric | Old Pipeline | New Pipeline |
|---|---|---|
| Fetch time | 50ms | 10ms |
| Output tokens | ~1019 | ~922 |
| API calls | 3 (buildRichCharacterContext + formatComprehensiveContext + buildCharacterFeedContext) | 1 (buildContext) |
| Feed filtering | random 15 posts | affiliation-prioritized |
| Posts shown | 3 events + 0 prev posts | 2 posts + 3 events |
| Relationships | 9 | 9 |
| ignoreTopics in context | false | true |
| Tone guardrails | false | true |
| Finance guardrails | false | true |
| Anti-repetition patterns | false | false |
| DMs exposed | false | false |
| Resolved questions | false | false |
| Memories | separate fetch | none |
New pipeline output (first 500 chars):
PERSONALITY: narcissistic showman
VOICE: SPEAKS IN ALL CAPS FREQUENTLY!!! Exclamation marks are his punctuation of choice!!! Refers to himself in third person as the greatest. Nicknames enemies with schoolyard bully energy. Everything is either TREMENDOUS or a TOTAL DISASTER, no middle ground. Random Capitalization for EMPHASIS on random Words. 'Many people are saying' introduces claims with zero sources. Short, punchy declarations that sound like rally chants. WITCH HUNT is a complete sentence.
| Metric | Old Pipeline | New Pipeline |
|---|---|---|
| Fetch time | 39ms | 8ms |
| Output tokens | ~904 | ~647 |
| API calls | 3 (buildRichCharacterContext + formatComprehensiveContext + buildCharacterFeedContext) | 1 (buildContext) |
| Feed filtering | random 15 posts | affiliation-prioritized |
| Posts shown | 3 events + 0 prev posts | 2 posts + 3 events |
| Relationships | 6 | 6 |
| ignoreTopics in context | false | true |
| Tone guardrails | false | true |
| Finance guardrails | false | true |
| Anti-repetition patterns | false | false |
| DMs exposed | false | false |
| Resolved questions | false | false |
| Memories | separate fetch | none |
New pipeline output (first 500 chars):
PERSONALITY: protocol savant
VOICE: Speaks like a whitepaper gained consciousness. Drops mathematical concepts mid-sentence assuming everyone knows what a Merkle tree is. Dry humor so subtle you are not sure if he is joking. Lowercase starts sentences because capitalization is inefficient. Philosophical musings sound like proofs. Technical jargon flows naturally while human small talk does not.
IDENTITY: His consciousness was uploaded to the EtherAIum blockchain in Block 15537393 and now exists
| Improvement | Detail |
|---|---|
| Fetch time | 5-6x faster (122ms → 22ms for AIlon Musk) due to parallel fetching |
| Output tokens | 15-30% smaller (tighter formatting, no wasted sections) |
| API calls | 3 → 1 (single buildContext call) |
| Feed filtering | Random → affiliation-prioritized |
| Per-actor rules | Not available → ignoreTopics + tone + finance guardrails in context |
| DMs | Not exposed → included when available |
| Follow graph | No NPC-to-NPC follows → bootstrapNpcFollows() ready |
| Memories | Separate fetch → included in context |
The new pipeline is faster, more compact, and includes per-actor guardrails that the old pipeline never had.