<?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>DEV Community: bilal meziani</title>
    <description>The latest articles on DEV Community by bilal meziani (@bilalmez).</description>
    <link>https://dev.to/bilalmez</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3824818%2F9d57e563-6cae-4265-94a6-38ebf58e9817.png</url>
      <title>DEV Community: bilal meziani</title>
      <link>https://dev.to/bilalmez</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bilalmez"/>
    <language>en</language>
    <item>
      <title>Why 90% of AI Automations Break in Production (Lessons From Building a Real AI Workflow)</title>
      <dc:creator>bilal meziani</dc:creator>
      <pubDate>Mon, 20 Jul 2026 13:45:22 +0000</pubDate>
      <link>https://dev.to/bilalmez/why-90-of-ai-automations-break-in-production-lessons-from-building-a-real-ai-workflow-2ap9</link>
      <guid>https://dev.to/bilalmez/why-90-of-ai-automations-break-in-production-lessons-from-building-a-real-ai-workflow-2ap9</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;Building an AI demo today is easy.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Connect OpenAI to n8n or Make, write a prompt, click &lt;strong&gt;Run&lt;/strong&gt;, and everything looks impressive.&lt;/p&gt;

&lt;p&gt;That’s exactly how many of my workflows started while building &lt;a href="https://www.agenticscales.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;AgenticScales&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The hard part wasn’t getting them to work.&lt;/p&gt;

&lt;p&gt;The hard part was asking uncomfortable questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What happens when the API times out?
&lt;/li&gt;
&lt;li&gt;What happens when the AI doesn’t know the answer?
&lt;/li&gt;
&lt;li&gt;What happens when a customer asks for a refund?
&lt;/li&gt;
&lt;li&gt;What happens when someone spams the system with meaningless messages?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The more I worked on these workflows, the more I realized that production AI has very little to do with prompts and everything to do with handling failure.&lt;/p&gt;

&lt;p&gt;Every lesson below came from finding a weakness in a workflow and redesigning it before it became a real problem.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;1. Never Assume APIs Will Always Respond&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;One of my first mistakes was focusing on the happy path.&lt;/p&gt;

&lt;p&gt;The workflow worked perfectly during testing, so I assumed it was ready.&lt;/p&gt;

&lt;p&gt;Then I started asking: what happens if the LLM API times out, hits a rate limit, or returns an error mid-process?&lt;/p&gt;

&lt;p&gt;Without retries and fallback logic, a single failure could break the entire workflow.&lt;/p&gt;

&lt;p&gt;So I started treating API failures as something &lt;strong&gt;expected&lt;/strong&gt;, not exceptional.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What I do now&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Retry failed requests automatically (with a timeout so they never hang).
&lt;/li&gt;
&lt;li&gt;Log failures clearly.
&lt;/li&gt;
&lt;li&gt;When a call still fails after retries, &lt;strong&gt;degrade gracefully&lt;/strong&gt;: route the ticket to a human queue instead of dropping it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A workflow should never silently lose a task.&lt;/p&gt;

&lt;p&gt;In my support flow, this is a built-in fail-safe: if classification fails, the ticket is marked &lt;code&gt;needs_human&lt;/code&gt; and handed to a person instead of disappearing into the system.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;2. AI Shouldn’t Handle Sensitive Requests Alone&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;While designing customer-support workflows, I quickly realized that not every request should get an AI-generated response.&lt;/p&gt;

&lt;p&gt;A refund request, a security issue, or a legal complaint carries far more risk than a simple “How do I reset my password?”&lt;/p&gt;

&lt;p&gt;Even if the model performs well most of the time, one bad response on a sensitive topic can create a serious problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;I eventually realized that not every ticket should reach the AI.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Some requests carry too much risk.&lt;/p&gt;

&lt;p&gt;Refunds.&lt;/p&gt;

&lt;p&gt;Legal complaints.&lt;/p&gt;

&lt;p&gt;Security issues.&lt;/p&gt;

&lt;p&gt;Angry customers.&lt;/p&gt;

