The Inspiration

The inspiration for AI Collective Mind came from a simple question: What if an AI could learn from the collective wisdom of its users? Standard AI often gives generic, idealistic advice that doesn't work in the real world. I wanted to build an AI that gets smarter, more pragmatic, and more human with every piece of feedback it receives. The goal was to create an AI that doesn't just talk, but truly listens.

How It's Built

The project is a full-stack application built with Next.js, leveraging its powerful capabilities for both the frontend UI and the serverless API backend.

The true "brain" of the application is Storyblok. I went beyond using it as a simple content repository and architected it as a dynamic knowledge base for the AI. I created three core components:

  • AIPrompt: A reusable block that defines the AI's persona, core rules, and base examples for different categories (like "Conflict with the boss" or "Negotiating a Salary").
  • ExamplePair: A nested block to provide clear "good" and "bad" examples for the AI to learn from.
  • UserFeedback: A content type that acts as the AI's long-term memory, storing every piece of user-rated advice.

When a user submits a query, the Next.js API endpoint dynamically fetches the relevant AIPrompt from Storyblok. Then, in the project's most innovative step, it also fetches the 5 most recent pieces of "bad" advice from the UserFeedback entries. All of this context is compiled into a sophisticated "mega-prompt" and sent to the Google Gemini API.

The generated advice is displayed to the user, who can then rate it 👍 or 👎. This rating is sent to another API endpoint, which uses Storyblok's Management API to save the feedback, thus closing the "live learning" loop. This real-time adaptation, inspired by the principles of Reinforcement Learning from Human Feedback (RLHF), is the project's most innovative feature.

What I Learned

The biggest lesson was realizing the true potential of a Headless CMS like Storyblok. Using it as a configurable, living "memory" for an AI application was a breakthrough moment for me. I also gained valuable experience in prompt engineering—crafting the right instructions to guide the AI's behavior and personality.

Challenges I Faced

The main architectural challenge was designing the feedback loop to be truly effective. I had to ensure that user feedback wasn't just stored, but actively used to influence future AI responses.

It was interesting to see the final "live learning" feature come to life.

Built With

Share this project:

Updates