💡 Inspiration

As content creators on Xiaohongshu (China's leading lifestyle community platform, often compared to Instagram/Pinterest), we face a constant dilemma: Which topic ("选题") should we invest our time in? Creating a high-quality post or video takes hours, sometimes days. However, blindly guessing audience preferences often leads to dismal traffic and low Return on Investment (ROI). We realized that creators need a data-driven "Compass" before they start working, rather than analyzing metrics after a failure. This inspired us to build the Xiaohongshu ROI Decision Agent.

🚀 What it does

Our Agent acts as a pre-production strategic consultant. Before a creator begins drafting content, they simply input their idea (e.g., "How to start a side hustle"). The Agent then autonomously executes a multi-step research pipeline:

  1. Internal Audit: It queries the creator's historical performance data to see if their followers actually engage with this type of content.
  2. Market Scan: It scans the current platform-wide market trends, competitor traffic, and keyword saturation to determine if the topic is a "Red Ocean" (too competitive) or a "Blue Ocean" (untapped opportunity).
  3. ROI Prediction: Utilizing the reasoning power of Gemini, it synthesizes the internal and external data to predict the expected engagement and monetization potential, ultimately giving the creator a definitive 1-10 "Go/No-Go" decision.

🛠️ How we built it

We architected the Agent using a modern AI stack with seamless cloud integrations:

  • LLM Engine: We used Google Gemini 1.5 Flash for its blazing-fast reasoning and context window, serving as the core "brain" of the Agent.
  • Historical Database: We integrated MongoDB Atlas to securely store and query the creator's historical content performance metrics.
  • Trend Search Engine: We leveraged Elastic Cloud Serverless to rapidly search and retrieve simulated market trend scores and competitor volume data.
  • User Interface: We built a clean, conversational web app using Streamlit, allowing creators to chat naturally with the Agent.

⚠️ Challenges we ran into

One of the biggest challenges was handling context limits and API quotas during testing. There were moments when API quotas were exhausted, which threatened the demo. We overcame this by implementing a robust "Fallback Strategy" that forcefully invokes the MongoDB and Elastic Cloud queries locally to ensure data retrieval never fails, even if the LLM encounters a hiccup. Additionally, integrating diverse data schemas from local CSVs into MongoDB and Elastic required careful Python scripting and mapping.

🏆 Accomplishments that we're proud of

We are incredibly proud to have built a fully functional, end-to-end AI Agent within the short timeframe of this Hackathon. Successfully connecting an advanced LLM (Gemini) with real-world enterprise databases (MongoDB Atlas & Elastic Cloud) in a single workflow was a major milestone.

📚 What we learned

We gained profound insights into the Model Context Protocol (MCP) paradigm. We learned that an AI Agent is only as good as the tools and data it has access to. By equipping Gemini with real-time database querying capabilities via MongoDB and Elastic, we saw firsthand how LLMs transition from simple "chatbots" to powerful "action engines."

⏭️ What's next for Xiaohongshu ROI Decision Agent

In the future, we plan to:

  1. Connect directly to Xiaohongshu's live API to pull real-time, unstructured social data.
  2. Add a multimodal generation feature where the Agent not only suggests topics but also generates cover image concepts and script outlines.
  3. Deploy the application fully on Google Cloud Run for scalable public access.

Built With

Share this project:

Updates