&lt;p&gt;When the workflow detects one of these categories, it skips the AI entirely and hands the conversation to a human.&lt;/p&gt;

&lt;p&gt;No generated response.&lt;/p&gt;

&lt;p&gt;No guessing.&lt;/p&gt;

&lt;p&gt;No unnecessary risk.&lt;/p&gt;

&lt;p&gt;The customer simply gets a message that someone from the team will follow up.&lt;/p&gt;

&lt;p&gt;Sometimes the smartest thing an AI can do is stay out of the conversation.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;3. Automation Needs Boundaries&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Early on, I treated automation as an all-or-nothing decision.&lt;/p&gt;

&lt;p&gt;Either automate everything or approve everything manually.&lt;/p&gt;

&lt;p&gt;Testing taught me the real answer is somewhere in between.&lt;/p&gt;

&lt;p&gt;The key is deciding where automation ends and human judgment begins.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What I do now&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I split actions into two lanes:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Low-risk and grounded&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If the answer comes directly from a verified knowledge source and the topic is low-risk, the response can be sent automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Sensitive or unverifiable&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If the request touches anything important, unclear, or potentially risky, a human makes the final decision.&lt;/p&gt;

&lt;p&gt;The question isn’t whether humans should approve everything.&lt;/p&gt;

&lt;p&gt;The question is which actions are safe enough to automate and which actions should always remain under human control.&lt;/p&gt;

&lt;p&gt;Getting that boundary right is what makes automation trustworthy.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;4. Adopt a Zero-Invention Policy&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;One thing I noticed very quickly is that LLMs hate saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“I don’t know.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If information is missing, they’ll often try to fill the gap.&lt;/p&gt;

&lt;p&gt;That’s useful for brainstorming.&lt;/p&gt;

&lt;p&gt;It’s dangerous for business processes.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What I do now&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Every workflow is grounded in a knowledge source, and my prompts include a strict rule:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Never invent policies, account information, refund amounts, or facts that are not explicitly available in the provided data. If the information cannot be verified, say a human will follow up.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The payoff is real.&lt;/p&gt;

&lt;p&gt;When I asked my own support bot about a refund policy that wasn’t documented yet, it didn’t invent an answer.&lt;/p&gt;

&lt;p&gt;It simply said it didn’t have that information and that a team member would follow up.&lt;/p&gt;

&lt;p&gt;That’s exactly the behavior I want in front of a customer.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;5. Protect Your AI Budget From Abuse&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This lesson caught me completely off guard.&lt;/p&gt;

&lt;p&gt;While testing one of my workflows, I noticed something strange.&lt;/p&gt;

&lt;p&gt;Every message triggered the full pipeline.&lt;/p&gt;

&lt;p&gt;Even messages like:&lt;/p&gt;

&lt;p&gt;“Hi”&lt;/p&gt;

&lt;p&gt;or simply:&lt;/p&gt;

&lt;p&gt;“?”&lt;/p&gt;

&lt;p&gt;The workflow would still run classification, query the knowledge base, and make paid AI calls before realizing there wasn’t actually anything worth processing.&lt;/p&gt;

&lt;p&gt;That’s when I saw the problem.&lt;/p&gt;

&lt;p&gt;A bored visitor could send hundreds of meaningless messages and quietly generate a real bill.&lt;/p&gt;

&lt;p&gt;A malicious user could do exactly the same thing.&lt;/p&gt;

&lt;p&gt;Not because the workflow was broken.&lt;/p&gt;

&lt;p&gt;Because I had never taught it the difference between a real request and noise.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What I do now&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I run a cheap rule-based filter before any paid AI call.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real requests go through the full AI workflow.
&lt;/li&gt;
&lt;li&gt;Vague messages trigger a clarification flow.
&lt;/li&gt;
&lt;li&gt;Repeated low-value messages get handled with predefined responses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The expensive AI calls only happen when they actually add value.&lt;/p&gt;

&lt;p&gt;One lesson I learned is that workflow nodes shouldn’t only be ordered by logic.&lt;/p&gt;

&lt;p&gt;They should also be ordered by cost.&lt;/p&gt;

