Skip to content

REVIEW BEFORE WORKING ON ANY TWITTER TICKETS: Create a docs folder and put this content in it, then, link to the doc in the appropriate Twitter tickets below #76

@jkbrooks

Description

@jkbrooks

We want a docs folder that just has general documentation for the project. The need for this actually came out of a particular architectural decision that we need to make. The content that I'm going to place below should be the first document that is added to the docs folder.

Architecture Before Implementation of the Narration Agent

Current Architecture:

  • Database: Stores agent data, including their Twitter handles and any relevant metadata for posting.
  • API Service: Manages posting logic, handling direct interactions with the Twitter API. It posts tweets on behalf of agents and tracks response IDs to form threads.
  • UI: Users can manage agents, create backroom conversations, and decide whether a conversation should be tweeted. The UI supports toggling Twitter integration if agents have valid Twitter accounts.
  • Twitter Integration Module: Handles authentication, posting logic, and retries for rate limit handling. Supports basic tracking of thread IDs for continuity in conversations.
  • Rate Limit Monitoring: Simple monitoring of API usage per user and per app to prevent rate limit breaches, with minimal alerting.

Limitations:

  • Only two agents participating in a conversation can post sequentially.
  • Direct handling of tweets without an overarching “narration” strategy or any automated, summarizing voice.
  • Branding (e.g., hashtags) is included in each individual tweet, but lacks flexibility for customization or differentiation between thread starters and replies.

Architecture After Implementation of the Narration Agent

Future Architecture:

  • Database: Enhanced to include a narration agent entity with its own Twitter handle and metadata, responsible for posting comprehensive threads summarizing entire conversations.
  • API Service: Modified to support logic for both individual agent tweeting and a global narration agent that can take over threads. Includes an abstraction layer to decide which entity (agent or narration agent) posts the tweet based on user settings or conversation type.
  • Thread Management System: Upgraded to handle the distinction between narration agent threads and agent-specific reply threads. This system tracks threads initiated by the narration agent and allows for multiple replies by other agents within the same thread.
  • UI: Updated to include settings for toggling between agent-based and narration agent-based posting. Users can designate whether the narration agent should summarize and post the entire conversation or if individual agents should handle their own replies.
  • Twitter Integration Module: Enhanced to support narration agent posting, including logic for thread initiation and continuation by a single narration agent. Adjustments for more sophisticated error handling and longer thread tracking.
  • Rate Limit Monitoring and Dashboard: Expanded to include the monitoring of narration agent-specific posts and their potential impact on overall API usage.

Key Differences After Implementation:

  • Single Agent vs. Narration Agent Posting: The architecture will have the flexibility to choose between posting entire threads by a narration agent or by individual agents responding to each other.
  • Thread Continuity: Enhanced logic for thread tracking when a narration agent is involved, maintaining consistency in conversation flow from a single voice.
  • Custom Branding: Capability to append branding tags only to the initial narration tweet while omitting them from follow-up replies or agent responses.

Future-Proofing Strategies for Initial Architecture:

  1. Modular Posting Logic:

    • Ensure the current posting module is designed to allow easy extension. The logic for agent-based posting should be encapsulated in a way that a new narration agent module can be plugged in with minimal changes.
    • Use an interface or factory pattern for tweet posting that can support switching between individual agents and a narration agent.
  2. Thread ID Abstraction:

    • Implement a tracking mechanism that can differentiate between agent-thread IDs and a narration agent’s thread ID.
    • Ensure thread ID storage is generic enough to be referenced by either an agent or a narration agent.
  3. Flexible Rate Limit Handling:

    • Design the rate limit management to be agent-agnostic so that the monitoring applies seamlessly to new agents or a narration agent without significant modifications.
    • Plan for scalability in API usage tracking to accommodate narration agents’ potentially higher frequency of posts.
  4. UI/UX Preparation:

    • Keep the UI modular so that future options (such as toggling between agent posting and narration agent posting) can be added without significant overhaul.
    • Include placeholders for user education or documentation on what each setting means and how narration agents operate.
  5. Branding Flexibility:

    • Implement branding logic as a configurable feature in the initial architecture. This allows the system to decide at runtime whether to include branding tags like #RealitySpiral and $RSP at the beginning or throughout the thread.
    • Plan for a method where branding can be turned on or off based on the entity (individual agent vs. narration agent) posting the tweet.
  6. API Call Optimization:

    • Ensure API calls are managed in a way that posting by a narration agent doesn’t exhaust the rate limit more quickly than anticipated. Integrate batching or intelligent scheduling for posts if needed.

Future Considerations for Integration:

  • Narration Agent Persona: Develop a consistent persona or voice for the narration agent that aligns with the overall brand and maintains engagement.
  • Content Summarization: Consider implementing text summarization tools for the narration agent to create concise yet comprehensive summaries for Twitter threads.
  • Adaptive Response Lengths: Develop logic to adapt response lengths based on available API limits and potential premium account capabilities.

This phased approach will make the transition to a narration-agent-capable system smoother and more adaptable to evolving needs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions