Build your free agent assistant with NextJS & Notion API
We used to joke that by 2026, everyone would have their own personal AI agent. But it’s no longer a joke. it's becoming reality. Building your own AI assistant is now easier than ever, and even better, it’s free. So let’s dive in and make it happen.
1. The Core Concept: "Dynamic Context"
The idea is to build a chat agent that everyone can ask about me. And integrate that agent on my Portfolio website.
My goal was to separate the data from the code.
- The Data (My Memory): Should live in a tool I use every day (Notion).
- The Brain (The AI): Should understand natural language (Gemini).
- The Face (The UI): Should be a fast, modern website (Next.js).
2. The Architecture
1. The Knowledge Base: Notion
Instead of a database like SQL or MongoDB, I use Notion. Why? because Notion offers the best UI for data entry, also provide manage data as multiple database.
So, this is the way I store my data on notion
| Work data
| Blogs data
| Basic data
* note: There’s another way to store and retrieval data called RAG, but to make this simple, we do not apply that technique.
2. The Brain: Google Gemini (LLM)
Raw data is boring. If a recruiter asks, "Is he a good fit for a Fullstack role?", they don't want to search through a table of keywords. They want an answer.
This is where Google Gemini comes in.
There are a lot of libraries and SDKs you can use to create an Agent. I am using LangChain.
The two things we need to set up are:
- Tools: A tool is a function that the Agent can consider and invoke. Tools are also provided by MCP, but we won’t use MCP in this case since we don’t need to publish our tools for other agents. Instead, we’ll just create a simple function to read data from the Notion database and pages. This data will serve as the Agent’s context.
3. The Interface: Next.js
Finally, we ask copilot 😆 help use build and AI chat UI in NextJS and call Agent service from Server. The result will look like this.
3. Conclusion
I chose this specific combination for three reasons:
- It's "Alive": I don't need to be a developer to update my agent. I just need to be a Notion user. The moment I type in Notion, the agent gets smarter.
- It's Free (mostly): Next.js can be hosted on Vercel for free. Notion has a generous free API. Google Gemini currently offers a free tier for developers. It costs me $0 to run my own digital receptionist.
- Context-Aware: Unlike a standard "Search" bar, the LLM understands nuance. You can ask it, "Is he expensive?" and it can infer the answer based on the rates I stored in Notion, even if the word "expensive" isn't written there.
Now, your recruiter can ask your assistant to check is your skills or your knowledge is match the company need.