&lt;p&gt;The cheapest filter should usually come first.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  Order your nodes by cost, not just by logic.  
&lt;/h2&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Final Thoughts&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Before building &lt;a href="https://www.agenticscales.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;AgenticScales&lt;/strong&gt;&lt;/a&gt;, I thought the difficult part of AI automation was making the model produce good answers.&lt;/p&gt;

&lt;p&gt;Now I think that’s the easy part.&lt;/p&gt;

&lt;p&gt;The difficult part is building systems that remain reliable when APIs fail, users behave unexpectedly, costs increase, or AI reaches the limits of what it knows.&lt;/p&gt;

&lt;p&gt;Production-ready AI isn’t about maximizing automation.&lt;/p&gt;

&lt;p&gt;It’s about designing clear boundaries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When AI can act.
&lt;/li&gt;
&lt;li&gt;When AI should ask for help.
&lt;/li&gt;
&lt;li&gt;When a human must take over.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The workflows I trust the most today aren’t the ones that automate everything.&lt;/p&gt;

&lt;p&gt;They’re the ones that know exactly when not to.&lt;/p&gt;

&lt;p&gt;That’s the difference between a demo that looks impressive and a system a business can depend on.&lt;/p&gt;

&lt;p&gt;Have you learned any production lessons the hard way while building AI workflows? I’d love to hear your stories in the comments.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>automation</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>What if 30,000 Ex-Oracle Employees Teamed Up?</title>
      <dc:creator>bilal meziani</dc:creator>
      <pubDate>Fri, 03 Apr 2026 17:30:45 +0000</pubDate>
      <link>https://dev.to/bilalmez/what-if-30000-ex-oracle-employees-teamed-up-4h2c</link>
      <guid>https://dev.to/bilalmez/what-if-30000-ex-oracle-employees-teamed-up-4h2c</guid>
      <description>&lt;p&gt;Recently, news broke that 30,000 Oracle employees were laid off because of AI. That’s a huge number and it got me thinking. What if these tech veterans came together in an open-source community?&lt;/p&gt;

&lt;p&gt;Imagine this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;30,000 skilled minds in databases, cloud systems, and complex architectures.&lt;/li&gt;
&lt;li&gt;Decades of combined experience solving some of the toughest engineering problems.&lt;/li&gt;
&lt;li&gt;No corporate bureaucracy, no endless meetings, just pure creative innovation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The idea is that they could build something bigger, faster, and more innovative than any traditional company, and maybe even rival Oracle itself.&lt;/p&gt;

&lt;p&gt;This scenario shows that collective talent and collaboration can sometimes outperform even the largest corporations. Being laid off might feel like the end, but it could also mark the beginning of something entirely new.&lt;/p&gt;

&lt;p&gt;What do you think? Could this really happen?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>oracle</category>
      <category>community</category>
      <category>opensource</category>
    </item>
    <item>
      <title>I Built an AI Agent That Forces You to Finish What You Start — Using Notion MCP</title>
      <dc:creator>bilal meziani</dc:creator>
      <pubDate>Sun, 22 Mar 2026 01:49:35 +0000</pubDate>
      <link>https://dev.to/bilalmez/i-built-an-ai-agent-that-forces-you-to-finish-what-you-start-using-notion-mcp-dl2</link>
      <guid>https://dev.to/bilalmez/i-built-an-ai-agent-that-forces-you-to-finish-what-you-start-using-notion-mcp-dl2</guid>
      <description>&lt;p&gt;OneTask uses Notion's Model Context Protocol to turn one weekly goal into a structured weekly execution plan, with an AI agent that protects your focus all week.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/notion-2026-03-04"&gt;Notion MCP Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🔴 &lt;strong&gt;The Problem&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Most productivity tools overload you with hundreds of tasks, creating distraction and stress.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;💡 &lt;strong&gt;The Idea&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;What if an AI forced us to focus on only &lt;strong&gt;one task at a time&lt;/strong&gt;, and guided your week around it?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;✅ &lt;strong&gt;The Solution&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;OneTask&lt;/strong&gt; is an AI-powered focus agent that reads your Notion workspace, plans your week in structured daily steps, and enforces focus using intelligent prompts.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&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%2Fpwq4ojyjo8wxtafopvpq.gif" 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%2Fpwq4ojyjo8wxtafopvpq.gif" alt="OneTask Demo - AI Focus Agent in Action"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Every Monday I open Notion and see 15 tasks. By Friday, I've touched 8 and finished 0.&lt;/p&gt;

