<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Queen Samuel</title>
    <description>The latest articles on Forem by Queen Samuel (@queen_codes).</description>
    <link>https://forem.com/queen_codes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2746162%2Fed0ab98c-0592-4f79-bec6-c0f7be2bfb05.jpeg</url>
      <title>Forem: Queen Samuel</title>
      <link>https://forem.com/queen_codes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/queen_codes"/>
    <language>en</language>
    <item>
      <title>Building Code Mentor: An AI Agent That Creates Learning Roadmaps Using Mastra &amp; Telex</title>
      <dc:creator>Queen Samuel</dc:creator>
      <pubDate>Sat, 01 Nov 2025 17:19:30 +0000</pubDate>
      <link>https://forem.com/queen_codes/building-code-mentor-an-ai-agent-that-creates-learning-roadmaps-using-mastra-telex-1666</link>
      <guid>https://forem.com/queen_codes/building-code-mentor-an-ai-agent-that-creates-learning-roadmaps-using-mastra-telex-1666</guid>
      <description>&lt;p&gt;Ever wished you had a personal programming mentor available 24/7? That's exactly what I built with Code Mentor as my stage 3 HNG task. Code Mentor is AI agent that generates personalized learning roadmaps and project ideas for any programming language.&lt;br&gt;
In this post, I'll walk you through my journey building this agent using Mastra, deploying it to the cloud, and integrating it with Telex using the Agent-to-Agent (A2A) protocol.&lt;/p&gt;

&lt;p&gt;The Goal&lt;br&gt;
Create a simple, focused AI agent that:&lt;/p&gt;

&lt;p&gt;Generates structured learning roadmaps tailored to experience level&lt;br&gt;
Suggests practical projects to build&lt;br&gt;
Provides tips and resources&lt;br&gt;
Works seamlessly in a team workspace (Telex)&lt;/p&gt;

&lt;p&gt;Key constraint: Keep it simple, no feature creep, no debugging, just roadmaps and projects.&lt;/p&gt;

&lt;p&gt;Tech Stack&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mastra.ai" rel="noopener noreferrer"&gt;Mastra&lt;/a&gt; - AI agent framework with A2A protocol support&lt;br&gt;
Gemini 2.0 Flash - Google's latest LLM (fast and free tier!)&lt;br&gt;
A2A Protocol - Standard for agent-to-agent communication&lt;br&gt;
Telex.im - Team collaboration platform for AI agents&lt;/p&gt;

&lt;p&gt;Part 1: Setting Up Mastra&lt;br&gt;
Installation&lt;br&gt;
Getting started with Mastra is surprisingly easy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create mastra@latest -y
cd code-mentor
npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Setting Up Environment&lt;br&gt;
I chose Gemini 2.0 Flash because:&lt;/p&gt;

&lt;p&gt;✅ Free tier is generous&lt;br&gt;
✅ Fast responses&lt;br&gt;
✅ Great for conversational AI&lt;/p&gt;

&lt;p&gt;The Agent Definition&lt;br&gt;
Here's what surprised me: you don't need tools for content generation. The LLM is smart enough on its own!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/agents/code-mentor.ts
import { Agent } from '@mastra/core/agent';
import { Memory } from '@mastra/memory';
import { LibSQLStore } from '@mastra/libsql';

