Have you ever tried to read a law and got completely lost halfway through?
Yeah, me too. 😅
That’s one reason I decided to build the NDPA AI Agent — an AI-powered assistant that helps anyone in Nigeria understand the Nigeria Data Protection Act (NDPA) 2023 in English.
With this AI agent, you can simply ask:
“What are my rights as a data subject?”
“What are the duties of data controllers?”
“Does NDPA apply to foreign companies?”
…and it gives you accurate, referenced answers pulled directly from the law — fast and easy.
⚙️ What Powers the NDPA AI Agent?
This agent was built using Mastra AI, a powerful open-source framework for building and evaluating AI agents.
Mastra lets you easily define your agent’s tools, memory, scoring system, and workflows without heavy coding. It’s perfect for both developers and learners who want to build useful AI assistants.
👉 Learn more about Mastra AI here: https://mastra.ai
💡 What the NDPA AI Agent Does
The NDPA AI Agent helps people, startups, or privacy officers quickly understand the NDPA.
When you ask a question, it:
- Searches through a structured JSON copy of the NDPA.
- Finds the most relevant section (for example, Part I, Section 1).
- Summarizes the section.
- Explains it in clear, plain English.
Here’s the live version of my agent on Telex 👇
🔗 Try the NDPA AI Agent on Telex
💬 What Is Telex?
Telex is an AI agent platform like Make, where you can integrate and chat with AI agents in real-time.
Think of it as a Slack alternative for education, bootcamps, or communities — but designed for intelligent, task-specific agents.
Once I finished building the NDPA AI Agent in Mastra, I connected it to Telex so anyone can use it directly — no installation or coding needed.
🧩 Mastra Features I Used to Build My Agent
Here are the Mastra features that powered my project — explained simply:
- Agent
The Agent feature defines the brain of your assistant — what it knows, how it behaves, and which model it uses.
For the NDPA Agent, I used:
A Groq model (moonshotai/kimi-k2-instruct-0905) for reasoning and understanding.
Detailed instructions to ensure it always explains answers clearly and cites NDPA sections.
- Tools
Mastra’s tools let your agent perform actions or access data.
I built a custom tool called search-ndpa, which searches a structured JSON version of the NDPA to find the right section for any question.
Example:
When someone asks, “Who oversees data protection in Nigeria?”,
the tool fetches the section that mentions the Data Protection Commission.
- Memory
I used Mastra’s Memory with a LibSQLStore so the agent can keep context during conversations — it remembers previous questions in a chat session.
That means if you ask:
“What does NDPA say about consent?”
“And what about data breaches?”
The agent understands that both questions are related.
- Scorers
Mastra has a smart evaluation system called Scorers that helps you measure how good your AI agent’s responses are.
I used three scorers:
- Tool Call Accuracy Scorer – checks if the right tool was used.
- Completeness Scorer – makes sure the answer is complete.
- Relevance Scorer – ensures the section it found is truly relevant to your question.
These scorers help the agent learn and improve accuracy over time.
- Workflows
Workflows in Mastra connect multiple steps together.
For example, my NDPA workflow does this:
Step 1: Search for the NDPA section.
Step 2: Summarize and explain it in simple English.
That’s how the agent moves smoothly from “search” → “summarize” → “explain.”
🧱 How It All Comes Together
Here’s what happens behind the scenes when you chat with the NDPA Agent:
- You ask a question.
- The agent runs its search-ndpa tool to find the best matching section from the NDPA JSON.
- It reads the legal text and generates a clear summary.
- The Mastra workflow stitches the process together.
- The agent returns a simple explanation you can understand — no legal jargon needed.
🚀 How to Build Your Own AI Agent Like This
If you’d love to build your own custom AI agent (maybe for education, business, or another local law), here’s how to start:
- Visit Mastra AI: Follow their setup guide to create a new agent project.
- Define your agent (what it does, how it behaves).
- Add a tool that connects your data source (like a JSON file or API).
- Create a workflow if you want multi-step logic.
- Add scorers to evaluate your agent’s accuracy.
- Finally, connect your agent to Telex and publish it for others to use.
You can then share your Telex agent link — just like this:
🔗 NDPA AI Agent on Telex
🎯 Why I Built This
Nigeria’s Data Protection Act is an important law, but many people and businesses still find it confusing or inaccessible.
My goal with the NDPA AI Agent is to make that information open, understandable, and actionable — for everyone.
I believe AI should simplify knowledge, not make it harder.
And frameworks like Mastra AI and platforms like Telex make it possible to bring that vision to life — even if you’re not a heavy coder.
💬 Final Thoughts
Building the NDPA AI Agent taught me two big lessons:
- You don’t need to be a hardcore developer to create useful AI tools.
- AI agents are more powerful when they focus on solving real, local problems.
So if you’ve been thinking about creating your own AI agent — do it!
Start small, use Mastra, connect it to Telex, and share it with your community.
👉 Try the NDPA AI Agent here: https://telex.im/telex-ai-intergration/home/colleagues/browse/019a45d5-01aa-7650-82af-2d60d6c3e7d1
👉 Learn more about Telex: https://telex.im
👉 Learn more about Mastra AI: https://mastra.ai

Top comments (0)