Unlocking Deeper Intelligence: Our CORE Persona Refactor and Multi-Model Leap
Dive into our latest development sprint where we overhauled our AI personas with the powerful CORE framework, integrated cutting-edge LLM models, and unlocked multi-persona insights for richer intelligence.
It's been an incredibly productive sprint! We've just wrapped up a significant chunk of work that touches the very heart of how our AI-powered features interact with users and generate insights. From a complete refactor of our internal personas to integrating the latest LLM models and enabling multi-perspective enrichment, this session was all about pushing the boundaries of intelligent assistance.
Let's break down what we accomplished and the lessons we learned along the way.
The CORE of Persona Design: A New Standard for AI Identity
One of the biggest undertakings this sprint was the complete refactoring of all our built-in AI personas. Historically, some of these personas had fairly sparse, one-sentence prompts. While they worked, we knew we could do better. Our goal was to bring consistency, clarity, and depth to every persona, ensuring more reliable and nuanced outputs from our LLMs.
We achieved this by implementing the CORE framework for persona definition. CORE stands for:
- C (Context): Who is this persona? What's their background, experience, domain, and even the era they operate in?
- O (Objective): What is their primary mission? What are their core functions and goals?
- R (Role & Rules): What MUST they do (positive constraints) and what MUST NOT they do (negative constraints)? These are crucial for guiding behavior.
- E (Expression): What's their tone, syntax, and communication style?
Beyond CORE, we also baked in explicit Safety & Anti-Hallucination instructions (e.g., fact-binding, fallback phrases) and provided In-Character Examples – two Q&A pairs per persona to demonstrate their voice and boundaries.
This refactor wasn't just about adding more text; it was about creating a structured, robust foundation for AI identity. We expanded previously sparse personas like Sasha, Noor, Avery, and Quinn from single sentences to full, detailed CORE definitions within prisma/seed.ts. To ensure future generated personas adhere to this high standard, we also updated the LLM prompt in src/server/services/persona-generator.ts to instruct the model on using the CORE framework, bumping its max token output to 4096 for richer descriptions.
The result? More consistent, predictable, and high-quality responses across all our AI interactions.
Expanding Our LLM Horizons: Welcoming Opus and Fixing Haiku
Staying at the forefront of AI capabilities means continuously integrating the latest and most powerful models. This sprint, we proudly added claude-opus-4-20250514 to our MODEL_CATALOG in src/lib/constants.ts and updated our COST_RATES in src/server/services/llm/types.ts to reflect its premium pricing (75 per 1M tokens). Opus is a game-changer for complex reasoning and nuanced understanding, and we're excited about the possibilities it opens up.
On a smaller, but equally important note, we also fixed a stale model ID for claude-haiku in our COST_RATES, bringing it in line with the rest of our codebase's up-to-date model references. Small details like this ensure accuracy in cost tracking and model selection.
Beyond Single Perspectives: Multi-Persona Enrichment
One of the most exciting new features we shipped is the ability to enrich notes using multiple personas. Previously, you could only select a single persona to provide insights. Now, you can select up to three!
This involved several key changes:
- Frontend: In
src/app/(dashboard)/dashboard/projects/[id]/page.tsx, we switched ourPersonaPickercomponent frommode="single"tomode="multi"and capped the selection at a maximum of three personas. - Backend (tRPC): We updated the enrichment input in
src/server/trpc/routers/projects.tsto acceptpersonaIds: z.array(z.string().uuid()).max(3).optional(). - Service Logic: The core magic happens in
src/server/services/note-enrichment.ts. This service now intelligently loads all selected personas, preserves their selection order, and if multiple are chosen, combines their system prompts with a synthesis instruction. This allows the LLM to provide richer, more synthesized insights by considering multiple expert viewpoints simultaneously.
Imagine getting feedback on a document from a "Technical Architect," a "User Experience Designer," and a "Marketing Strategist" all at once, blended into a coherent set of recommendations. That's the power of multi-persona enrichment!
Navigating the Code Jungle: A Template Literal Tale
Even with the best planning, development always throws a curveball or two. This sprint, our challenge came from a seemingly innocuous character: the backtick.
While refactoring the persona system prompts in prisma/seed.ts, we ran into a TypeScript TS1005 parse error. The culprit? Backtick characters () used for inline code references within template literal strings. It turns out, nesting backticks or even having unescaped ${` patterns inside a template literal, especially in a seed file that's parsed by TypeScript, can confuse the parser.
Our workaround: We removed backticks from generic inline code references (e.g., changing \`==``to==) and, for Prisma-specific references (like in Dr. Priya Sharma's prompt), we used `` to escape the backtick character.
Lesson Learned: When constructing complex template literals, especially in configuration or seed files, be mindful of unescaped backticks and ${ patterns. It's a subtle detail, but one that can halt your compilation!
What's Next?
With the main work complete, pushed to origin/main (commit 52d9ffc), and all 139 unit tests passing, we're in a great spot. The immediate next steps involve:
- Run
npm run db:seed: This is crucial to apply all the new CORE-framework persona prompts to our database. - Test Multi-Persona UI: Verify the max 3 cap works and, more importantly, evaluate the quality of the combined prompt synthesis.
- Documentation: Update
docs/06-workflow-intelligence.mdwith new compliance report export details. - Future Enhancements: Start considering A/B temperature testing and adversarial jailbreak tests for our CORE personas, as outlined in our design document.
This sprint has significantly leveled up our platform's intelligence and flexibility. We're excited to see how these enhancements empower our users to gain even deeper, more nuanced insights from their data. Stay tuned for more updates!