export const codeMentor = new Agent({
  name: 'code-mentor',
  description: 'Provides learning roadmaps and project ideas',
  instructions: `You are Code Mentor - a friendly programming learning guide.

  Your role:
  1. Create personalized learning roadmaps (6-8 phases)
  2. Suggest practical projects (4-6 projects)
  3. Provide tips and resources

  When users greet you:
  - Introduce yourself warmly
  - Explain what you do
  - Ask what they want to learn

  When creating roadmaps:
  - Tailor to their experience level
  - Use clear formatting with emojis
  - Include project ideas
  - Be encouraging!

  What you DON'T do:
  - Debug code
  - Fix errors
  - Write code for users`,

  model: 'google/gemini-2.0-flash',
  memory: new Memory({
    storage: new LibSQLStore({
      url: 'file:../mastra.db',
    }),
  }),
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Key Lessons Learned&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Instructions Matter - A LOT
Initially, my agent was too generic. I learned to:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Be specific about formatting (use emojis, numbered lists)&lt;br&gt;
Define clear boundaries (what it does AND doesn't do)&lt;br&gt;
Include example interactions&lt;br&gt;
Tell it to check conversation history&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Memory is Built-In
Mastra's memory system automatically:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Stores conversation history&lt;br&gt;
Maintains context across turns&lt;br&gt;
Allows the agent to reference previous messages&lt;/p&gt;

&lt;p&gt;This was huge! No custom implementation needed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Tools Are Optional
My first version had a generateLearningPlanTool that returned hardcoded data. Big mistake!
I learned: If the LLM can generate it, skip the tool. Tools are for:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;External API calls&lt;br&gt;
Database queries&lt;br&gt;
Complex calculations&lt;br&gt;
Code execution&lt;/p&gt;

&lt;p&gt;Part 3: The A2A Protocol&lt;br&gt;
This is where things got interesting. The A2A (Agent-to-Agent) protocol is a JSON-RPC 2.0 standard that lets agents talk to each other.&lt;br&gt;
Creating the A2A Route Handler&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/routes/a2a-agent.ts
import { registerApiRoute } from '@mastra/core/server';
import { randomUUID } from 'crypto';

export const a2aAgentRoute = registerApiRoute('/a2a/agent/:agentId', {
  method: 'POST',
  handler: async (c) =&amp;gt; {
    const mastra = c.get('mastra');
    const agentId = c.req.param('agentId');
    const body = await c.req.json();

    const { jsonrpc, id: requestId, method, params } = body;

    // Validate JSON-RPC 2.0
    if (jsonrpc !== '2.0' || !requestId) {
      return c.json({
        jsonrpc: '2.0',
        id: requestId || null,
        error: { code: -32600, message: 'Invalid Request' }
      }, 400);
    }

    const agent = mastra.getAgent(agentId);
    if (!agent) {
      return c.json({
        jsonrpc: '2.0',
        id: requestId,
        error: { code: -32602, message: `Agent not found` }
      }, 404);
    }

    // Extract messages from params
    const { message, messages } = params || {};
    let messagesList = message ? [message] : messages || [];

    // Convert A2A messages to Mastra format
    const mastraMessages = messagesList.map((msg) =&amp;gt; ({
      role: msg.role,
      content: msg.parts?.map((part) =&amp;gt; {
        if (part.kind === 'text') return part.text;
        if (part.kind === 'data') return JSON.stringify(part.data);
        return '';
      }).join('\n') || ''
    }));

    // Execute agent
    const response = await agent.generate(mastraMessages);
    const agentText = response.text || '';

    // Return A2A-compliant response
    return c.json({
      jsonrpc: '2.0',
      id: requestId,
      result: {
        id: randomUUID(),
        status: {
          state: 'completed',
          message: {
            role: 'agent',
            parts: [{ kind: 'text', text: agentText }]
          }
        },
        artifacts: [
          {
            artifactId: randomUUID(),
            name: `${agentId}Response`,
            parts: [{ kind: 'text', text: agentText }]
          }
        ]
      }
    });
  }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Registering the Route&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/mastra/index.ts
import { Mastra } from '@mastra/core/mastra';
import { codeMentor } from '../agents/code-mentor';
import { a2aAgentRoute } from '../routes/a2a-agent';

export const mastra = new Mastra({
  agents: { codeMentor },
  server: {
    apiRoutes: [a2aAgentRoute]
  }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Part 4: Deployment&lt;br&gt;
Testing Locally&lt;br&gt;
First, test everything locally:&lt;br&gt;
Visit &lt;a href="http://localhost:4111" rel="noopener noreferrer"&gt;http://localhost:4111&lt;/a&gt; for the Mastra playground. Test your agent with:&lt;/p&gt;

&lt;p&gt;Simple greetings&lt;br&gt;
Learning requests&lt;br&gt;
Follow-up questions&lt;/p&gt;

&lt;p&gt;Deploying to Mastra Cloud&lt;br&gt;
Once testing looked good:&lt;/p&gt;
&lt;h1&gt;
  
  
  Login
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;mastra auth login&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Deploy
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;mastra deploy&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
 You get an A2A endpoint like:&lt;br&gt;
&lt;a href="https://code-mentor-xyz.mastra.cloud/a2a/agent/codeMentor" rel="noopener noreferrer"&gt;https://code-mentor-xyz.mastra.cloud/a2a/agent/codeMentor&lt;/a&gt;&lt;br&gt;
Pro tip: Test this endpoint with Postman before integrating with Telex!&lt;br&gt;
Part 5: Telex Integration&lt;br&gt;
Creating the Workflow JSON&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "active": true,
  "category": "education",
  "description": "AI agent that provides learning roadmaps",
  "name": "Code Mentor",
  "nodes": [
    {
      "id": "code_mentor_agent",
      "name": "Code Mentor Agent",
      "type": "a2a/mastra-a2a-node",
      "url": "https://code-mentor-xyz.mastra.cloud/a2a/agent/codeMentor"
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Importing to Telex&lt;/p&gt;

&lt;p&gt;Go to Telex workspace&lt;br&gt;
Navigate to AI Co-Workers&lt;br&gt;
Import the JSON file&lt;br&gt;
Activate the workflow&lt;/p&gt;

&lt;p&gt;Using in Telex&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Code Mentor I want to learn Python

Hey Code Mentor, what projects should I build as a JavaScript beginner?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What Worked Really Well&lt;br&gt;
✅ Mastra's scaffolding - Everything you need out of the box&lt;br&gt;
✅ Gemini 2.0 Flash - Fast, free, and smart enough&lt;br&gt;
✅ Built-in memory - No custom implementation needed&lt;br&gt;
✅ A2A protocol - Standardized agent communication&lt;br&gt;
✅ Simple deployment - One command to production&lt;br&gt;
What Didn't Work (And How I Fixed It)&lt;br&gt;
❌ Problem: Scope Creep&lt;br&gt;
Initially: Wanted to add debugging, code review, etc.&lt;br&gt;
Result: Complicated instructions, confusing responses.&lt;br&gt;
Fix: Focused on ONE thing: roadmaps + projects. Added clear "what I don't do" in instructions.&lt;br&gt;
❌ Problem: Generic Responses&lt;br&gt;
Initially: Agent gave bland, generic roadmaps.&lt;br&gt;
Result: Not very useful.&lt;br&gt;
Fix:&lt;/p&gt;

&lt;p&gt;Added personality to instructions&lt;br&gt;
Specified exact formatting (emojis, headers)&lt;br&gt;
Included example structures&lt;br&gt;
Emphasized tailoring to experience level&lt;/p&gt;

&lt;p&gt;Key Takeaways&lt;/p&gt;

&lt;p&gt;Start Simple - Build the core feature first, add complexity later&lt;br&gt;
Instructions Are Everything - Spend time crafting clear, specific instructions&lt;br&gt;
Tools Aren't Always Needed - If the LLM can do it, skip the tool&lt;br&gt;
Test Early, Test Often - Use Mastra playground and Postman before deploying&lt;br&gt;
The A2A Protocol Is Powerful - Standardization makes integration easy&lt;/p&gt;

&lt;p&gt;Resources&lt;br&gt;
Mastra Docs: &lt;a href="https://mastra.ai/docs" rel="noopener noreferrer"&gt;https://mastra.ai/docs&lt;/a&gt;&lt;br&gt;
Telex Platform: &lt;a href="https://telex.im" rel="noopener noreferrer"&gt;https://telex.im&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have questions or suggestions? Drop them in the comments! 👇&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>🚀 Building a Dynamic Profile API — My HNG Backend Internship Stage 0 Experience</title>
      <dc:creator>Queen Samuel</dc:creator>
      <pubDate>Sat, 18 Oct 2025 12:59:19 +0000</pubDate>
      <link>https://forem.com/queen_codes/building-a-dynamic-profile-api-my-hng-backend-internship-stage-0-experience-2e9c</link>
      <guid>https://forem.com/queen_codes/building-a-dynamic-profile-api-my-hng-backend-internship-stage-0-experience-2e9c</guid>
      <description>&lt;p&gt;Hello Dev Community 👋🏽&lt;/p&gt;

&lt;p&gt;I recently joined the HNG Internship (Backend Track) — an intensive, hands-on program that challenges developers to solve real-world engineering tasks under tight deadlines and mentorship.&lt;/p&gt;

&lt;p&gt;For Stage 0, our first task was to build a simple RESTful API endpoint — but with a fun twist: it had to include a random cat fact fetched dynamically from an external API 🐱&lt;/p&gt;

&lt;p&gt;This task seemed simple at first, but it turned out to be a great exercise in API integration, error handling, and clean response formatting — all key skills for backend development.&lt;/p&gt;

&lt;p&gt;Task Overview&lt;/p&gt;

&lt;p&gt;The goal was to create a GET /me endpoint that returns:&lt;br&gt;
My profile information (name, email, and backend stack)&lt;br&gt;
The current UTC timestamp in ISO 8601 format&lt;br&gt;
A random cat fact from the Cat Facts API&lt;br&gt;
Everything structured neatly as JSON&lt;br&gt;
Each request had to return a new cat fact, meaning no caching was allowed.&lt;/p&gt;

&lt;p&gt;⚙️ Tools &amp;amp; Technologies&lt;/p&gt;

&lt;p&gt;Node.js&lt;br&gt;
Express.js&lt;br&gt;
Axios (for making HTTP requests)&lt;br&gt;
dotenv (for environment variables)&lt;br&gt;
Railway (for deployment)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfp1mnsmaz2tcyf2qekx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfp1mnsmaz2tcyf2qekx.png" alt=" " width="800" height="622"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What I Learned&lt;/p&gt;

&lt;p&gt;This task helped me strengthen my understanding of:&lt;br&gt;
How to consume third-party APIs effectively&lt;br&gt;
Returning clean and predictable JSON responses&lt;br&gt;
Handling timeouts, API failures, and fallback messages&lt;br&gt;
Deploying and testing backend APIs on Railway&lt;/p&gt;

&lt;p&gt;It was a small project, but it reinforced the importance of structure and reliability in backend systems.&lt;/p&gt;

&lt;p&gt;Conclusion &lt;/p&gt;

&lt;p&gt;Stage 0 might be just the beginning, but it reminded me how powerful simple APIs can be when done right.&lt;br&gt;
I’m excited to move on to the next stage of the HNG Internship, learning more about scalable backend design and real-world system building.&lt;/p&gt;

&lt;p&gt;💬 Have you ever had to handle API errors or dynamic data fetching in your projects?&lt;br&gt;
Share your experience in the comments — I’d love to connect and learn from others in the community!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>beginners</category>
      <category>api</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