&lt;p&gt;The problem isn't motivation. It's &lt;strong&gt;too many open loops at once.&lt;/strong&gt; I start something, get pulled toward something else, and never build real momentum on anything.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;OneTask&lt;/strong&gt;, a Notion MCP-powered AI agent that enforces radical weekly focus.&lt;/p&gt;

&lt;p&gt;You pick &lt;strong&gt;one task&lt;/strong&gt;. The agent reads your Notion workspace, plans your entire week inside Notion day by day, and then &lt;strong&gt;guards your focus&lt;/strong&gt;. Want to switch mid-week? The agent reviews your reason and rejects weak excuses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BEFORE OneTask:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;□ Learn Python&lt;/li&gt;
&lt;li&gt;□ Build landing page&lt;/li&gt;
&lt;li&gt;□ Write business plan&lt;/li&gt;
&lt;li&gt;□ Fix the API bug&lt;/li&gt;
&lt;li&gt;□ Update portfolio&lt;/li&gt;
&lt;li&gt;□ Reply to emails&lt;/li&gt;
&lt;li&gt;□ ...7 more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;AFTER OneTask:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Learn Python&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Wednesday: Read chapters 1-3&lt;/li&gt;
&lt;li&gt;Thursday: Build first script&lt;/li&gt;
&lt;li&gt;Friday: Practice with exercises&lt;/li&gt;
&lt;li&gt;Saturday: Mini project&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You choose one focus. OneTask plans the week, writes it to Notion, and guards your focus.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;p&gt;📋 &lt;strong&gt;AI week planning&lt;/strong&gt;: Gemini 2.5 Flash breaks your task into specific daily steps&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Real Notion checkboxes&lt;/strong&gt;: Creates &lt;code&gt;to_do&lt;/code&gt; blocks written directly into your task page&lt;/p&gt;

&lt;p&gt;🔒 &lt;strong&gt;Focus Guardian&lt;/strong&gt;: The AI agent rejects weak reasons for switching mid-week&lt;/p&gt;

&lt;p&gt;🔄 &lt;strong&gt;Real-time Notion writes&lt;/strong&gt;: Every action in the app updates Notion immediately&lt;/p&gt;

&lt;p&gt;✏️ &lt;strong&gt;Adapt your plan&lt;/strong&gt;: Rewrite the plan for your actual level mid-week&lt;/p&gt;

&lt;p&gt;🌙 &lt;strong&gt;Dark mode&lt;/strong&gt;: Auto-detects system preference&lt;/p&gt;




&lt;h2&gt;
  
  
  Live Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/NnrM6ALD79Y"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 &lt;strong&gt;Try it yourself:&lt;/strong&gt; Duplicate the &lt;a href="https://spectacled-myrtle-6ae.notion.site/One-Task-e8178c86dfb78328b9e481d28ef119bf" rel="noopener noreferrer"&gt;OneTask Notion Template&lt;/a&gt; and see the AI in action.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Show Us the Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/bilalmez/onetask" rel="noopener noreferrer"&gt;github.com/bilalmez/onetask&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notion Template:&lt;/strong&gt; &lt;a href="https://spectacled-myrtle-6ae.notion.site/One-Task-e8178c86dfb78328b9e481d28ef119bf" rel="noopener noreferrer"&gt;Duplicate the OneTask workspace&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stack:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backend: Python + FastAPI&lt;/li&gt;
&lt;li&gt;Frontend: Vanilla HTML/CSS/JS (single file, zero build step)&lt;/li&gt;
&lt;li&gt;AI: Gemini 2.5 Flash (native JSON output mode)&lt;/li&gt;
&lt;li&gt;Integration: Notion REST API + Notion MCP tooling layer&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Focus Guardian
&lt;/h2&gt;

&lt;p&gt;This is the feature that makes OneTask different. When you try to change your focus on Day 3:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; "I want to work on something else"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent:&lt;/strong&gt; "You're on Day 3 of 7. You've done 1 out of 5 steps. What's the real reason?"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; "I feel like working on a different project"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent:&lt;/strong&gt; "That sounds more like avoidance than necessity. I recommend staying with your current focus."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; "My client moved a deadline to tomorrow morning"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent:&lt;/strong&gt; "External deadline conflict detected. You're clear to switch."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Commitment enforced intelligently, not just suggested.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The agent uses Gemini to review the reason and decide: legitimate external conflict or procrastination? This transforms productivity from suggestion to enforcement.&lt;/p&gt;




&lt;h2&gt;
  
  
  How I Used Notion MCP
&lt;/h2&gt;

&lt;p&gt;OneTask uses a &lt;strong&gt;Notion MCP integration layer&lt;/strong&gt; alongside the Notion REST API. The MCP layer gives the AI agent tool-based access to the workspace. Instead of raw HTTP calls, the agent interacts with Notion through structured tools it understands natively.&lt;/p&gt;

&lt;p&gt;Here's the hybrid engine at the center of the architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;mcp_hybrid_execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tool_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tool_args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rest_method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rest_path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# 1. Try MCP tool first (native tool-based access)
&lt;/span&gt;    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;mcp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tool_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tool_args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;isError&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;  &lt;span class="c1"&gt;# MCP success
&lt;/span&gt;
    &lt;span class="c1"&gt;# 2. Transparent REST API fallback
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;notion&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rest_method&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rest_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;MCP tools used in OneTask:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API-retrieve-a-database&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read the workspace schema&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API-get-block-children&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read existing page content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API-patch-block-children&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Write daily to-do blocks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API-delete-a-block&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Clean up old plans before rewriting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;API-patch-page&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Update Status, Priority, and Notes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;What MCP unlocks:&lt;/strong&gt; The agent doesn't just call an API. It &lt;em&gt;uses&lt;/em&gt; Notion as a set of tools it understands. This changes the mental model from "send HTTP requests" to "use workspace tools." The result is better agent behavior and cleaner integration logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why hybrid?&lt;/strong&gt; The MCP layer handles structured workspace actions reliably. The REST API handles database property updates where the MCP layer can hit validation edge cases. The hybrid strategy means the agent always works. MCP when possible, REST as fallback, unified result either way.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Happens in Notion When You Set a Focus
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Finds or creates your task in the database&lt;/li&gt;
&lt;li&gt;Sets &lt;strong&gt;Status → In progress&lt;/strong&gt; and &lt;strong&gt;Priority → Week Focus&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Writes a personalized AI motivation note to the &lt;strong&gt;Notes&lt;/strong&gt; field&lt;/li&gt;
&lt;li&gt;Removes Week Focus from all other tasks (one focus enforced)&lt;/li&gt;
&lt;li&gt;Writes &lt;code&gt;to_do&lt;/code&gt; blocks inside the task page (real Notion checkboxes)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When all steps are completed, &lt;strong&gt;Status → Done&lt;/strong&gt; and &lt;strong&gt;Priority → Medium&lt;/strong&gt; update automatically. No manual cleanup needed.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try OneTask Yourself
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Duplicate the &lt;a href="https://spectacled-myrtle-6ae.notion.site/One-Task-e8178c86dfb78328b9e481d28ef119bf" rel="noopener noreferrer"&gt;Notion Template&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Clone the repo:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/bilalmez/onetask.git
&lt;span class="nb"&gt;cd &lt;/span&gt;onetask
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.example .env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Add your Notion token &amp;amp; database ID in &lt;code&gt;.env&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Run:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;start.bat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Open &lt;code&gt;http://localhost:3001&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Focus on one goal, let the AI guide you, and actually finish what you start.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built for the Notion MCP Challenge, March 2026&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>notionchallenge</category>
      <category>mcp</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
