<?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: Aarti Jangid</title>
    <description>The latest articles on DEV Community by Aarti Jangid (@aartijangid23).</description>
    <link>https://dev.to/aartijangid23</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%2F3479328%2F4664bf5c-4ca3-4937-9749-f1a151fdbb02.png</url>
      <title>DEV Community: Aarti Jangid</title>
      <link>https://dev.to/aartijangid23</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aartijangid23"/>
    <language>en</language>
    <item>
      <title>How AI Integration Is Turning Traditional Education Software Into Intelligent Learning Platforms</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Fri, 27 Nov 2026 05:20:11 +0000</pubDate>
      <link>https://dev.to/aartijangid23/how-ai-integration-is-turning-traditional-education-software-into-intelligent-learning-platforms-1iij</link>
      <guid>https://dev.to/aartijangid23/how-ai-integration-is-turning-traditional-education-software-into-intelligent-learning-platforms-1iij</guid>
      <description>&lt;p&gt;Introduction&lt;br&gt;
Artificial intelligence is changing how educational institutions deliver knowledge, manage academic operations, and understand student performance. However, the next significant opportunity lies beyond developing standalone AI applications. It involves integrating intelligence into existing educational software.&lt;/p&gt;

&lt;p&gt;From learning management systems and virtual classrooms to examination portals and student management platforms, educational institutions already depend on digital infrastructure. Yet, many of these systems operate through predefined rules, manual workflows, and static educational content.&lt;/p&gt;

&lt;p&gt;AI integration in education introduces an opportunity to make these systems more adaptive, responsive, and context-aware.&lt;/p&gt;

&lt;p&gt;By combining existing software infrastructure with machine learning, natural language processing, generative AI, and intelligent automation, educational institutions can create platforms that support more personalized learning experiences and efficient academic operations.&lt;br&gt;
What Is AI Integration in Education, and Why Does It Matter?&lt;br&gt;
AI integration in education refers to embedding artificial intelligence capabilities into existing educational applications, platforms, and digital infrastructure.&lt;/p&gt;

&lt;p&gt;Rather than replacing an entire learning management system, developers can introduce AI-powered modules that extend its functionality.&lt;/p&gt;

&lt;p&gt;For example, a traditional educational platform may record examination results and display student grades. An AI-integrated platform could analyze those results, identify knowledge gaps, and recommend additional learning resources.&lt;/p&gt;

&lt;p&gt;The same approach can support personalized content delivery, automated assessments, academic assistance, student engagement, and administrative decision-making.&lt;/p&gt;

&lt;p&gt;Through education AI development services, educational organizations can explore intelligent capabilities that align with their existing infrastructure and academic requirements.&lt;br&gt;
Five Ways AI Integration Can Transform Educational Software&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Adaptive Learning and Personalized Content Delivery
Traditional educational software often provides the same learning materials to every student, regardless of their individual abilities or academic progress.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AI-powered learning platforms can analyze student interactions, assessment results, learning patterns, and frequently repeated mistakes.&lt;/p&gt;

&lt;p&gt;Based on these insights, the platform can recommend appropriate educational content, adjust exercise difficulty, and suggest personalized learning paths.&lt;/p&gt;

&lt;p&gt;For example, a mathematics learning application could identify students struggling with algebra and provide additional exercises before introducing more advanced concepts.&lt;/p&gt;

&lt;p&gt;This approach can help educators support individual learning requirements without manually creating separate lesson plans for every student.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AI-Powered Assessment and Performance Analysis
Educational assessments generate valuable information, but traditional examination systems may provide limited insights beyond grades and completion percentages.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AI integration can help identify patterns in student responses, recognize common misconceptions, and provide more detailed performance analysis.&lt;/p&gt;

&lt;p&gt;Through custom online exam portal development, institutions can combine digital assessment infrastructure with intelligent analytics, question recommendations, and automated feedback.&lt;/p&gt;

&lt;p&gt;Teachers can use these insights to identify topics that require further explanation and provide targeted academic support.&lt;/p&gt;

&lt;p&gt;AI-generated assessments and grading recommendations should still be reviewed by educators, particularly when decisions affect academic progression.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Intelligent Tutoring and Academic Assistance
Students frequently require academic support outside scheduled classroom hours.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AI-powered tutoring systems can provide contextual explanations, answer subject-related questions, recommend educational resources, and guide students through difficult concepts.&lt;/p&gt;

&lt;p&gt;Developers can use large language models and Retrieval-Augmented Generation (RAG) to connect AI assistants with institution-approved learning materials.&lt;/p&gt;

&lt;p&gt;Instead of depending entirely on a model's general knowledge, a RAG-based educational chatbot can retrieve relevant information from textbooks, course documents, and academic knowledge bases.&lt;/p&gt;

&lt;p&gt;Understanding how to build an AI tutor chatbot becomes particularly important when educational platforms require reliable, context-specific academic assistance.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Intelligent Automation of Academic Workflows
Educational institutions manage numerous repetitive administrative processes, including attendance tracking, student inquiries, scheduling, admissions, and academic reporting.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AI-enabled software can help automate selected workflows and provide contextual assistance to administrative teams.&lt;/p&gt;

&lt;p&gt;For example, an intelligent academic assistant could categorize incoming student inquiries, retrieve relevant institutional policies, and route complex requests to appropriate staff members.&lt;/p&gt;

&lt;p&gt;When integrated with school management systems and existing databases, these capabilities can reduce manual workload and improve operational coordination.&lt;/p&gt;

&lt;p&gt;Administrative decisions involving sensitive student information, disciplinary actions, or academic eligibility should retain appropriate human oversight.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Predictive Analytics for Student Engagement
Traditional educational platforms typically provide historical reports about attendance, assessment performance, and course completion.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Machine learning models can analyze these patterns to identify students who may benefit from additional academic support.&lt;/p&gt;

&lt;p&gt;For example, declining assessment scores, incomplete assignments, and reduced participation may indicate that a student is experiencing difficulties.&lt;/p&gt;

&lt;p&gt;Predictive analytics can help educators investigate these patterns and provide timely assistance.&lt;/p&gt;

&lt;p&gt;However, predictions should be treated as indicators rather than definitive judgments about a student's abilities or future performance.&lt;br&gt;
The Architecture Behind Intelligent Education Platforms&lt;br&gt;
Successful AI integration requires more than connecting an educational application to a large language model API.&lt;/p&gt;

&lt;p&gt;Developers need to consider how data moves between existing software, AI services, knowledge repositories, and user-facing applications.&lt;/p&gt;

&lt;p&gt;A simplified AI integration architecture may look like this:&lt;/p&gt;

&lt;p&gt;Conceptual architecture for integrating AI into existing educational software. Actual data flows vary by use case.&lt;br&gt;
The integration layer connects existing educational applications with AI services, while the knowledge layer provides relevant academic information.&lt;/p&gt;

&lt;p&gt;For instance, an AI tutoring workflow might follow this simplified process:&lt;br&gt;
def generate_tutor_response(student_id, question):    verify_student_access(student_id)    learning_context = retrieve_course_content(        student_id,        question    )    response = generate_ai_response(        question=question,        context=learning_context    )    return validate_educational_response(response)&lt;/p&gt;

&lt;p&gt;This illustrative workflow demonstrates the importance of access control, contextual retrieval, AI processing, and response validation.&lt;/p&gt;

&lt;p&gt;Production systems would also require error handling, monitoring, privacy controls, and protection against prompt injection.&lt;br&gt;
Why Educational AI Platforms Need More Than Advanced Models&lt;br&gt;
Building an intelligent education platform involves challenges that extend beyond selecting an AI model.&lt;/p&gt;

&lt;p&gt;A technically impressive application may still fail to deliver educational value if it does not address genuine student or teacher requirements.&lt;/p&gt;

&lt;p&gt;Successful implementation requires reliable data infrastructure, curriculum alignment, accessible user interfaces, integration capabilities, and ongoing evaluation.&lt;/p&gt;

&lt;p&gt;Businesses investing in custom education app development should identify specific academic challenges before introducing advanced AI functionality.&lt;/p&gt;

&lt;p&gt;Instead of integrating artificial intelligence into every feature, development teams can begin with focused use cases such as academic assistance, personalized assessments, or intelligent content recommendations.&lt;/p&gt;

&lt;p&gt;This approach makes it easier to evaluate performance and gradually expand AI capabilities.&lt;br&gt;
Challenges Educational Institutions Must Address&lt;br&gt;
Despite its potential, AI integration introduces several practical and technical challenges.&lt;/p&gt;

&lt;p&gt;Data quality and reliability: AI systems require accurate, relevant, and appropriately structured educational information.&lt;/p&gt;

&lt;p&gt;Legacy software integration: Existing educational applications may use outdated architectures, incompatible APIs, or disconnected databases.&lt;/p&gt;

&lt;p&gt;Student privacy and security: Educational platforms must protect sensitive student information through appropriate access controls, encryption, and data governance.&lt;/p&gt;

&lt;p&gt;AI hallucinations: Large language models can generate inaccurate explanations. Educational applications require contextual grounding, response validation, and human supervision.&lt;/p&gt;

&lt;p&gt;Infrastructure and scalability: AI-powered applications must maintain reliable performance during examinations, virtual classes, and periods of high student activity.&lt;/p&gt;

&lt;p&gt;Implementation expenses: Institutions must consider model usage fees, infrastructure requirements, integration complexity, and ongoing maintenance when estimating their education AI automation development cost.&lt;/p&gt;

&lt;p&gt;Addressing these challenges during the development process can help organizations move from experimental AI features toward reliable educational systems.&lt;br&gt;
The Future of Intelligent Education Software&lt;br&gt;
The next phase of educational technology will likely focus on connecting learning applications, academic data, and intelligent software capabilities.&lt;/p&gt;

&lt;p&gt;AI assistants could become more context-aware, adaptive learning systems could provide increasingly personalized recommendations, and educational analytics could help teachers better understand individual student requirements.&lt;/p&gt;

&lt;p&gt;Emerging applications of generative AI in education app development also offer opportunities for interactive educational content, automated learning materials, and conversational academic assistance.&lt;/p&gt;

&lt;p&gt;However, long-term success will depend on solving genuine educational challenges rather than adopting artificial intelligence simply because it is available.&lt;/p&gt;

&lt;p&gt;Developers who combine strong software engineering, educational knowledge, responsible AI implementation, and scalable infrastructure will be better positioned to build useful learning platforms.&lt;br&gt;
Conclusion&lt;br&gt;
AI integration represents an important evolution in educational software development. By connecting traditional applications with intelligent automation, adaptive learning, contextual AI assistants, and predictive analytics, institutions can create more responsive educational environments.&lt;/p&gt;

&lt;p&gt;For educational organizations, the priority should be identifying meaningful use cases, protecting student information, and measuring actual learning outcomes.&lt;/p&gt;

&lt;p&gt;For developers, the opportunity lies in building reliable systems that extend existing educational infrastructure without introducing unnecessary complexity.&lt;/p&gt;

&lt;p&gt;The future of education software is not simply about adding artificial intelligence to existing applications. It is about creating intelligent platforms that help educators teach more effectively and students learn more successfully.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>integration</category>
      <category>educationsoftware</category>
      <category>intelligentlearning</category>
    </item>
    <item>
      <title>I Built an Education App: Here’s What I Learned About Scalability</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Thu, 26 Nov 2026 07:30:23 +0000</pubDate>
      <link>https://dev.to/aartijangid23/i-built-an-education-app-heres-what-i-learned-about-scalability-230</link>
      <guid>https://dev.to/aartijangid23/i-built-an-education-app-heres-what-i-learned-about-scalability-230</guid>
      <description>&lt;p&gt;Building an education app sounds relatively straightforward when you look at its core features: user authentication, video lessons, quizzes, assignments, and progress tracking.&lt;/p&gt;

&lt;p&gt;But things become significantly more complicated when hundreds of students need to access the same resources simultaneously.&lt;/p&gt;

&lt;p&gt;Imagine a learning platform where 1,000 students log in at 9 AM, open the same course, watch recorded lectures, and submit quizzes within a short period.&lt;/p&gt;

&lt;p&gt;The challenge is no longer just building features. It is designing a system that remains reliable under unpredictable traffic.&lt;/p&gt;

&lt;p&gt;In this article, I'll walk through the architectural decisions I would make when building a scalable education application, using an illustrative learning platform as an example.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Initial Architecture Was Simple&lt;/strong&gt;&lt;br&gt;
A typical education application might start with the following technology stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React for the frontend&lt;/li&gt;
&lt;li&gt;Node.js and Express for backend APIs&lt;/li&gt;
&lt;li&gt;PostgreSQL for database management&lt;/li&gt;
&lt;li&gt;Redis for caching&lt;/li&gt;
&lt;li&gt;Object storage for educational content&lt;/li&gt;
&lt;li&gt;WebSockets for real-time communication
The initial architecture could look like this:
Student Application
    |
REST API
    |
Node.js Server
    |
PostgreSQL
    |
File Storage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This architecture may work perfectly well during initial development.&lt;/p&gt;

&lt;p&gt;However, when multiple users begin accessing courses, submitting assessments, and requesting learning materials simultaneously, potential bottlenecks become more apparent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Education Apps Have an Unusual Traffic Pattern&lt;/strong&gt;&lt;br&gt;
Unlike many applications, educational platforms often experience scheduled traffic spikes.&lt;/p&gt;

&lt;p&gt;Students do not necessarily access the application at consistent intervals throughout the day.&lt;/p&gt;

&lt;p&gt;Traffic increases significantly during:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live classroom sessions&lt;/li&gt;
&lt;li&gt;Online examinations&lt;/li&gt;
&lt;li&gt;Assignment deadlines&lt;/li&gt;
&lt;li&gt;Course enrollment periods&lt;/li&gt;
&lt;li&gt;Examination result announcements
For example, if an examination begins at 10 AM, hundreds of students may request the same assessment within seconds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Designing only for average daily traffic can leave an application unprepared for these concentrated bursts.&lt;/p&gt;

&lt;p&gt;This is one of the most important architectural considerations in education app development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Database Queries Can Become a Bottleneck&lt;/strong&gt;&lt;br&gt;
Consider an endpoint responsible for retrieving course information.&lt;br&gt;
app.get('/courses', async (req, res) =&amp;gt; {&lt;br&gt;
  const result = await db.query(&lt;br&gt;
    'SELECT * FROM courses'&lt;br&gt;
  );&lt;/p&gt;

&lt;p&gt;res.json(result.rows);&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;Every request communicates directly with PostgreSQL.&lt;/p&gt;

&lt;p&gt;If 500 students repeatedly open the course catalog, the database may perform hundreds of similar operations unnecessarily.&lt;/p&gt;

&lt;p&gt;Instead of immediately increasing database capacity, consider caching frequently accessed information.&lt;br&gt;
app.get('/courses', async (req, res) =&amp;gt; {&lt;br&gt;
  const cached = await redis.get('public_courses');&lt;/p&gt;

&lt;p&gt;if (cached) {&lt;br&gt;
    return res.json(JSON.parse(cached));&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;const result = await db.query(&lt;br&gt;
    &lt;code&gt;SELECT id, title, description&lt;br&gt;
     FROM courses&lt;br&gt;
     WHERE published = true&lt;/code&gt;&lt;br&gt;
  );&lt;/p&gt;

&lt;p&gt;await redis.set(&lt;br&gt;
    'public_courses',&lt;br&gt;
    JSON.stringify(result.rows),&lt;br&gt;
    { EX: 300 }&lt;br&gt;
  );&lt;/p&gt;

&lt;p&gt;res.json(result.rows);&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;This approach allows repeated requests for the public course catalog to be served from Redis.&lt;/p&gt;

&lt;p&gt;However, personalized student information should not be stored under shared cache keys.&lt;/p&gt;

&lt;p&gt;Examination results, private course access, and individual progress require appropriate authorization and cache isolation.&lt;/p&gt;

&lt;p&gt;Caching improves performance only when its expiration and invalidation strategies are designed correctly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Optimizing Database Indexes&lt;/strong&gt;&lt;br&gt;
Adding more servers does not automatically resolve inefficient database queries.&lt;/p&gt;

&lt;p&gt;Consider a query used to retrieve a student's learning progress:&lt;br&gt;
SELECT *&lt;br&gt;
FROM student_progress&lt;br&gt;
WHERE student_id = 101&lt;br&gt;
AND course_id = 25;&lt;/p&gt;

&lt;p&gt;As the number of records increases, this query may become expensive without an appropriate index.&lt;/p&gt;

&lt;p&gt;A composite index could help:&lt;br&gt;
CREATE INDEX idx_student_course&lt;br&gt;
ON student_progress(student_id, course_id);&lt;/p&gt;

&lt;p&gt;Developers can examine the execution plan using:&lt;br&gt;
EXPLAIN ANALYZE&lt;br&gt;
SELECT *&lt;br&gt;
FROM student_progress&lt;br&gt;
WHERE student_id = 101&lt;br&gt;
AND course_id = 25;&lt;/p&gt;

&lt;p&gt;This helps determine whether PostgreSQL uses the index and where execution time is spent.&lt;/p&gt;

&lt;p&gt;The goal is to identify expensive operations before adding unnecessary infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Video Streaming Should Not Depend on the Application Server&lt;/strong&gt;&lt;br&gt;
Educational platforms frequently deliver large video files.&lt;/p&gt;

&lt;p&gt;Serving those files directly through a Node.js application introduces additional bandwidth and infrastructure pressure.&lt;/p&gt;

&lt;p&gt;A more suitable architecture separates video delivery from application logic.&lt;br&gt;
Student App&lt;br&gt;
    |&lt;br&gt;
    |---- API Gateway ---- Backend ---- Database&lt;br&gt;
    |&lt;br&gt;
    |---- CDN ---- Object Storage&lt;/p&gt;

&lt;p&gt;A content delivery network can distribute educational resources closer to students.&lt;/p&gt;

&lt;p&gt;The backend remains responsible for authentication, authorization, course management, and access permissions.&lt;/p&gt;

&lt;p&gt;For private educational content, signed URLs and appropriate access controls can prevent unauthorized access.&lt;/p&gt;

&lt;p&gt;Adaptive bitrate streaming can also improve the learning experience for students using slower internet connections.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Handling Thousands of Quiz Submissions&lt;/strong&gt;&lt;br&gt;
Quiz submissions introduce another interesting scalability challenge.&lt;/p&gt;

&lt;p&gt;Imagine hundreds of students completing an examination simultaneously.&lt;/p&gt;

&lt;p&gt;The application may need to save answers, calculate scores, update progress, generate reports, and send notifications.&lt;/p&gt;

&lt;p&gt;Performing all these operations synchronously can increase response times.&lt;/p&gt;

&lt;p&gt;A better approach is to separate essential data storage from background processing.&lt;br&gt;
Student Submits Quiz&lt;br&gt;
        |&lt;br&gt;
   Validate Request&lt;br&gt;
        |&lt;br&gt;
  Save Answers + Outbox Event&lt;br&gt;
        |&lt;br&gt;
   Confirm Submission&lt;br&gt;
        |&lt;br&gt;
    Message Queue&lt;br&gt;
        |&lt;br&gt;
   Background Worker&lt;br&gt;
        |&lt;br&gt;
 Calculate Score / Notify Student&lt;/p&gt;

&lt;p&gt;The application should acknowledge the submission only after the answers have been durably stored.&lt;/p&gt;

&lt;p&gt;Background workers can then handle scoring, notifications, analytics, and other non-immediate operations.&lt;/p&gt;

&lt;p&gt;Tools such as BullMQ or RabbitMQ can support this architecture.&lt;/p&gt;

&lt;p&gt;Idempotency is equally important. If a student's connection drops and the submission is retried, the system should avoid creating duplicate examination attempts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Load Testing Before an Examination&lt;/strong&gt;&lt;br&gt;
An application working correctly on a developer's laptop does not prove that it can handle hundreds of students.&lt;/p&gt;

&lt;p&gt;Load testing helps identify potential bottlenecks before deployment.&lt;/p&gt;

&lt;p&gt;Here is a basic example using k6:&lt;br&gt;
import http from 'k6/http';&lt;br&gt;
import { check, sleep } from 'k6';&lt;/p&gt;

&lt;p&gt;export const options = {&lt;br&gt;
  stages: [&lt;br&gt;
    { duration: '30s', target: 100 },&lt;br&gt;
    { duration: '1m', target: 500 },&lt;br&gt;
    { duration: '30s', target: 0 }&lt;br&gt;
  ],&lt;br&gt;
  thresholds: {&lt;br&gt;
    http_req_failed: ['rate&amp;lt;0.01'],&lt;br&gt;
    http_req_duration: ['p(95)&amp;lt;500']&lt;br&gt;
  }&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;export default function () {&lt;br&gt;
  const response = http.get(&lt;br&gt;
    &lt;code&gt;${__ENV.BASE_URL}/courses&lt;/code&gt;&lt;br&gt;
  );&lt;/p&gt;

&lt;p&gt;check(response, {&lt;br&gt;
    'status is 200': (r) =&amp;gt; r.status === 200&lt;br&gt;
  });&lt;/p&gt;

&lt;p&gt;sleep(1);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Run the test against your own authorized staging environment:&lt;br&gt;
k6 run -e BASE_URL=&lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt; test.js&lt;/p&gt;

&lt;p&gt;This example defines performance targets rather than actual measured results.&lt;/p&gt;

&lt;p&gt;During testing, developers should monitor API latency, database connections, memory consumption, error rates, and cache hit ratios.&lt;/p&gt;

&lt;p&gt;A complete education platform test should also simulate authenticated requests, examination submissions, and concurrent student activity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Supporting Students with Unstable Internet Connections&lt;/strong&gt;&lt;br&gt;
Scalability is not limited to handling large amounts of server traffic.&lt;/p&gt;

&lt;p&gt;An education application must also remain usable when students experience poor internet connectivity.&lt;/p&gt;

&lt;p&gt;Consider a student completing an assignment when their connection suddenly drops.&lt;/p&gt;

&lt;p&gt;Without a recovery mechanism, their progress could disappear.&lt;/p&gt;

&lt;p&gt;An offline-first approach can temporarily store learning progress locally and synchronize it when connectivity returns.&lt;/p&gt;

&lt;p&gt;Technologies such as SQLite and IndexedDB can support this functionality.&lt;/p&gt;

&lt;p&gt;Developers should also implement retry mechanisms, synchronization rules, duplicate prevention, and conflict resolution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Where AI Fits into a Scalable Education App&lt;/strong&gt;&lt;br&gt;
Modern education app development increasingly includes intelligent features such as personalized learning recommendations, AI tutors, automated feedback, and question generation.&lt;/p&gt;

&lt;p&gt;However, AI introduces additional latency and infrastructure costs.&lt;/p&gt;

&lt;p&gt;Instead of placing an AI request inside every student interaction, developers can separate AI processing into dedicated services.&lt;/p&gt;

&lt;p&gt;Frequently generated, non-personalized educational content may be cached where appropriate.&lt;/p&gt;

&lt;p&gt;Long-running AI tasks can be processed asynchronously.&lt;/p&gt;

&lt;p&gt;Student privacy should remain a priority, particularly when educational applications process personal information or assessment records.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Architecture I Would Choose Today
After considering these challenges, the proposed architecture would look like this:
Web / Mobile Application
       |
  Load Balancer
       |
Backend API Instances
  /    |     |    \
Redis   DB   Queue  Object Storage
            |          |
          Workers     CDN
            |
       AI Services&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each component solves a specific problem.&lt;/p&gt;

&lt;p&gt;Redis reduces repetitive database requests. PostgreSQL maintains persistent records. Background workers handle asynchronous operations. Object storage and CDN services distribute educational content efficiently.&lt;/p&gt;

&lt;p&gt;However, not every education app needs this entire architecture from the beginning.&lt;/p&gt;

&lt;p&gt;The right approach is to start with a manageable system, measure its performance, and introduce additional components when actual usage demands them.&lt;/p&gt;

&lt;p&gt;For teams evaluating the broader business and implementation requirements, this overview of education app development provides additional context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
Building a scalable education application is not about selecting the most sophisticated technology stack.&lt;/p&gt;

&lt;p&gt;It is about understanding how students interact with the platform and designing around their actual needs.&lt;/p&gt;

&lt;p&gt;Database optimization, caching, asynchronous processing, efficient content delivery, and realistic load testing can make a significant difference.&lt;/p&gt;

&lt;p&gt;The most important lesson is that scalability should be considered early, but architectural complexity should be introduced only when it solves a measurable problem.&lt;/p&gt;

&lt;p&gt;If you were designing an education platform for 10,000 concurrent students, which component would you optimize first: the database, API layer, or content delivery system?&lt;/p&gt;

&lt;p&gt;I'd be interested to hear how other developers approach this challenge.&lt;/p&gt;

</description>
      <category>educationapp</category>
      <category>beginners</category>
      <category>discuss</category>
    </item>
    <item>
      <title>I Tried Building a Tutor Marketplace. Here's What Made the Backend Complicated</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Wed, 25 Nov 2026 10:17:56 +0000</pubDate>
      <link>https://dev.to/aartijangid23/i-tried-building-a-tutor-marketplace-heres-what-made-the-backend-complicated-2ie3</link>
      <guid>https://dev.to/aartijangid23/i-tried-building-a-tutor-marketplace-heres-what-made-the-backend-complicated-2ie3</guid>
      <description>&lt;p&gt;On paper a tutor marketplace is a solved problem. You have supply, you have demand, you have a calendar, you have Stripe. Two weeks of work.&lt;/p&gt;

&lt;p&gt;The actual complexity turned out to sit in three places I underestimated badly: availability modelling, booking concurrency, and the fact that money and trust are entangled in a way that a normal e-commerce checkout never has to deal with.&lt;/p&gt;

&lt;p&gt;Here is what bit me, with the parts that eventually worked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Availability is not a calendar&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My first model was the obvious one. A tutor_availability table with start_time and end_time rows. Tutor says they are free Tuesdays 4pm to 8pm, you insert a row.&lt;/p&gt;

&lt;p&gt;This falls apart immediately for three reasons.&lt;/p&gt;

&lt;p&gt;Recurrence. "Tuesdays 4 to 8" is a rule, not a row. If you materialise it into concrete slots, how far forward do you generate? Six months of slots for ten thousand tutors is a lot of rows that mostly never get booked. If you do not materialise it, every search query has to expand recurrence rules at query time, which is slow and awkward to index.&lt;/p&gt;

&lt;p&gt;Exceptions. The tutor is away next Tuesday. Now you have a rule plus an override, and your query needs to apply both. Then they move the Tuesday slot permanently from next month, so you have a rule with an end date and a second rule with a start date.&lt;/p&gt;

&lt;p&gt;Time zones. This is the one that cost me the most. A tutor in London offering 4pm slots to a student in Mumbai is not offering a fixed UTC time, because when DST shifts in one region and not the other, the relative gap changes. If you store availability in UTC you get silently wrong slots twice a year. If you store it in local time with a zone, every query needs conversion.&lt;/p&gt;

&lt;p&gt;What I settled on was storing the rule in the tutor's local time with an explicit IANA zone, plus a materialised slot table covering a rolling window ahead, regenerated by a job when rules change.&lt;/p&gt;

&lt;p&gt;sql&lt;br&gt;
create table availability_rule (&lt;br&gt;
  id            uuid primary key,&lt;br&gt;
  tutor_id      uuid not null references tutor(id),&lt;br&gt;
  weekday       smallint not null,        -- 0..6 in tutor local time&lt;br&gt;
  start_local   time not null,&lt;br&gt;
  end_local     time not null,&lt;br&gt;
  tz            text not null,            -- 'Europe/London'&lt;br&gt;
  valid_from    date not null,&lt;br&gt;
  valid_until   date&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;The rolling window is a compromise and I am still not fully happy with it, but it makes search queries straightforward and keeps row counts manageable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Two students booking the same slot&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is where I learned that application-level checks are not enough.&lt;/p&gt;

&lt;p&gt;My first implementation did the obvious thing: query for conflicts, and if none, insert the booking. Under any real concurrency this double-books, because two requests can both pass the check before either inserts. Classic read-then-write race.&lt;/p&gt;

&lt;p&gt;I tried a transaction with SELECT ... FOR UPDATE on the slot row, which works but only if slots are materialised rows you can lock, and it serialises more than I wanted.&lt;/p&gt;

&lt;p&gt;What actually solved it cleanly was pushing the constraint into Postgres with an exclusion constraint over a time range:&lt;/p&gt;

&lt;p&gt;sql&lt;br&gt;
create extension if not exists btree_gist;&lt;/p&gt;

&lt;p&gt;create table booking (&lt;br&gt;
  id        uuid primary key,&lt;br&gt;
  tutor_id  uuid not null references tutor(id),&lt;br&gt;
  student_id uuid not null references student(id),&lt;br&gt;
  period    tstzrange not null,&lt;br&gt;
  status    text not null,&lt;br&gt;
  constraint no_overlap_per_tutor&lt;br&gt;
    exclude using gist (&lt;br&gt;
      tutor_id with =,&lt;br&gt;
      period with &amp;amp;&amp;amp;&lt;br&gt;
    ) where (status in ('pending', 'confirmed'))&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;Now the database refuses overlapping bookings for the same tutor, and the application just handles the constraint violation as a normal "slot taken" response. The where clause matters: cancelled bookings should not block the slot forever.&lt;/p&gt;

&lt;p&gt;The thing I would tell anyone starting this: put the invariant in the database. Every booking system eventually grows a second code path (admin panel, bulk import, a background job) and the application check will not be in that path.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Money arrives before the service does&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the part that makes a marketplace different from a shop.&lt;/p&gt;

&lt;p&gt;When a student books, they pay. But the tutor has not done anything yet, and will not for another four days. So the platform is holding money against a future obligation, and every edge case around that obligation needs a decision encoded somewhere.&lt;/p&gt;

&lt;p&gt;The student cancels 48 hours ahead. Full refund, probably. Two hours ahead? Partial, maybe none. The tutor cancels. Full refund plus something for the inconvenience. Neither party shows up. Now you are adjudicating.&lt;/p&gt;

&lt;p&gt;The session happens and the student says it was useless. This one has no clean answer and whatever you decide becomes policy.&lt;/p&gt;

&lt;p&gt;I ended up modelling the booking as an explicit state machine rather than a boolean is_completed, because every transition has a payment consequence:&lt;/p&gt;

&lt;p&gt;pending -&amp;gt; confirmed -&amp;gt; in_progress -&amp;gt; completed -&amp;gt; paid_out&lt;br&gt;
   |           |                           |&lt;br&gt;
   +-&amp;gt; expired +-&amp;gt; cancelled_by_student    +-&amp;gt; disputed&lt;br&gt;
               +-&amp;gt; cancelled_by_tutor&lt;br&gt;
               +-&amp;gt; no_show_student&lt;br&gt;
               +-&amp;gt; no_show_tutor&lt;/p&gt;

&lt;p&gt;Each transition carries a payment action: hold, release, partial refund, full refund, payout. Writing it as a table of (from_state, to_state, actor, payment_action) rather than as scattered conditionals was the single biggest improvement to my sanity.&lt;/p&gt;

&lt;p&gt;Payouts bring their own problems. Tutors are individuals in many countries, which means onboarding, tax information, and payout schedules that differ by region. I used a payments provider's connected account model rather than touching any of this directly, and I recommend that strongly. Holding other people's money is not a feature worth building.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Verification has a lifecycle, not a checkbox&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I initially stored is_verified boolean. That is wrong in a way that matters.&lt;/p&gt;

&lt;p&gt;Background checks and certifications expire. A tutor verified in March may not be verified in September, and the platform's whole proposition to a parent rests on that status being current. So verification needs an issue date, an expiry, a type, and a jurisdiction, and the expiry has to actually gate something.&lt;/p&gt;

&lt;p&gt;The important design point: expiry should remove the tutor from search results automatically, not generate a report for somebody to read. I had it as a report first. Reports do not get read.&lt;/p&gt;

&lt;p&gt;sql&lt;br&gt;
create table tutor_credential (&lt;br&gt;
  tutor_id    uuid not null references tutor(id),&lt;br&gt;
  kind        text not null,        -- 'identity', 'background_check', 'qualification'&lt;br&gt;
  jurisdiction text,&lt;br&gt;
  issued_on   date not null,&lt;br&gt;
  expires_on  date,&lt;br&gt;
  verified_at timestamptz&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;Search then joins against a view of tutors whose required credentials are all currently valid. One query, no human in the loop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Search is a multi-dimensional filter problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The query a parent actually runs is: chemistry, secondary level, available Tuesday or Thursday evening in my timezone, under a price ceiling, verified, rated above some threshold.&lt;/p&gt;

&lt;p&gt;That is five or six filters, one of which is a time range in a different timezone from the stored data, and it needs to return in under a second. Doing this with joins across availability, credentials, subjects and pricing got slow fast.&lt;/p&gt;

&lt;p&gt;What helped was precomputing a denormalised search table, refreshed on change, with availability flattened into coarse buckets (weekday plus morning, afternoon, evening in UTC) for the initial filter, then exact slot checking only on the shortlist. Two-stage filtering rather than one perfect query.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I would do differently&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Model availability as rules from day one, not as rows. Converting later was painful.&lt;/p&gt;

&lt;p&gt;Put booking invariants in the database immediately. The exclusion constraint should have been the first migration.&lt;/p&gt;

&lt;p&gt;Write the state machine before writing any booking code. Every conditional I avoided by doing this would have become a bug.&lt;/p&gt;

&lt;p&gt;And decide the cancellation and refund policy before building the payment flow, because the policy determines the data model and not the other way round. I built the flow first and then retrofitted the policy, which meant a migration and a week I did not need to spend.&lt;/p&gt;

&lt;p&gt;If you are looking at this problem space more broadly, the operational side of tutor app development has a lot more in it than the backend: supply density by subject and time window turns out to matter more commercially than anything above. But the five things here are what will eat your engineering time.&lt;/p&gt;

&lt;p&gt;Happy to go deeper on any of these if useful. The availability model in particular I am still not convinced I got right, and I would be interested in how others have handled the recurrence versus materialisation trade-off.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>opensource</category>
      <category>ai</category>
      <category>security</category>
    </item>
    <item>
      <title>I Connected My AI Agent to a CRM. It Started Duplicating Customer Records</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Mon, 23 Nov 2026 07:46:44 +0000</pubDate>
      <link>https://dev.to/aartijangid23/i-connected-my-ai-agent-to-a-crm-it-started-duplicating-customer-records-213m</link>
      <guid>https://dev.to/aartijangid23/i-connected-my-ai-agent-to-a-crm-it-started-duplicating-customer-records-213m</guid>
      <description>&lt;p&gt;Quick answer: AI agents duplicate CRM records because they call "create" tools that are not idempotent. Retries, parallel tool calls and slightly different emails all turn into new rows. The fix is to give the agent one upsert_contact tool that normalizes the key, checks a lock, and calls the CRM's native upsert endpoint instead of a plain create.&lt;/p&gt;

&lt;p&gt;What Actually Happened?&lt;/p&gt;

&lt;p&gt;The setup looked harmless. A support agent read inbound emails, pulled out the sender's name, company and phone, and wrote them to the CRM so sales could follow up. It had two tools: search_contact and create_contact.&lt;/p&gt;

&lt;p&gt;For the first week, it worked. Then the sales team started seeing the same customer three or four times:&lt;/p&gt;

&lt;p&gt;&lt;a href="mailto:jane.doe@acme.com"&gt;jane.doe@acme.com&lt;/a&gt;&lt;br&gt;
&lt;a href="mailto:Jane.Doe@Acme.com"&gt;Jane.Doe@Acme.com&lt;/a&gt;&lt;br&gt;
&lt;a href="mailto:jane.doe@acme.com"&gt;jane.doe@acme.com&lt;/a&gt;  (with a trailing space)&lt;br&gt;
a fourth record with the same email, created two seconds after the first&lt;/p&gt;

&lt;p&gt;No single bug caused this. Four small ones did.&lt;/p&gt;

&lt;p&gt;Why Do AI Agents Create Duplicate CRM Records?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Retries are not free&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When a tool call times out, most agent frameworks retry it. If the first create_contact actually succeeded on the CRM side but the response was slow, the retry creates a second record. The agent never sees the first one.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Parallel tool calls race each other&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Modern models can call several tools at once. When two emails from the same person arrived in one batch, the agent ran search_contact twice in parallel. Both searches returned "not found", so both branches called create_contact.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The model rewrites the key&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;LLMs like to tidy up text. Sometimes the agent passed the email exactly as written, sometimes in lowercase, sometimes with the display name stripped differently. The CRM treated each variation as a new person.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search-then-create is a check-then-act bug&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Even without parallel calls, "search, then create if missing" has a gap between the two calls. Any other writer, such as a form integration or a webhook, can insert a record in that gap.&lt;/p&gt;

&lt;p&gt;How Do You Stop an AI Agent From Duplicating CRM Records?&lt;/p&gt;

&lt;p&gt;The rule I ended up with: the agent should never be able to create a contact. It can only upsert one.&lt;/p&gt;

&lt;p&gt;Replace two tools with one&lt;/p&gt;

&lt;p&gt;Remove create_contact from the tool list entirely. Give the agent a single upsert_contact tool with a strict schema:&lt;/p&gt;

&lt;p&gt;json&lt;br&gt;
{&lt;br&gt;
  "name": "upsert_contact",&lt;br&gt;
  "description": "Create or update a CRM contact. Always use this instead of creating contacts. Email is the unique key.",&lt;br&gt;
  "input_schema": {&lt;br&gt;
    "type": "object",&lt;br&gt;
    "properties": {&lt;br&gt;
      "email": { "type": "string" },&lt;br&gt;
      "first_name": { "type": "string" },&lt;br&gt;
      "last_name": { "type": "string" },&lt;br&gt;
      "company": { "type": "string" },&lt;br&gt;
      "phone": { "type": "string" }&lt;br&gt;
    },&lt;br&gt;
    "required": ["email"]&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
Normalize the key in code, not in the prompt&lt;/p&gt;

&lt;p&gt;Do not ask the model to lowercase emails. Do it in the tool handler, where it is deterministic:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
import hashlib&lt;/p&gt;

&lt;p&gt;def normalize_email(raw: str) -&amp;gt; str:&lt;br&gt;
    return raw.strip().lower()&lt;/p&gt;

&lt;p&gt;def idempotency_key(email: str, source_message_id: str) -&amp;gt; str:&lt;br&gt;
    return hashlib.sha256(f"{email}:{source_message_id}".encode()).hexdigest()&lt;/p&gt;

&lt;p&gt;Tying the idempotency key to the source message ID means a retry of the same tool call becomes a no-op, while a truly new email from the same person still updates the record.&lt;/p&gt;

&lt;p&gt;Use the CRM's native upsert&lt;/p&gt;

&lt;p&gt;Every major CRM already has an upsert endpoint. Use it instead of building search-then-create yourself.&lt;/p&gt;

&lt;p&gt;HubSpot: POST /crm/objects/2026-09/contacts/batch/upsert takes an inputs array where each item has an id, optional idProperty naming a unique property, and properties.&lt;br&gt;
Salesforce: PATCH /services/data/vXX.X/sobjects/Contact/External_Id__c/{value} creates the record if no match exists and updates it if one does. If the external ID matches more than one record, Salesforce returns a 300 and writes nothing, which is a useful safety net.&lt;br&gt;
Zoho CRM: POST /crm/v8/Contacts/upsert accepts a duplicate_check_fields array. Email is the default system-defined check for Leads and Contacts, and each call takes up to 100 records.&lt;br&gt;
Add a short lock for parallel calls&lt;/p&gt;

&lt;p&gt;Native upsert handles most races, but a per-key lock removes the rest:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
def upsert_contact(args, message_id, crm, cache):&lt;br&gt;
    email = normalize_email(args["email"])&lt;br&gt;
    key = idempotency_key(email, message_id)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Skip exact retries of the same tool call
if cache.get(f"done:{key}"):
    return {"status": "skipped_duplicate_call"}

# Serialize writes for the same email for a few seconds
with cache.lock(f"lock:contact:{email}", timeout=10):
    result = crm.upsert_contact(email=email, fields=args)
    cache.set(f"done:{key}", True, ttl=86400)
    return {"status": "ok", "crm_id": result["id"]}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Any shared store with a lock primitive works here. The point is that two parallel branches for the same email now wait in line instead of racing.&lt;/p&gt;

&lt;p&gt;Return the record ID to the agent&lt;/p&gt;

&lt;p&gt;After an upsert, return the CRM ID in the tool result. Tell the agent in its instructions to reuse that ID for follow-up updates, tasks or notes, so it stops searching by name later in the conversation.&lt;/p&gt;

&lt;p&gt;How Do You Clean Up the Duplicates That Already Exist?&lt;/p&gt;

&lt;p&gt;Fixing the writer does not fix the data. For the existing mess:&lt;/p&gt;

&lt;p&gt;Export contacts and group them by normalized email.&lt;br&gt;
Pick a survivor per group, usually the oldest record or the one with the most activity.&lt;br&gt;
Use the CRM's own merge feature or API so activities, deals and notes move to the survivor.&lt;br&gt;
Turn on the CRM's built-in duplicate rules, such as Salesforce duplicate and matching rules or Zoho's unique fields, so humans and integrations are protected too.&lt;br&gt;
Log every merge so sales can trace what changed.&lt;br&gt;
What About Security and Compliance?&lt;/p&gt;

&lt;p&gt;An agent with write access to a CRM is a privileged integration. Give it a dedicated API user with the narrowest scope that works: contacts read and upsert, no delete, no export. Store tokens in a secrets manager, not in prompts. Log every tool call with the source message ID so you can audit what the agent wrote and why.&lt;/p&gt;

&lt;p&gt;Customer records are personal data, so check how your setup fits GDPR, CCPA or local privacy rules, including deletion requests. Merging records can affect consent flags and marketing preferences, so make sure the survivor keeps the strictest consent state. This is general information, not legal advice.&lt;/p&gt;

&lt;p&gt;Which Teams Can Help With AI Agent and CRM Integration?&lt;/p&gt;

&lt;p&gt;If you would rather not build this yourself, these firms work on CRM integration and AI. Figures below come from each company's own website and are self-reported, so confirm them directly before signing anything.&lt;/p&gt;

&lt;p&gt;Dev Technosys: A CRM software development company that builds custom CRMs and connects AI agents, chatbots and automation to existing platforms such as HubSpot, Salesforce and Zoho through their APIs. Its team designs the integration layer itself, including upsert logic, sync rules and role-based access, so agents write clean data from the first day instead of creating cleanup work for sales teams later.&lt;/p&gt;

&lt;p&gt;Aptitude 8: Calling itself an Elite HubSpot Solutions Partner, Aptitude 8 is accredited in CRM implementation, custom integrations and advanced CMS work. It offers HubSpot migrations, ERP integrations, custom architecture and AI enablement for HubSpot, and states that all work is done by an in-house, US-based team. Aptitude 8 suits HubSpot-first companies that want agents and integrations built inside their portal.&lt;/p&gt;

&lt;p&gt;Coastal Cloud: With Salesforce top-tier partner status since 2012, Coastal Cloud lists 1,700+ organizations served and 8,500+ projects completed. Its services cover data modernization, implementation and integration, and AI and agentic solutions including Agentforce, alongside MuleSoft, Tableau and Snowflake work. Coastal Cloud suits Salesforce customers rolling out agents across sales and service.&lt;/p&gt;

&lt;p&gt;Ascendix: Based in Dallas, Ascendix builds Salesforce-based CRMs for commercial real estate, including AscendixRE CRM and Ascendix Search. Its AI Suite is listed as a $39 per org add-on that connects ChatGPT or Claude to live deal data. Ascendix suits real estate firms that want AI access to CRM records without a custom build.&lt;/p&gt;

&lt;p&gt;CloudPaths: Positioned as an enterprise IT consulting and systems integration firm, CloudPaths reports 250+ consultants, architects and engineers and 8+ years of delivery. Its work spans Salesforce, NetSuite, SAP and Data and AI, with one case study citing 100+ APIs delivered for an edtech company. CloudPaths suits enterprises connecting a CRM to ERP and data platforms at the same time.&lt;/p&gt;

&lt;p&gt;Takeaway&lt;/p&gt;

&lt;p&gt;Duplicate records were not an AI problem. They were an integration problem that AI made visible faster. Treat every agent write as an at-least-once delivery: one upsert tool, a normalized key, the CRM's native upsert, a short lock, and the record ID passed back to the agent. Then clean the old data once and let the CRM's own duplicate rules guard the rest.&lt;/p&gt;

&lt;p&gt;FAQ&lt;/p&gt;

&lt;p&gt;Why does my AI agent create duplicate contacts in HubSpot or Salesforce?&lt;/p&gt;

&lt;p&gt;Usually because it calls a create endpoint on retries or in parallel, and passes slightly different versions of the same email. Replace create with upsert and normalize the email in code.&lt;/p&gt;

&lt;p&gt;Is prompt engineering enough to prevent duplicates?&lt;/p&gt;

&lt;p&gt;No. Prompts reduce the problem but cannot stop retries or race conditions. Enforce uniqueness in the tool handler and the CRM.&lt;/p&gt;

&lt;p&gt;What is an idempotent tool call?&lt;/p&gt;

&lt;p&gt;A tool call that has the same effect whether it runs once or several times. For CRM writes, that means upsert by a unique key plus an idempotency key per source event.&lt;/p&gt;

&lt;p&gt;Should AI agents have delete access to a CRM?&lt;/p&gt;

&lt;p&gt;Rarely. Give agents upsert and read scopes, and leave merges and deletes to humans or audited batch jobs.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>architecture</category>
      <category>api</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>How to Fix 401 Unauthorized Errors When Calling APIs in React</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Thu, 19 Nov 2026 10:27:42 +0000</pubDate>
      <link>https://dev.to/aartijangid23/how-to-fix-401-unauthorized-errors-when-calling-apis-in-react-1f17</link>
      <guid>https://dev.to/aartijangid23/how-to-fix-401-unauthorized-errors-when-calling-apis-in-react-1f17</guid>
      <description>&lt;p&gt;Have you ever connected a React application to a backend API, only to receive a 401 Unauthorized error even though your endpoint seems to work correctly?&lt;/p&gt;

&lt;p&gt;This is a common issue when building applications that use authentication, JWT tokens, or protected API routes.&lt;/p&gt;

&lt;p&gt;Sometimes the request works in Postman but fails in your React application. Other times, the login succeeds, but subsequent API requests return an unauthorized response.&lt;/p&gt;

&lt;p&gt;The problem is often related to missing authorization headers, expired tokens, incorrect authentication middleware, or frontend and backend configuration mismatches.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll explore what causes 401 errors, how to fix them using React and Express.js, and how to debug authentication problems in modern web applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Is a 401 Unauthorized Error?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An HTTP 401 status indicates that a request lacks valid authentication credentials for the requested resource.&lt;/p&gt;

&lt;p&gt;For example, imagine your application has a protected endpoint:&lt;/p&gt;

&lt;p&gt;GET /api/profile&lt;/p&gt;

&lt;p&gt;The server expects the client to provide a valid access token.&lt;/p&gt;

&lt;p&gt;If the token is missing, expired, malformed, or rejected, the server may return:&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "error": "Unauthorized",&lt;br&gt;
  "message": "Authentication required"&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;It is important to understand the difference between two common HTTP status codes.&lt;/p&gt;

&lt;p&gt;401 Unauthorized: The request does not contain valid authentication credentials.&lt;/p&gt;

&lt;p&gt;403 Forbidden: The server understands the request but refuses to authorize the action. For example, an authenticated user may lack the required permissions.&lt;/p&gt;

&lt;p&gt;Knowing this distinction helps developers identify whether the problem involves authentication or authorization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Do 401 Unauthorized Errors Occur in React?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Several common situations can trigger authentication failures when React communicates with a backend API.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Missing Authorization Header&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A protected API may expect an access token in the HTTP Authorization header.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;fetch("&lt;a href="http://localhost:3000/api/profile%22" rel="noopener noreferrer"&gt;http://localhost:3000/api/profile"&lt;/a&gt;);&lt;/p&gt;

&lt;p&gt;If the endpoint requires authentication, this request will fail because no credentials are provided.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Expired JWT Token&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;JSON Web Tokens often contain an expiration timestamp.&lt;/p&gt;

&lt;p&gt;When a token expires, the backend should reject it rather than allowing continued access.&lt;/p&gt;

&lt;p&gt;React applications need to handle this situation by obtaining a new token through an authorized refresh process or prompting the user to sign in again.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Incorrect Token Format&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Many APIs use the Bearer authentication scheme.&lt;/p&gt;

&lt;p&gt;The expected format is:&lt;/p&gt;

&lt;p&gt;Authorization: Bearer YOUR_ACCESS_TOKEN&lt;/p&gt;

&lt;p&gt;Sending only the raw token may cause authentication to fail.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Incorrect Backend Authentication Middleware&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Even if React sends the correct token, backend middleware may reject it because of invalid signature verification, incorrect configuration, or unsupported token types.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Authentication State Is Not Ready&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Sometimes React makes a protected API request before the application has completed its authentication initialization.&lt;/p&gt;

&lt;p&gt;This can result in an API request being sent without the required credentials.&lt;/p&gt;

&lt;p&gt;How to Fix 401 Unauthorized Errors in React&lt;/p&gt;

&lt;p&gt;Let's look at several practical solutions.&lt;/p&gt;

&lt;p&gt;Method 1: Send the Authorization Header Correctly&lt;/p&gt;

&lt;p&gt;When calling a protected API, include the access token in the request headers.&lt;/p&gt;

&lt;p&gt;const token = "YOUR_ACCESS_TOKEN";&lt;/p&gt;

&lt;p&gt;async function getProfile() {&lt;br&gt;
  const response = await fetch(&lt;br&gt;
    "&lt;a href="http://localhost:3000/api/profile" rel="noopener noreferrer"&gt;http://localhost:3000/api/profile&lt;/a&gt;",&lt;br&gt;
    {&lt;br&gt;
      headers: {&lt;br&gt;
        Authorization: &lt;code&gt;Bearer ${token}&lt;/code&gt;,&lt;br&gt;
      },&lt;br&gt;
    }&lt;br&gt;
  );&lt;/p&gt;

&lt;p&gt;if (!response.ok) {&lt;br&gt;
    throw new Error(&lt;code&gt;HTTP error: ${response.status}&lt;/code&gt;);&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;return response.json();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;What does this code do?&lt;/p&gt;

&lt;p&gt;The Authorization header sends the access token to the backend.&lt;/p&gt;

&lt;p&gt;The Bearer prefix identifies the authentication scheme.&lt;/p&gt;

&lt;p&gt;The response check helps detect unsuccessful requests instead of treating every response as valid.&lt;/p&gt;

&lt;p&gt;In a production application, obtain the token through a secure authentication flow rather than hardcoding it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Method 2: Verify JWT Tokens in Express.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your backend uses Express.js, you can protect routes using JWT verification.&lt;/p&gt;

&lt;p&gt;First, install the required package:&lt;/p&gt;

&lt;p&gt;npm install express jsonwebtoken&lt;/p&gt;

&lt;p&gt;Create an authentication middleware:&lt;/p&gt;

&lt;p&gt;const express = require("express");&lt;br&gt;
const jwt = require("jsonwebtoken");&lt;/p&gt;

&lt;p&gt;const app = express();&lt;/p&gt;

&lt;p&gt;function authenticateToken(req, res, next) {&lt;br&gt;
  const authHeader = req.headers.authorization;&lt;/p&gt;

&lt;p&gt;const token = authHeader?.startsWith("Bearer ")&lt;br&gt;
    ? authHeader.slice(7)&lt;br&gt;
    : null;&lt;/p&gt;

&lt;p&gt;if (!token) {&lt;br&gt;
    return res.status(401).json({&lt;br&gt;
      message: "Access token required",&lt;br&gt;
    });&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;try {&lt;br&gt;
    const user = jwt.verify(&lt;br&gt;
      token,&lt;br&gt;
      process.env.JWT_SECRET,&lt;br&gt;
      { algorithms: ["HS256"] }&lt;br&gt;
    );&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;req.user = user;
next();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;} catch (error) {&lt;br&gt;
    return res.status(401).json({&lt;br&gt;
      message: "Invalid or expired token",&lt;br&gt;
    });&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;app.get("/api/profile", authenticateToken, (req, res) =&amp;gt; {&lt;br&gt;
  res.json({&lt;br&gt;
    message: "Authenticated successfully",&lt;br&gt;
    userId: req.user.sub,&lt;br&gt;
  });&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;app.listen(3000);&lt;/p&gt;

&lt;p&gt;Important: This example assumes that your authentication server issues HS256-signed JWTs with a sub claim.&lt;/p&gt;

&lt;p&gt;Configure JWT_SECRET securely in your server environment. Never expose it in frontend code, and use appropriate issuer and audience validation when applicable.&lt;/p&gt;

&lt;p&gt;The middleware verifies the token before allowing access to the protected endpoint.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Method 3: Handle Expired Tokens Gracefully&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common mistake is assuming that an access token will remain valid throughout the user's session.&lt;/p&gt;

&lt;p&gt;Instead, React should handle authentication failures.&lt;/p&gt;

&lt;p&gt;async function fetchProtectedData(token) {&lt;br&gt;
  const response = await fetch("/api/profile", {&lt;br&gt;
    headers: {&lt;br&gt;
      Authorization: &lt;code&gt;Bearer ${token}&lt;/code&gt;,&lt;br&gt;
    },&lt;br&gt;
  });&lt;/p&gt;

&lt;p&gt;if (response.status === 401) {&lt;br&gt;
    throw new Error("Session expired or unauthorized");&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;if (!response.ok) {&lt;br&gt;
    throw new Error("Unable to load profile");&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;return response.json();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;When this function reports an authentication failure, the application can redirect users to login or initiate a properly configured token refresh flow.&lt;/p&gt;

&lt;p&gt;For secure refresh-token handling, follow your authentication provider's recommended session architecture.&lt;/p&gt;

&lt;p&gt;Method 4: Check API Base URLs and Environment Variables&lt;/p&gt;

&lt;p&gt;Sometimes developers accidentally send requests to the wrong backend.&lt;/p&gt;

&lt;p&gt;For example, a React application may use:&lt;/p&gt;

&lt;p&gt;const API_URL = import.meta.env.VITE_API_URL;&lt;/p&gt;

&lt;p&gt;With a Vite environment file:&lt;/p&gt;

&lt;p&gt;VITE_API_URL=&lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;p&gt;fetch(&lt;code&gt;${API_URL}/api/profile&lt;/code&gt;, {&lt;br&gt;
  headers: {&lt;br&gt;
    Authorization: &lt;code&gt;Bearer ${token}&lt;/code&gt;,&lt;br&gt;
  },&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;Verify that the frontend is communicating with the correct API environment.&lt;/p&gt;

&lt;p&gt;Remember that VITE_ variables are exposed to client-side code, so they must never contain server secrets or private API keys.&lt;/p&gt;

&lt;p&gt;Common 401 Errors and Their Solutions&lt;/p&gt;

&lt;p&gt;Problem&lt;/p&gt;

&lt;p&gt;Possible solution&lt;/p&gt;

&lt;p&gt;Missing access token&lt;/p&gt;

&lt;p&gt;Add the Authorization header&lt;/p&gt;

&lt;p&gt;Expired JWT&lt;/p&gt;

&lt;p&gt;Refresh credentials or sign in again&lt;/p&gt;

&lt;p&gt;Incorrect Bearer format&lt;/p&gt;

&lt;p&gt;Verify the Authorization scheme&lt;/p&gt;

&lt;p&gt;Wrong API endpoint&lt;/p&gt;

&lt;p&gt;Check backend URL and environment&lt;/p&gt;

&lt;p&gt;Invalid token signature&lt;/p&gt;

&lt;p&gt;Verify server signing configuration&lt;/p&gt;

&lt;p&gt;Missing session cookie&lt;/p&gt;

&lt;p&gt;Check cookie and credential settings&lt;/p&gt;

&lt;p&gt;Request sent before login&lt;/p&gt;

&lt;p&gt;Wait for authentication initialization&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;How to Debug 401 Errors Effectively&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
If your authentication configuration appears correct but the request continues failing, follow these steps.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the browser developer tools&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Navigate to the Network tab and locate the unsuccessful API request.&lt;/p&gt;

&lt;p&gt;Check the request URL, HTTP method, and response status.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inspect the Authorization header&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Verify that the request includes the expected authentication scheme.&lt;/p&gt;

&lt;p&gt;Avoid copying access tokens into public logs, screenshots, or issue reports.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check the backend authentication middleware&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Determine whether the token is missing, expired, or rejected during verification.&lt;/p&gt;

&lt;p&gt;Log diagnostic error categories without exposing credentials.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Compare browser and Postman behavior&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If Postman works but React fails, compare how the two clients send authorization headers, cookies, and request bodies.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check cookie-based authentication&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If your application uses session cookies rather than Bearer tokens, verify that cookies are being sent correctly.&lt;/p&gt;

&lt;p&gt;Cross-origin cookie authentication may require the appropriate credentials setting, CORS configuration, and cookie attributes.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;401 Errors vs CORS Errors&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Developers sometimes confuse authentication failures with browser cross-origin restrictions.&lt;/p&gt;

&lt;p&gt;However, the two problems are different.&lt;/p&gt;

&lt;p&gt;A CORS error concerns whether browser JavaScript is allowed to access a cross-origin response.&lt;/p&gt;

&lt;p&gt;A 401 response concerns whether the request includes valid authentication credentials.&lt;/p&gt;

&lt;p&gt;A request can encounter both issues.&lt;/p&gt;

&lt;p&gt;For example, a backend may return a 401 response without the correct CORS headers, causing the browser to display a CORS-related error.&lt;/p&gt;

&lt;p&gt;When debugging, inspect the Network tab and backend logs to identify the underlying failure.&lt;/p&gt;

&lt;p&gt;Understanding these differences is essential when building reliable API integrations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Authentication in Modern AI-Powered Applications&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Authentication is also important when integrating AI capabilities into existing applications.&lt;/p&gt;

&lt;p&gt;Consider a React chatbot connected to a backend that communicates with an AI service.&lt;/p&gt;

&lt;p&gt;The frontend should authenticate users with your application backend, while the backend securely manages private AI provider credentials.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;React Frontend&lt;br&gt;
      |&lt;br&gt;
      | Authenticated Request&lt;br&gt;
      v&lt;br&gt;
Express Backend&lt;br&gt;
      |&lt;br&gt;
      | Server-side AI API Request&lt;br&gt;
      v&lt;br&gt;
AI Service&lt;/p&gt;

&lt;p&gt;This architecture helps prevent private API keys from being exposed in browser code.&lt;/p&gt;

&lt;p&gt;It also allows developers to implement user-level permissions, request validation, rate limiting, and usage monitoring.&lt;/p&gt;

&lt;p&gt;As applications become more complex, reliable authentication becomes an important part of secure AI integration and software development.&lt;/p&gt;

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

&lt;p&gt;401 Unauthorized errors are common when building React applications that communicate with protected APIs.&lt;/p&gt;

&lt;p&gt;Fortunately, most authentication issues can be identified by checking request headers, validating access tokens, reviewing backend middleware, and verifying application configuration.&lt;/p&gt;

&lt;p&gt;Instead of repeatedly changing frontend code without understanding the cause, developers should examine the complete authentication flow.&lt;/p&gt;

&lt;p&gt;A reliable solution protects user sessions, handles expired credentials appropriately, and keeps sensitive information on the server.&lt;/p&gt;

&lt;p&gt;Understanding HTTP authentication helps developers build more secure web applications, troubleshoot API integration problems, and prepare applications for more advanced functionality.&lt;/p&gt;

</description>
      <category>401</category>
      <category>help</category>
      <category>ai</category>
      <category>security</category>
    </item>
    <item>
      <title>I Built an AI Agent That Worked in Testing but Failed in Production</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Mon, 16 Nov 2026 13:33:22 +0000</pubDate>
      <link>https://dev.to/aartijangid23/i-built-an-ai-agent-that-worked-in-testing-but-failed-in-production-4okn</link>
      <guid>https://dev.to/aartijangid23/i-built-an-ai-agent-that-worked-in-testing-but-failed-in-production-4okn</guid>
      <description>&lt;p&gt;Building an AI agent that works in a development environment feels like a major achievement. The agent understands instructions, communicates with external tools, generates accurate responses, and completes tasks with minimal intervention.&lt;/p&gt;

&lt;p&gt;But getting an AI agent to work locally is very different from making it reliable in production.&lt;/p&gt;

&lt;p&gt;Imagine spending weeks building an AI-powered customer support agent. It passes every initial test, responds accurately to customer questions, and retrieves information from a knowledge base.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Then you deploy it.&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Suddenly, responses become slower, API requests fail, the agent selects incorrect tools, and users begin reporting inconsistent results.&lt;/p&gt;

&lt;p&gt;This is an illustrative account of how that failure can happen, what the debugging process looks like, and what developers should consider before deploying agentic AI systems.&lt;br&gt;
The AI Agent I Was Building&lt;br&gt;
The goal was simple: create an AI customer support agent capable of answering common questions and performing basic support operations.&lt;/p&gt;

&lt;p&gt;The architecture included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A large language model for understanding user requests.&lt;/li&gt;
&lt;li&gt;A retrieval system for accessing support documentation.&lt;/li&gt;
&lt;li&gt;External APIs for checking order information.&lt;/li&gt;
&lt;li&gt;A tool-calling mechanism for executing actions.&lt;/li&gt;
&lt;li&gt;A Python backend for handling requests.&lt;/li&gt;
&lt;li&gt;Logging for monitoring agent activity.
The development version worked with a limited dataset and simulated API responses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a user could ask:&lt;br&gt;
Where is my order, and when will it arrive?&lt;/p&gt;

&lt;p&gt;The agent would identify the request, call the order-tracking function, retrieve shipment details, and generate a response.&lt;/p&gt;

&lt;p&gt;During local testing, the process appeared stable.&lt;/p&gt;

&lt;p&gt;The problems became visible when the same workflow encountered real traffic, inconsistent external responses, and production infrastructure limits.&lt;br&gt;
Problem 1: The Agent Worked With Mock APIs but Failed With Real Services&lt;br&gt;
One of the biggest mistakes in AI agent development is assuming that successful integration tests guarantee production reliability.&lt;/p&gt;

&lt;p&gt;During testing, I imagined using a mock API that always returned predictable data.&lt;br&gt;
def get_order_status(order_id):    return {        "order_id": order_id,        "status": "shipped",        "delivery_date": "2027-01-15"    }&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Every request returned the expected structure.&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
However, real APIs behave differently. They can return errors, incomplete responses, authentication failures, or temporary service interruptions.&lt;/p&gt;

&lt;p&gt;A production API might respond with:&lt;br&gt;
{&lt;br&gt;
  "error": "Service temporarily unavailable",&lt;br&gt;
  "status_code": 503&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Without appropriate error handling, the agent may attempt to interpret this response as valid order information.&lt;br&gt;
How I Would Fix It&lt;br&gt;
The first improvement would be adding timeout handling, bounded retries, and response validation.&lt;br&gt;
import requestsfrom requests.exceptions import RequestExceptiondef get_order_status(order_id):    url = f"&lt;a href="https://api.example.com/orders/%7Border_id%7D" rel="noopener noreferrer"&gt;https://api.example.com/orders/{order_id}&lt;/a&gt;"    try:        response = requests.get(            url,            timeout=5        )        response.raise_for_status()        data = response.json()        if not isinstance(data, dict) or "status" not in data:            return {                "success": False,                "error": "Invalid response format"            }        return {            "success": True,            "data": data        }    except (RequestException, ValueError):        return {            "success": False,            "error": "Order service unavailable"        }&lt;/p&gt;

&lt;p&gt;In a real application, I would also include authenticated API access, authorization checks, request tracing, and retries limited to safe operations.&lt;/p&gt;

&lt;p&gt;The lesson is simple: AI agents must be prepared for external systems to fail.&lt;br&gt;
Problem 2: The Agent Selected the Wrong Tools&lt;br&gt;
Tool calling makes AI agents powerful.&lt;/p&gt;

&lt;p&gt;Instead of generating text only, an agent can interact with APIs, databases, calendars, and other services.&lt;/p&gt;

&lt;p&gt;However, tool selection is not always consistent.&lt;/p&gt;

&lt;p&gt;Imagine an agent with these tools:&lt;br&gt;
tools = [    "get_order_status",    "cancel_order",    "create_support_ticket",    "update_customer_profile"]&lt;/p&gt;

&lt;p&gt;During testing, the model might correctly select get_order_status when a customer requests shipping information.&lt;/p&gt;

&lt;p&gt;In production, a slightly ambiguous request could lead to an incorrect tool choice.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
My order is late. Can you do something about it?&lt;/p&gt;

&lt;p&gt;The agent might incorrectly interpret this as authorization to cancel an order.&lt;/p&gt;

&lt;p&gt;That creates a serious business risk.&lt;br&gt;
My Approach to Safer Tool Execution&lt;br&gt;
I would separate the model's proposed action from the application's permission to execute it.&lt;br&gt;
SAFE_READ_TOOLS = {    "get_order_status",}CONFIRMATION_REQUIRED_TOOLS = {    "cancel_order",    "update_customer_profile",}def execute_tool(tool_name, arguments, confirmed=False):    if tool_name in CONFIRMATION_REQUIRED_TOOLS:        if not confirmed:            return {                "success": False,                "error": "User confirmation required"            }    if tool_name not in SAFE_READ_TOOLS | CONFIRMATION_REQUIRED_TOOLS:        return {            "success": False,            "error": "Tool not allowed"        }    return dispatch_tool(tool_name, arguments)&lt;/p&gt;

&lt;p&gt;Here, dispatch_tool represents an application-controlled function registry.&lt;/p&gt;

&lt;p&gt;For production use, confirmation must come from a trusted application workflow, not a boolean the language model can set itself. The backend should also validate arguments, authenticate the user, and check permissions for the specific resource.&lt;/p&gt;

&lt;p&gt;The language model can recommend an action, but the application must control execution.&lt;br&gt;
Problem 3: Response Times Increased Under Real Traffic&lt;br&gt;
An AI agent that responds within a few seconds during testing may become considerably slower when multiple users interact with it simultaneously.&lt;/p&gt;

&lt;p&gt;This happens because agentic workflows often involve several operations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Interpret a user request.&lt;/li&gt;
&lt;li&gt;Retrieve relevant information.&lt;/li&gt;
&lt;li&gt;Select an appropriate tool.&lt;/li&gt;
&lt;li&gt;Execute an external API call.&lt;/li&gt;
&lt;li&gt;Process the returned data.&lt;/li&gt;
&lt;li&gt;Generate a final response.
Each operation adds latency.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If an agent repeatedly calls the model or external tools, response times can grow quickly.&lt;br&gt;
What I Would Change&lt;br&gt;
I would start by measuring latency at every stage.&lt;br&gt;
import timeimport logginglogger = logging.getLogger(&lt;strong&gt;name&lt;/strong&gt;)def timed_operation(name, operation):    start = time.perf_counter()    try:        return operation()    finally:        duration = time.perf_counter() - start        logger.info(            "operation=%s duration_seconds=%.3f",            name,            duration        )&lt;/p&gt;

&lt;p&gt;This helps identify whether delays originate from model inference, database retrieval, external APIs, or application logic.&lt;/p&gt;

&lt;p&gt;For production environments, I would also introduce concurrency limits, request timeouts, safe caching, and a maximum number of agent steps.&lt;/p&gt;

&lt;p&gt;Importantly, caching should respect authorization boundaries so information retrieved for one user is not accidentally exposed to another.&lt;br&gt;
Problem 4: The Agent Produced Inconsistent Answers&lt;br&gt;
AI agents rely on probabilistic language models.&lt;/p&gt;

&lt;p&gt;Even when users submit similar requests, the generated answers may differ.&lt;/p&gt;

&lt;p&gt;This becomes particularly problematic in customer support, financial services, healthcare, or other environments where accuracy matters.&lt;/p&gt;

&lt;p&gt;For example, the agent might receive incomplete information about a customer's refund eligibility.&lt;/p&gt;

&lt;p&gt;Instead of explaining that the information is insufficient, it could generate an unsupported answer.&lt;br&gt;
What I Learned About Grounding&lt;br&gt;
For business-critical applications, agent responses should be grounded in reliable data.&lt;/p&gt;

&lt;p&gt;A retrieval-augmented generation system can help by retrieving relevant information from an approved knowledge base before producing an answer.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;However, RAG does not eliminate hallucinations automatically.&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
I would evaluate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whether the retrieved documents actually answer the question.&lt;/li&gt;
&lt;li&gt;Whether the documents are current and accessible to that user.&lt;/li&gt;
&lt;li&gt;Whether the response accurately reflects retrieved evidence.&lt;/li&gt;
&lt;li&gt;Whether the agent knows when to escalate to a human.
When sufficient information is unavailable, the agent should acknowledge uncertainty rather than manufacture an answer.
Problem 5: Local Testing Did Not Reflect Production Security
Security is another major difference between prototypes and production applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A development environment might contain test credentials, sample customer information, and unrestricted access to tools.&lt;/p&gt;

&lt;p&gt;Production systems contain real user data and potentially sensitive business information.&lt;/p&gt;

&lt;p&gt;An AI agent deployed without proper security controls may introduce risks involving prompt injection, unauthorized tool execution, credential exposure, and cross-user data leakage.&lt;/p&gt;

&lt;p&gt;For example, a malicious document retrieved by the agent might contain instructions attempting to override the system's intended behavior.&lt;/p&gt;

&lt;p&gt;Developers must treat retrieved documents, tool outputs, and user-provided content as untrusted data.&lt;/p&gt;

&lt;p&gt;A strong security strategy should include least-privilege permissions, restricted tool access, secret management, output validation, and ongoing security testing.&lt;/p&gt;

&lt;p&gt;The OWASP Top 10 for LLM Applications provides useful guidance for identifying these risks.&lt;br&gt;
The Production Readiness Checklist I Would Use&lt;br&gt;
Before deploying another AI agent, I would evaluate the following areas.&lt;br&gt;
Area    What to verify&lt;br&gt;
API reliability Timeouts, retries, error responses&lt;br&gt;
Tool execution  Permissions and confirmation requirements&lt;br&gt;
Model behavior  Accuracy and unexpected tool choices&lt;br&gt;
Retrieval   Relevant, current, authorized data&lt;br&gt;
Security    Prompt injection and data isolation&lt;br&gt;
Performance Latency, concurrency, and resource limits&lt;br&gt;
Monitoring  Logs, traces, error rates&lt;br&gt;
Cost    Model usage and tool execution expenses&lt;br&gt;
Recovery    Fallback workflows and incident handling&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Testing should include more than successful examples.&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
I would deliberately simulate unavailable APIs, incomplete responses, ambiguous requests, adversarial prompts, and concurrent users.&lt;/p&gt;

&lt;p&gt;The objective is not merely to prove that the agent can complete a task. It is to understand how it behaves when it cannot.&lt;br&gt;
What I Would Do Differently Before the Next Deployment&lt;br&gt;
The biggest change would be treating production readiness as part of development rather than a final deployment activity.&lt;/p&gt;

&lt;p&gt;I would begin with a smaller number of tools, define strict execution permissions, and use evaluation datasets representing real user behavior.&lt;/p&gt;

&lt;p&gt;I would also introduce structured observability from the beginning.&lt;/p&gt;

&lt;p&gt;Instead of logging only the final response, I would track the agent's tool decisions, execution times, failed operations, and escalation events—while minimizing the collection of sensitive information.&lt;/p&gt;

&lt;p&gt;Finally, I would use a staged rollout. A limited group of users could evaluate the system before introducing larger workloads.&lt;/p&gt;

&lt;p&gt;This approach makes failures easier to detect and reduces the impact of unexpected agent behavior.&lt;/p&gt;

&lt;p&gt;**Final Thoughts&lt;br&gt;
**Building a functional AI agent is only the beginning.&lt;/p&gt;

&lt;p&gt;The real engineering challenge is making that agent reliable, secure, observable, and predictable when it interacts with production systems.&lt;/p&gt;

&lt;p&gt;A successful demo may show what an AI agent can do. A production deployment reveals what happens when the environment stops behaving as expected.&lt;/p&gt;

&lt;p&gt;For developers working on agentic AI applications, the most important lesson is to test failure scenarios as thoroughly as successful workflows.&lt;/p&gt;

&lt;p&gt;Because the question is no longer just:&lt;br&gt;
Can my AI agent complete this task?&lt;/p&gt;

&lt;p&gt;It is:&lt;br&gt;
Can my AI agent handle the task safely and reliably when something goes wrong?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>AI-Powered Coding and the Future of Intelligent Software Development</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Fri, 13 Nov 2026 13:13:23 +0000</pubDate>
      <link>https://dev.to/aartijangid23/ai-powered-coding-and-the-future-of-intelligent-software-development-536h</link>
      <guid>https://dev.to/aartijangid23/ai-powered-coding-and-the-future-of-intelligent-software-development-536h</guid>
      <description>&lt;p&gt;Artificial Intelligence is changing how we approach software development. A few years ago, developers spent considerable time writing repetitive code, debugging errors, and searching for solutions to programming challenges. Today, AI-powered coding tools can assist with many of these tasks.&lt;/p&gt;

&lt;p&gt;From generating code snippets to explaining complex functions, AI is becoming a useful assistant in everyday development workflows.&lt;/p&gt;

&lt;p&gt;But does this mean developers no longer need strong programming skills? Absolutely not.&lt;/p&gt;

&lt;p&gt;AI can generate code, but understanding how that code works, identifying potential problems, and building reliable applications still require human expertise.&lt;/p&gt;

&lt;p&gt;Let's explore how AI is changing the coding experience and what developers should understand before adopting it.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;1. How AI Is Changing the Way Developers Write Code&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Traditional programming requires developers to understand requirements, select appropriate technologies, write code, and test the final implementation.&lt;/p&gt;

&lt;p&gt;AI introduces another layer of assistance into this process.&lt;/p&gt;

&lt;p&gt;Developers can now describe a requirement in natural language and receive code suggestions based on their instructions.&lt;/p&gt;

&lt;p&gt;For example, imagine building a simple user registration form. Instead of manually creating the initial HTML structure, a developer can ask an AI coding assistant to generate a basic form with validation.&lt;/p&gt;

&lt;p&gt;Here is a simple JavaScript example:&lt;/p&gt;

&lt;p&gt;function validateEmail(email) {&lt;br&gt;
  const emailPattern = /^[^\s@]+@[^\s@]+.[^\s@]+$/;&lt;br&gt;
  return emailPattern.test(email);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;console.log(validateEmail("&lt;a href="mailto:developer@example.com"&gt;developer@example.com&lt;/a&gt;"));&lt;/p&gt;

&lt;p&gt;An AI assistant can explain this function, suggest improvements, and generate test cases.&lt;/p&gt;

&lt;p&gt;This makes AI-assisted software development useful for speeding up repetitive programming activities.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;2. AI Code Generation Saves Development Time&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
One of the most useful applications of AI in programming is automatic code generation.&lt;/p&gt;

&lt;p&gt;Developers frequently work with repetitive components, functions, API structures, and database queries. AI coding assistants can generate initial implementations based on clear instructions.&lt;/p&gt;

&lt;p&gt;For example, when developing an application, developers may need:&lt;/p&gt;

&lt;p&gt;User authentication functionality.&lt;/p&gt;

&lt;p&gt;Reusable UI components.&lt;/p&gt;

&lt;p&gt;API request handlers.&lt;/p&gt;

&lt;p&gt;Database query structures.&lt;/p&gt;

&lt;p&gt;Form validation logic.&lt;/p&gt;

&lt;p&gt;Basic testing functions.&lt;/p&gt;

&lt;p&gt;AI can generate a starting point for these features, allowing developers to focus more on application architecture and business logic.&lt;/p&gt;

&lt;p&gt;However, generated code should always be reviewed before being used in production.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;3. Debugging Becomes Easier With AI&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Every developer encounters bugs. Sometimes, finding the reason behind an error takes longer than writing the original code.&lt;/p&gt;

&lt;p&gt;AI-powered debugging tools can help developers understand error messages, identify possible causes, and explore alternative solutions.&lt;/p&gt;

&lt;p&gt;Consider a JavaScript error caused by accessing a property of an undefined object.&lt;/p&gt;

&lt;p&gt;A developer can provide the relevant code and error message to an AI assistant. The tool may explain why the variable is undefined and suggest adding appropriate checks.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;const user = null;&lt;/p&gt;

&lt;p&gt;if (user &amp;amp;&amp;amp; user.name) {&lt;br&gt;
  console.log(user.name);&lt;br&gt;
} else {&lt;br&gt;
  console.log("User information is unavailable");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;This example demonstrates a basic way to prevent an error when accessing missing user information.&lt;/p&gt;

&lt;p&gt;AI can help identify these issues, but developers should still reproduce the problem and verify the suggested fix.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;4. Popular AI Tools Developers Can Explore&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Several tools are making AI-assisted programming more accessible.&lt;/p&gt;

&lt;p&gt;GitHub Copilot&lt;/p&gt;

&lt;p&gt;GitHub Copilot provides AI-powered code completion and suggestions. It can help developers write functions, generate code, and work more efficiently within supported development environments.&lt;/p&gt;

&lt;p&gt;Cursor&lt;/p&gt;

&lt;p&gt;Cursor is an AI-focused code editor that helps developers understand existing codebases, generate code, and make changes across multiple files.&lt;/p&gt;

&lt;p&gt;ChatGPT&lt;/p&gt;

&lt;p&gt;ChatGPT can assist with programming explanations, debugging, code generation, documentation, and learning new technologies.&lt;/p&gt;

&lt;p&gt;Claude&lt;/p&gt;

&lt;p&gt;Claude can help developers analyze code, understand complex programming logic, discuss architecture, and explore potential solutions.&lt;/p&gt;

&lt;p&gt;Each tool has different strengths. Choosing the right one depends on the programming language, project complexity, workflow, and security requirements.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;5. Can AI Improve Code Quality?&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Writing code quickly does not automatically mean writing good code.&lt;/p&gt;

&lt;p&gt;Professional software development also requires readable, maintainable, scalable, and secure implementations.&lt;/p&gt;

&lt;p&gt;AI tools can help developers identify duplicated logic, suggest simpler implementations, explain complex functions, and improve code readability.&lt;/p&gt;

&lt;p&gt;For example, developers can ask an AI assistant to review a function and identify opportunities for optimization.&lt;/p&gt;

&lt;p&gt;However, AI recommendations are not always correct. Developers must evaluate whether a suggested change actually improves performance without affecting existing functionality.&lt;/p&gt;

&lt;p&gt;Combining AI assistance with code reviews, automated testing, and established development standards is a better approach.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;6. The Challenges of AI-Powered Coding&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Although AI offers several advantages, developers should understand its limitations.&lt;/p&gt;

&lt;p&gt;Incorrect Suggestions: AI can generate code that looks correct but does not meet the actual project requirements.&lt;/p&gt;

&lt;p&gt;Security Risks: Generated code may contain insecure practices or introduce vulnerabilities.&lt;/p&gt;

&lt;p&gt;Overdependence: Depending entirely on AI can reduce opportunities to develop independent programming and problem-solving skills.&lt;/p&gt;

&lt;p&gt;Project Complexity: AI may misunderstand large codebases, existing architecture, or complicated business requirements.&lt;/p&gt;

&lt;p&gt;Outdated Information: Some suggestions may use outdated libraries, functions, or development practices.&lt;/p&gt;

&lt;p&gt;The best approach is to use AI as an assistant while maintaining control over technical decisions.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;7. How Developers Can Use AI More Effectively&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Getting useful results from AI coding tools depends heavily on the instructions provided.&lt;/p&gt;

&lt;p&gt;Instead of asking an AI tool to build an entire application without context, developers should break requirements into smaller tasks.&lt;/p&gt;

&lt;p&gt;Here are some practical recommendations:&lt;/p&gt;

&lt;p&gt;Provide clear programming requirements and expected outputs.&lt;/p&gt;

&lt;p&gt;Mention the programming language and framework.&lt;/p&gt;

&lt;p&gt;Share relevant error messages when requesting debugging help.&lt;/p&gt;

&lt;p&gt;Ask for explanations instead of copying code blindly.&lt;/p&gt;

&lt;p&gt;Review generated code before integrating it.&lt;/p&gt;

&lt;p&gt;Test important functionality before deployment.&lt;/p&gt;

&lt;p&gt;Avoid sharing confidential project information with unapproved AI tools.&lt;/p&gt;

&lt;p&gt;These practices help developers get more meaningful results from AI-assisted coding.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;8. What Does the Future Hold for AI and Software Development?&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
AI coding capabilities are continuing to evolve. Modern development workflows are moving beyond simple code completion toward AI agents that can analyze repositories, modify multiple files, execute tests, and assist with more complex engineering tasks.&lt;/p&gt;

&lt;p&gt;This creates opportunities for developers to spend less time on repetitive work and more time solving meaningful technical problems.&lt;/p&gt;

&lt;p&gt;However, software engineering fundamentals will remain important.&lt;/p&gt;

&lt;p&gt;Understanding data structures, algorithms, system architecture, databases, APIs, and application security will help developers evaluate AI-generated solutions more effectively.&lt;/p&gt;

&lt;p&gt;The developers who benefit most from AI will likely be those who combine technical knowledge with the ability to use intelligent tools responsibly.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Final Thoughts&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
AI-powered coding is changing the software development process by making code generation, debugging, testing, and documentation more accessible.&lt;/p&gt;

&lt;p&gt;Tools like GitHub Copilot, Cursor, ChatGPT, and Claude can support developers throughout different stages of a project.&lt;/p&gt;

&lt;p&gt;But AI is not a replacement for understanding programming logic or making sound engineering decisions.&lt;/p&gt;

&lt;p&gt;The real opportunity is to combine human creativity, technical expertise, and AI capabilities to build better software.&lt;/p&gt;

&lt;p&gt;As a developer, learning how to work with AI today can help you become more adaptable and prepared for the next generation of software engineering.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>coding</category>
    </item>
    <item>
      <title>We hardcoded a gas limit. It was fine until it wasn’t.</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Thu, 12 Nov 2026 11:50:17 +0000</pubDate>
      <link>https://dev.to/aartijangid23/we-hardcoded-a-gas-limit-it-was-fine-until-it-wasnt-kl7</link>
      <guid>https://dev.to/aartijangid23/we-hardcoded-a-gas-limit-it-was-fine-until-it-wasnt-kl7</guid>
      <description>&lt;p&gt;The withdrawal function shipped eleven months ago. Thousands of successful withdrawals. Then one user could not withdraw, ever, and no amount of retrying helped.&lt;/p&gt;

&lt;p&gt;Here is roughly what we had:&lt;/p&gt;

&lt;p&gt;solidity&lt;br&gt;
function withdraw() external {&lt;br&gt;
    uint256 amount = balances[msg.sender];&lt;br&gt;
    require(amount &amp;gt; 0, "nothing to withdraw");&lt;br&gt;
    balances[msg.sender] = 0;&lt;br&gt;
    payable(msg.sender).transfer(amount);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;If you have been writing Solidity for a while you already know where this goes. I knew about the 2300 gas stipend. I had read about it. I had simply never had it bite me, which is a different thing from understanding it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What actually happened&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;transfer() forwards a fixed 2300 gas stipend to the recipient. That is enough for an externally owned account to receive ether and nothing more. It is deliberately small, originally as reentrancy protection.&lt;/p&gt;

&lt;p&gt;Our user was withdrawing to a smart contract wallet. A multisig. Its receive() function does real work: it reads storage, emits an event, maybe updates a nonce. That costs considerably more than 2300 gas.&lt;/p&gt;

&lt;p&gt;So the receive reverted. And because transfer() bubbles the revert up, the entire withdrawal reverted. The user’s balance was never actually zeroed, which was the one piece of luck in the whole thing, but from their side the function was simply broken with no explanation.&lt;/p&gt;

&lt;p&gt;The error message they saw was useless. Just a failed transaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The part that made me uncomfortable&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This code had worked for eleven months. Nothing in our contract changed. Nothing in our deployment changed. What changed was the kind of wallet people were using.&lt;/p&gt;

&lt;p&gt;Smart contract wallets have gone from rare to ordinary. With account abstraction, a growing share of addresses are contracts with non-trivial receive logic. Our assumption was not that recipients would be EOAs. We never made an assumption at all, which is worse, because an assumption you have written down can be reviewed.&lt;/p&gt;

&lt;p&gt;The same class of problem has happened at protocol level. EIP-1884 in the Istanbul fork raised the gas cost of SLOAD from 200 to 800, and contracts whose receive logic fit inside the 2300 stipend before the fork no longer did afterwards. Working code broke without anybody deploying anything. That is the thing to sit with: gas costs are not a property of your contract, they are a property of the chain, and the chain changes.&lt;/p&gt;

&lt;p&gt;The fix we tried first, which was also wrong&lt;br&gt;
solidity&lt;br&gt;
(bool ok, ) = payable(msg.sender).call{value: amount, gas: 50000}("");&lt;br&gt;
require(ok, "transfer failed");&lt;/p&gt;

&lt;p&gt;More headroom. Handles the multisig. Ship it.&lt;/p&gt;

&lt;p&gt;This is the same bug with a bigger number. Some wallet, somewhere, has a receive path costing more than 50,000 gas, and when that user arrives we are back here. I had not fixed the problem, I had moved the threshold and bought myself some time.&lt;/p&gt;

&lt;p&gt;There is also a subtlety that makes precise gas forwarding harder than it looks. Under EIP-150, a call can forward at most 63/64 of the remaining gas. So even when you name a figure, what the callee receives depends on the gas remaining at that moment in the transaction. You are not controlling what you think you are controlling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What we actually did&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Forward all available gas, and handle reentrancy properly rather than relying on a gas limit to do it:&lt;/p&gt;

&lt;p&gt;solidity&lt;br&gt;
function withdraw() external nonReentrant {&lt;br&gt;
    uint256 amount = balances[msg.sender];&lt;br&gt;
    require(amount &amp;gt; 0, "nothing to withdraw");&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;balances[msg.sender] = 0;                  // state change before the call

(bool ok, ) = msg.sender.call{value: amount}("");
require(ok, "transfer failed");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Three things matter here and the gas limit is not one of them.&lt;/p&gt;

&lt;p&gt;State is updated before the external call. Checks, effects, interactions. The balance is zero before control leaves the contract, so a reentrant call finds nothing to withdraw.&lt;/p&gt;

&lt;p&gt;An explicit reentrancy guard. The 2300 stipend was never a real security control, it was a side effect that people treated as one. Use a guard and know it is there.&lt;/p&gt;

&lt;p&gt;The call is allowed the gas it needs. If the recipient’s receive logic is expensive, that is the recipient spending the caller’s gas, which is correct. They pay for their own wallet’s complexity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The off-chain half of the same mistake&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While fixing the contract I went looking in the frontend, and found the sibling bug:&lt;/p&gt;

&lt;p&gt;js&lt;br&gt;
const tx = await contract.withdraw({ gasLimit: 200000 });&lt;/p&gt;

&lt;p&gt;Someone had hardcoded this, almost certainly after hitting an estimation failure once and working around it.&lt;/p&gt;

&lt;p&gt;This breaks on a code path nobody tested. A first-time storage write costs far more than an update, because setting a zero slot to non-zero is a different opcode price from changing an existing value. Under EIP-2929, cold storage and account access cost more than warm access within the same transaction. So the same function can cost very different amounts depending on whether this user has interacted before.&lt;/p&gt;

&lt;p&gt;Estimate it instead, with a buffer, and handle the failure honestly:&lt;/p&gt;

&lt;p&gt;js&lt;br&gt;
let gasLimit;&lt;br&gt;
try {&lt;br&gt;
  const est = await contract.withdraw.estimateGas();&lt;br&gt;
  gasLimit = (est * 120n) / 100n;              // 20% headroom&lt;br&gt;
} catch (err) {&lt;br&gt;
  // estimation reverted: the call would fail. Surface it, do not paper over it.&lt;br&gt;
  throw new Error(&lt;code&gt;withdraw would revert: ${err.shortMessage ?? err.message}&lt;/code&gt;);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;const tx = await contract.withdraw({ gasLimit });&lt;/p&gt;

&lt;p&gt;The buffer matters because estimation runs against current state, and state can change between your estimate and your execution. Someone else’s transaction lands first, a cold slot becomes warm or the reverse, and your tight estimate is no longer enough.&lt;/p&gt;

&lt;p&gt;And when estimation reverts, that is information. It means the transaction would fail. Replacing it with a hardcoded limit converts a clear error into a user paying gas to watch their transaction fail on chain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I take from it&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Any gas number you type by hand is a guess about the future, and the future includes wallets that do not exist yet and forks that reprice opcodes you are not thinking about.&lt;/p&gt;

&lt;p&gt;Two rules I now apply without exception. Never hardcode gas for an external call in a contract; use a reentrancy guard and let the recipient spend what they need. Never hardcode a gas limit off chain; estimate with a buffer, and let estimation failures surface as errors rather than hiding them.&lt;/p&gt;

&lt;p&gt;The uncomfortable part is not that we got it wrong. It is that it worked for eleven months, which meant nothing was telling us we were wrong. If your contract makes value transfers, go and look at how you do it now, before a user with an unusual wallet looks for you.&lt;/p&gt;

&lt;p&gt;Has anyone handled this differently? I am particularly interested in how people deal with recipients whose receive logic is expensive enough to make a withdrawal uneconomical for them, since “let them spend their own gas” works until the gas exceeds the amount being withdrawn.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>programming</category>
      <category>hardcoded</category>
    </item>
    <item>
      <title>10 Common API Security Mistakes Developers Should Avoid</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Fri, 06 Nov 2026 11:12:39 +0000</pubDate>
      <link>https://dev.to/aartijangid23/10-common-api-security-mistakes-developers-should-avoid-p18</link>
      <guid>https://dev.to/aartijangid23/10-common-api-security-mistakes-developers-should-avoid-p18</guid>
      <description>&lt;p&gt;APIs are the backbone of modern web and mobile applications. They connect frontend interfaces with backend services, exchange data between platforms, and support essential features such as user authentication, online payments, notifications, and third-party integrations.&lt;/p&gt;

&lt;p&gt;However, every API endpoint can also become a potential entry point for attackers if it is not properly secured. Even a small configuration mistake can expose sensitive user information, compromise accounts, or disrupt application functionality.&lt;/p&gt;

&lt;p&gt;For backend engineers, frontend developers, and mobile developers, understanding common API security mistakes is essential for building reliable applications.&lt;/p&gt;

&lt;p&gt;Let's explore ten API security mistakes developers should avoid and the practical steps to prevent them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Weak Authentication Mechanisms&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Authentication verifies who is making an API request. A weak authentication system can allow attackers to access accounts without proper verification.&lt;/p&gt;

&lt;p&gt;Common mistakes include using predictable passwords, accepting invalid tokens, and implementing authentication without sufficient protection against repeated login attempts.&lt;/p&gt;

&lt;p&gt;How to avoid it:&lt;/p&gt;

&lt;p&gt;Use secure authentication protocols such as OAuth 2.0 or OpenID Connect where appropriate.&lt;/p&gt;

&lt;p&gt;Implement multi-factor authentication for sensitive operations.&lt;/p&gt;

&lt;p&gt;Set appropriate token expiration periods.&lt;/p&gt;

&lt;p&gt;Use secure password hashing algorithms such as Argon2 or bcrypt.&lt;/p&gt;

&lt;p&gt;Add login attempt limits and monitoring.&lt;/p&gt;

&lt;p&gt;Authentication should be treated as a core part of API security, not an optional feature.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Ignoring Authorization Checks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Authentication confirms a user's identity, but authorization determines what that user can access.&lt;/p&gt;

&lt;p&gt;For example, imagine an application where users can view their invoices through an endpoint such as:&lt;/p&gt;

&lt;p&gt;GET /api/invoices/102&lt;/p&gt;

&lt;p&gt;If the backend only checks whether the user is logged in, someone might change the invoice ID and access another customer's information.&lt;/p&gt;

&lt;p&gt;This vulnerability is known as Broken Object Level Authorization (BOLA), one of the major risks identified by OWASP.&lt;/p&gt;

&lt;p&gt;How to avoid it:&lt;/p&gt;

&lt;p&gt;Verify resource ownership on every relevant request.&lt;/p&gt;

&lt;p&gt;Apply role-based or attribute-based access controls.&lt;/p&gt;

&lt;p&gt;Never trust object IDs received from the client.&lt;/p&gt;

&lt;p&gt;Test access permissions using different user accounts.&lt;/p&gt;

&lt;p&gt;Authorization checks must happen on the server, even when the frontend already hides restricted options.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Exposing Sensitive Information in API Responses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Returning unnecessary information is another common API security mistake.&lt;/p&gt;

&lt;p&gt;For instance, a profile endpoint might return a user's name and email along with internal account identifiers, password hashes, private permissions, or other sensitive fields.&lt;/p&gt;

&lt;p&gt;Even if the frontend does not display these values, anyone inspecting the API response may still see them.&lt;/p&gt;

&lt;p&gt;How to avoid it:&lt;/p&gt;

&lt;p&gt;Return only the fields required by the application.&lt;/p&gt;

&lt;p&gt;Use response schemas or data transfer objects (DTOs).&lt;/p&gt;

&lt;p&gt;Remove passwords, private tokens, and internal system details from responses.&lt;/p&gt;

&lt;p&gt;Review API responses during security testing.&lt;/p&gt;

&lt;p&gt;A useful rule is simple: if the client does not need the information, do not send it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Storing API Keys and Secrets in Frontend Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Developers sometimes place API keys directly inside JavaScript files, mobile application code, or public repositories to simplify integration.&lt;/p&gt;

&lt;p&gt;This creates a serious security risk because client-side code can be inspected, downloaded, or reverse-engineered.&lt;/p&gt;

&lt;p&gt;For mobile developers, storing long-lived private API credentials inside an application package is particularly risky. Obfuscation can make extraction harder, but it cannot guarantee secrecy.&lt;/p&gt;

&lt;p&gt;How to avoid it:&lt;/p&gt;

&lt;p&gt;Store private credentials in backend environment variables or a secrets manager.&lt;/p&gt;

&lt;p&gt;Keep sensitive third-party API calls on the server.&lt;/p&gt;

&lt;p&gt;Rotate exposed credentials immediately.&lt;/p&gt;

&lt;p&gt;Use restricted, short-lived credentials when supported.&lt;/p&gt;

&lt;p&gt;Avoid committing .env files to public repositories.&lt;/p&gt;

&lt;p&gt;Remember that anything shipped to a client should be considered potentially accessible to users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Missing Rate Limiting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Without request limits, attackers can send excessive API requests to overload a service, abuse business functionality, or increase infrastructure costs.&lt;/p&gt;

&lt;p&gt;For example, an unprotected OTP endpoint could allow automated scripts to trigger thousands of SMS messages.&lt;/p&gt;

&lt;p&gt;This can lead to service disruption and unexpected expenses.&lt;/p&gt;

&lt;p&gt;How to avoid it:&lt;/p&gt;

&lt;p&gt;Apply rate limits to login, registration, OTP, and payment endpoints.&lt;/p&gt;

&lt;p&gt;Set request quotas based on users, IP addresses, or API keys.&lt;/p&gt;

&lt;p&gt;Add CAPTCHA or additional verification for suspicious activity.&lt;/p&gt;

&lt;p&gt;Monitor unusual traffic patterns.&lt;/p&gt;

&lt;p&gt;Apply request-size and execution-time limits.&lt;/p&gt;

&lt;p&gt;Rate limiting is an important part of API protection and resource management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Incorrect CORS Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cross-Origin Resource Sharing (CORS) controls which browser-based origins can access resources on a server.&lt;/p&gt;

&lt;p&gt;A common mistake is allowing every origin without understanding the security implications.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;app.use(cors({&lt;br&gt;
  origin: "*"&lt;br&gt;
}));&lt;/p&gt;

&lt;p&gt;This may be acceptable for some public APIs, but it is not an appropriate default for every application, especially when sensitive data or credentialed requests are involved.&lt;/p&gt;

&lt;p&gt;How to avoid it:&lt;/p&gt;

&lt;p&gt;Allow only trusted origins when access needs to be restricted.&lt;/p&gt;

&lt;p&gt;Configure credentialed requests carefully.&lt;/p&gt;

&lt;p&gt;Avoid combining wildcard origins with credentials.&lt;/p&gt;

&lt;p&gt;Remember that CORS is not a replacement for authentication or authorization.&lt;/p&gt;

&lt;p&gt;A correctly configured CORS policy helps control browser access, but it does not stop direct API requests from other clients.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Not Validating User Input&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;APIs frequently receive data through query parameters, request bodies, headers, and uploaded files. Accepting this input without proper validation can expose applications to injection attacks and unexpected behavior.&lt;/p&gt;

&lt;p&gt;For example, an endpoint that directly inserts user-provided values into a database query may become vulnerable to SQL injection.&lt;/p&gt;

&lt;p&gt;How to avoid it:&lt;/p&gt;

&lt;p&gt;Validate input against expected data types and formats.&lt;/p&gt;

&lt;p&gt;Use parameterized database queries.&lt;/p&gt;

&lt;p&gt;Sanitize data where appropriate for its intended use.&lt;/p&gt;

&lt;p&gt;Set limits on uploaded file types and sizes.&lt;/p&gt;

&lt;p&gt;Reject unexpected fields instead of blindly accepting them.&lt;/p&gt;

&lt;p&gt;Input validation should happen on the backend, even if the frontend already checks the submitted data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Using Outdated API Versions and Dependencies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Old API versions and unpatched dependencies can contain known security vulnerabilities. Developers sometimes forget to remove outdated endpoints after releasing a newer version.&lt;/p&gt;

&lt;p&gt;For example, an application may use /api/v2 while an older /api/v1 endpoint remains publicly accessible with weaker authorization controls.&lt;/p&gt;

&lt;p&gt;How to avoid it:&lt;/p&gt;

&lt;p&gt;Maintain an inventory of active API endpoints.&lt;/p&gt;

&lt;p&gt;Remove deprecated routes when they are no longer required.&lt;/p&gt;

&lt;p&gt;Regularly update frameworks and dependencies.&lt;/p&gt;

&lt;p&gt;Scan packages for known vulnerabilities.&lt;/p&gt;

&lt;p&gt;Review API documentation and versioning policies.&lt;/p&gt;

&lt;p&gt;Keeping APIs updated reduces exposure to preventable security issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Trusting Third-Party API Responses Without Validation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modern applications depend on external services for payments, maps, analytics, messaging, and AI-powered features.&lt;/p&gt;

&lt;p&gt;However, developers sometimes assume that every response from an external API is safe and correctly formatted.&lt;/p&gt;

&lt;p&gt;Unexpected data, compromised integrations, or incorrect responses can affect application behavior.&lt;/p&gt;

&lt;p&gt;How to avoid it:&lt;/p&gt;

&lt;p&gt;Validate third-party responses before processing them.&lt;/p&gt;

&lt;p&gt;Verify webhook signatures where supported.&lt;/p&gt;

&lt;p&gt;Set request timeouts and handle failures safely.&lt;/p&gt;

&lt;p&gt;Avoid exposing internal credentials to external services.&lt;/p&gt;

&lt;p&gt;Use trusted providers and monitor integration behavior.&lt;/p&gt;

&lt;p&gt;Secure API integration requires validating both incoming requests and external responses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Ignoring API Logs and Security Monitoring&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Even well-designed APIs can experience suspicious activity. Without proper logging and monitoring, developers may not notice repeated failed logins, unusual traffic, or unauthorized access attempts.&lt;/p&gt;

&lt;p&gt;Logging too much information can also create problems if passwords, access tokens, or personal data are recorded.&lt;/p&gt;

&lt;p&gt;How to avoid it:&lt;/p&gt;

&lt;p&gt;Log authentication failures and unusual access patterns.&lt;/p&gt;

&lt;p&gt;Monitor API errors and traffic spikes.&lt;/p&gt;

&lt;p&gt;Never log passwords, private keys, or complete access tokens.&lt;/p&gt;

&lt;p&gt;Use alerts for suspicious activity.&lt;/p&gt;

&lt;p&gt;Establish an incident response process.&lt;/p&gt;

&lt;p&gt;Monitoring helps development teams detect security problems earlier and investigate incidents more effectively.&lt;/p&gt;

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

&lt;p&gt;API security is not a one-time development task. It requires continuous attention throughout the application lifecycle, from initial architecture and coding to deployment, monitoring, and maintenance.&lt;/p&gt;

&lt;p&gt;Whether you are building a web platform, enterprise solution, or mobile application, avoiding these ten mistakes can significantly reduce common security risks.&lt;/p&gt;

&lt;p&gt;Developers should regularly review their authentication systems, authorization rules, input validation, API configurations, and third-party integrations. Following established security guidance, including the OWASP API Security Top 10, can also help teams identify weaknesses before attackers exploit them.&lt;/p&gt;

&lt;p&gt;A secure API does more than protect backend infrastructure. It builds user trust, protects business data, and creates a stronger foundation for scalable applications.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Why AI-Powered Applications Need More Than Just an API Connection</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Tue, 03 Nov 2026 07:26:26 +0000</pubDate>
      <link>https://dev.to/aartijangid23/why-ai-powered-applications-need-more-than-just-an-api-connection-1e0n</link>
      <guid>https://dev.to/aartijangid23/why-ai-powered-applications-need-more-than-just-an-api-connection-1e0n</guid>
      <description>&lt;p&gt;Adding artificial intelligence to an application may look simple at first. A developer connects an AI API, sends a prompt, receives a response, and displays the result on the frontend.&lt;/p&gt;

&lt;p&gt;But what happens when hundreds of users start sending requests simultaneously? What if the AI service becomes unavailable? How do you protect sensitive user information, control API costs, and ensure that generated responses are reliable?&lt;/p&gt;

&lt;p&gt;These challenges show why building an AI-powered application requires more than just connecting an API.&lt;/p&gt;

&lt;p&gt;Successful AI integration involves backend architecture, data management, security, performance optimization, error handling, and continuous monitoring.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore the important components developers should consider when integrating AI into modern applications, along with practical Node.js examples.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;API Integration Is Only the Starting Point&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;An AI API provides access to a model's capabilities, but it does not automatically handle every requirement of your application.&lt;/p&gt;

&lt;p&gt;For example, imagine you are developing an AI-powered customer support application.&lt;/p&gt;

&lt;p&gt;The application needs to:&lt;/p&gt;

&lt;p&gt;Receive customer questions.&lt;/p&gt;

&lt;p&gt;Authenticate users.&lt;/p&gt;

&lt;p&gt;Retrieve relevant customer information.&lt;/p&gt;

&lt;p&gt;Send appropriate context to an AI model.&lt;/p&gt;

&lt;p&gt;Process generated responses.&lt;/p&gt;

&lt;p&gt;Store conversation history.&lt;/p&gt;

&lt;p&gt;Handle API failures.&lt;/p&gt;

&lt;p&gt;Return responses securely.&lt;/p&gt;

&lt;p&gt;An API connection handles only part of this workflow.&lt;/p&gt;

&lt;p&gt;A more complete architecture looks like this:&lt;/p&gt;

&lt;p&gt;User Interface&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
Backend Application&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
Authentication &amp;amp; Validation&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
Business Logic&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
AI Integration Layer&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
External AI API&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
Response Processing&lt;br&gt;
      |&lt;br&gt;
      v&lt;br&gt;
Database / Frontend&lt;/p&gt;

&lt;p&gt;This separation makes the application easier to maintain, test, and scale.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Secure API Communication and Credential Management&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Security is one of the first considerations in AI integration.&lt;/p&gt;

&lt;p&gt;A common mistake is placing an AI API key directly inside frontend JavaScript. Anyone who can inspect the browser's network requests or bundled code may be able to access exposed credentials.&lt;/p&gt;

&lt;p&gt;A better approach is to keep API communication on the backend.&lt;/p&gt;

&lt;p&gt;Example: Secure OpenAI API Integration With Node.js&lt;/p&gt;

&lt;p&gt;First, install the required packages:&lt;/p&gt;

&lt;p&gt;npm install express openai dotenv&lt;/p&gt;

&lt;p&gt;Create a .env file:&lt;/p&gt;

&lt;p&gt;OPENAI_API_KEY=your_api_key&lt;br&gt;
OPENAI_MODEL=your_supported_model&lt;br&gt;
PORT=3000&lt;/p&gt;

&lt;p&gt;Add .env to .gitignore:&lt;/p&gt;

&lt;p&gt;node_modules/&lt;br&gt;
.env&lt;/p&gt;

&lt;p&gt;Now create server.js:&lt;/p&gt;

&lt;p&gt;require("dotenv").config();&lt;/p&gt;

&lt;p&gt;const express = require("express");&lt;br&gt;
const OpenAI = require("openai");&lt;/p&gt;

&lt;p&gt;const app = express();&lt;/p&gt;

&lt;p&gt;app.use(express.json({ limit: "20kb" }));&lt;/p&gt;

&lt;p&gt;const openai = new OpenAI({&lt;br&gt;
  apiKey: process.env.OPENAI_API_KEY,&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;app.post("/api/ai", async (req, res) =&amp;gt; {&lt;br&gt;
  try {&lt;br&gt;
    const { message } = req.body;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (typeof message !== "string" || !message.trim()) {
  return res.status(400).json({
    error: "A valid message is required",
  });
}

const response = await openai.responses.create({
  model: process.env.OPENAI_MODEL,
  input: message.trim(),
  max_output_tokens: 300,
});

res.json({
  result: response.output_text,
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;} catch (error) {&lt;br&gt;
    console.error("AI API error:", error.message);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;res.status(500).json({
  error: "Unable to process your request",
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;app.listen(process.env.PORT || 3000, () =&amp;gt; {&lt;br&gt;
  console.log("AI application running");&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;Why Is This Approach Better?&lt;/p&gt;

&lt;p&gt;API credentials remain on the server.&lt;/p&gt;

&lt;p&gt;The backend controls communication with the AI provider.&lt;/p&gt;

&lt;p&gt;Input validation happens before external requests.&lt;/p&gt;

&lt;p&gt;Error handling can be managed centrally.&lt;/p&gt;

&lt;p&gt;Additional security and usage restrictions can be introduced.&lt;/p&gt;

&lt;p&gt;For production applications, also add authentication, rate limiting, request logging, and appropriate access controls.&lt;/p&gt;

&lt;p&gt;You can explore the official OpenAI API documentation for more integration details.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Context and Data Management Matter&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;An AI model cannot automatically understand every business detail stored in your application.&lt;/p&gt;

&lt;p&gt;For example, consider an online shopping platform. A customer asks:&lt;/p&gt;

&lt;p&gt;"Is my order arriving tomorrow?"&lt;/p&gt;

&lt;p&gt;The AI model cannot answer accurately unless the application provides relevant order information.&lt;/p&gt;

&lt;p&gt;This is where backend data integration becomes important.&lt;/p&gt;

&lt;p&gt;The application should:&lt;/p&gt;

&lt;p&gt;Identify the authenticated customer.&lt;/p&gt;

&lt;p&gt;Retrieve the customer's order information.&lt;/p&gt;

&lt;p&gt;Validate whether the customer can access that information.&lt;/p&gt;

&lt;p&gt;Provide the relevant context to the AI model.&lt;/p&gt;

&lt;p&gt;Generate an answer based on the supplied information.&lt;/p&gt;

&lt;p&gt;Understanding Retrieval-Augmented Generation&lt;/p&gt;

&lt;p&gt;Retrieval-Augmented Generation (RAG) is one approach to connecting AI models with external information.&lt;/p&gt;

&lt;p&gt;A typical RAG workflow includes:&lt;/p&gt;

&lt;p&gt;Collecting documents and business data.&lt;/p&gt;

&lt;p&gt;Converting content into vector embeddings.&lt;/p&gt;

&lt;p&gt;Storing embeddings in a vector database.&lt;/p&gt;

&lt;p&gt;Retrieving relevant information based on user queries.&lt;/p&gt;

&lt;p&gt;Sending the retrieved context to the AI model.&lt;/p&gt;

&lt;p&gt;Generating a context-aware response.&lt;/p&gt;

&lt;p&gt;RAG is particularly useful for:&lt;/p&gt;

&lt;p&gt;Enterprise knowledge assistants.&lt;/p&gt;

&lt;p&gt;Customer support chatbots.&lt;/p&gt;

&lt;p&gt;Document search applications.&lt;/p&gt;

&lt;p&gt;Internal business information systems.&lt;/p&gt;

&lt;p&gt;Product recommendation and information tools.&lt;/p&gt;

&lt;p&gt;However, retrieval permissions must be enforced by the backend. Retrieved documents should not expose information that the requesting user is not authorized to access.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Error Handling and API Reliability&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;External AI services can experience temporary failures, rate limits, timeouts, and service interruptions.&lt;/p&gt;

&lt;p&gt;If your application does not handle these situations properly, users may experience failed requests or unexpected behavior.&lt;/p&gt;

&lt;p&gt;For example, an AI service might return a 429 response when the application exceeds an applicable rate limit.&lt;/p&gt;

&lt;p&gt;Common API Errors&lt;/p&gt;

&lt;p&gt;Error&lt;/p&gt;

&lt;p&gt;Possible Reason&lt;/p&gt;

&lt;p&gt;Recommended Action&lt;/p&gt;

&lt;p&gt;400&lt;/p&gt;

&lt;p&gt;Invalid request&lt;/p&gt;

&lt;p&gt;Validate request data&lt;/p&gt;

&lt;p&gt;401&lt;/p&gt;

&lt;p&gt;Authentication problem&lt;/p&gt;

&lt;p&gt;Verify API credentials&lt;/p&gt;

&lt;p&gt;429&lt;/p&gt;

&lt;p&gt;Rate limit reached&lt;/p&gt;

&lt;p&gt;Follow retry guidance&lt;/p&gt;

&lt;p&gt;500&lt;/p&gt;

&lt;p&gt;Server-side error&lt;/p&gt;

&lt;p&gt;Log and handle failure&lt;/p&gt;

&lt;p&gt;503&lt;/p&gt;

&lt;p&gt;Temporary service overload&lt;/p&gt;

&lt;p&gt;Retry with controlled backoff&lt;/p&gt;

&lt;p&gt;Example: Handling API Failures&lt;/p&gt;

&lt;p&gt;async function generateAIResponse(message) {&lt;br&gt;
  try {&lt;br&gt;
    const response = await openai.responses.create({&lt;br&gt;
      model: process.env.OPENAI_MODEL,&lt;br&gt;
      input: message,&lt;br&gt;
      max_output_tokens: 300,&lt;br&gt;
    });&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return response.output_text;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;} catch (error) {&lt;br&gt;
    console.error("AI request failed:", error.message);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (error.status === 429) {
  throw new Error("AI service is temporarily rate limited.");
}

if (error.status === 503) {
  throw new Error("AI service is temporarily unavailable.");
}

throw new Error("Unable to generate an AI response.");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;This example provides basic error classification. In a production system, you should also configure request timeouts, controlled retries, and fallback behavior.&lt;/p&gt;

&lt;p&gt;Important: Do not retry every error automatically. Authentication, billing, invalid-request, and quota errors require different actions from temporary rate limits.&lt;/p&gt;

&lt;p&gt;For more information, see the OpenAI API rate limits guide.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Performance Optimization and Response Time&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AI-powered applications can become slow when every user request requires multiple database queries, external API calls, and large amounts of context.&lt;/p&gt;

&lt;p&gt;Developers should optimize the complete request flow rather than focusing only on the AI model.&lt;/p&gt;

&lt;p&gt;Some useful techniques include:&lt;/p&gt;

&lt;p&gt;Prompt optimization: Remove unnecessary instructions and repeated information to reduce input size.&lt;/p&gt;

&lt;p&gt;Caching: Store reusable results when the request and data are suitable for caching.&lt;/p&gt;

&lt;p&gt;Streaming responses: Display generated content progressively instead of waiting for the complete response.&lt;/p&gt;

&lt;p&gt;Asynchronous processing: Move long-running tasks into background workers.&lt;/p&gt;

&lt;p&gt;Model selection: Choose a model based on the complexity, speed, and cost requirements of each task.&lt;/p&gt;

&lt;p&gt;For example, an application might use a faster model for simple classification tasks and a more capable model for complex reasoning.&lt;/p&gt;

&lt;p&gt;These decisions can improve the overall user experience while helping control infrastructure costs.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cost Management and Usage Monitoring&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AI API usage can increase quickly when an application starts receiving more traffic.&lt;/p&gt;

&lt;p&gt;Every request may consume input and output tokens, and costs can vary depending on the model and usage.&lt;/p&gt;

&lt;p&gt;Without monitoring, developers may struggle to understand why their AI application is becoming expensive.&lt;/p&gt;

&lt;p&gt;What Should You Monitor?&lt;/p&gt;

&lt;p&gt;Metric&lt;/p&gt;

&lt;p&gt;Why It Matters&lt;/p&gt;

&lt;p&gt;API requests&lt;/p&gt;

&lt;p&gt;Tracks application usage&lt;/p&gt;

&lt;p&gt;Input tokens&lt;/p&gt;

&lt;p&gt;Measures prompt consumption&lt;/p&gt;

&lt;p&gt;Output tokens&lt;/p&gt;

&lt;p&gt;Measures generated content&lt;/p&gt;

&lt;p&gt;Response time&lt;/p&gt;

&lt;p&gt;Helps identify performance issues&lt;/p&gt;

&lt;p&gt;Failed requests&lt;/p&gt;

&lt;p&gt;Identifies reliability problems&lt;/p&gt;

&lt;p&gt;Cost per request&lt;/p&gt;

&lt;p&gt;Helps control spending&lt;/p&gt;

&lt;p&gt;User-level usage&lt;/p&gt;

&lt;p&gt;Detects unusual consumption&lt;/p&gt;

&lt;p&gt;Developers can also introduce per-user usage limits, monthly spending alerts, and request quotas.&lt;/p&gt;

&lt;p&gt;Monitoring should cover both technical performance and the quality of generated responses.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AI Output Validation and Human Oversight&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A successful API response does not always mean the generated information is correct.&lt;/p&gt;

&lt;p&gt;AI models can sometimes produce inaccurate, incomplete, or unexpected responses.&lt;/p&gt;

&lt;p&gt;For this reason, applications should not automatically trust every generated output.&lt;/p&gt;

&lt;p&gt;Consider an AI-powered invoice processing application.&lt;/p&gt;

&lt;p&gt;The model may extract:&lt;/p&gt;

&lt;p&gt;Customer name.&lt;/p&gt;

&lt;p&gt;Invoice number.&lt;/p&gt;

&lt;p&gt;Payment amount.&lt;/p&gt;

&lt;p&gt;Due date.&lt;/p&gt;

&lt;p&gt;Before saving this information, the backend should validate the expected fields, check data types, and apply business rules.&lt;/p&gt;

&lt;p&gt;For high-impact operations, human approval may also be necessary.&lt;/p&gt;

&lt;p&gt;Useful validation approaches include:&lt;/p&gt;

&lt;p&gt;Schema validation.&lt;/p&gt;

&lt;p&gt;Required-field checks.&lt;/p&gt;

&lt;p&gt;Business-rule validation.&lt;/p&gt;

&lt;p&gt;Output filtering.&lt;/p&gt;

&lt;p&gt;Human approval for sensitive actions.&lt;/p&gt;

&lt;p&gt;This makes AI-powered workflows more dependable and easier to control.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scalability and Future Maintenance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;An AI integration that works for a small number of users may not perform equally well under heavy traffic.&lt;/p&gt;

&lt;p&gt;As an application grows, developers need to consider how its architecture will handle increasing requests and more complex workflows.&lt;/p&gt;

&lt;p&gt;Some important architectural decisions include:&lt;/p&gt;

&lt;p&gt;Microservices: Separate AI-related functionality from unrelated business services when the added complexity is justified.&lt;/p&gt;

&lt;p&gt;Message queues: Process lengthy AI tasks asynchronously.&lt;/p&gt;

&lt;p&gt;Load balancing: Distribute incoming requests across available application instances.&lt;/p&gt;

&lt;p&gt;Database optimization: Improve query performance and manage growing conversation or document data.&lt;/p&gt;

&lt;p&gt;Provider abstraction: Keep AI-provider-specific code behind a common interface so the application can adapt when requirements change.&lt;/p&gt;

&lt;p&gt;These practices help create a maintainable AI application that can evolve with business requirements.&lt;/p&gt;

&lt;p&gt;Common Mistakes to Avoid During AI Integration&lt;/p&gt;

&lt;p&gt;Even a well-designed application can face problems when important implementation details are overlooked.&lt;/p&gt;

&lt;p&gt;Here are some common mistakes:&lt;/p&gt;

&lt;p&gt;Exposing private API keys in frontend code.&lt;/p&gt;

&lt;p&gt;Sending unnecessary sensitive information to external AI services.&lt;/p&gt;

&lt;p&gt;Ignoring rate limits and usage costs.&lt;/p&gt;

&lt;p&gt;Trusting generated responses without validation.&lt;/p&gt;

&lt;p&gt;Depending on a single external service without considering failure handling.&lt;/p&gt;

&lt;p&gt;Storing unlimited conversation history.&lt;/p&gt;

&lt;p&gt;Ignoring response-time and model-quality monitoring.&lt;/p&gt;

&lt;p&gt;Building AI features without considering future scalability.&lt;/p&gt;

&lt;p&gt;Avoiding these mistakes early can reduce technical debt and improve application reliability.&lt;/p&gt;

&lt;p&gt;Final Thoughts&lt;/p&gt;

&lt;p&gt;Building an AI-powered application involves much more than connecting an API and receiving a generated response.&lt;/p&gt;

&lt;p&gt;Developers must design a complete integration architecture that manages security, business data, API reliability, performance, costs, and output validation.&lt;/p&gt;

&lt;p&gt;A well-planned AI integration approach helps applications deliver useful AI capabilities while remaining secure, scalable, and maintainable.&lt;/p&gt;

&lt;p&gt;Whether you are adding an AI chatbot, document processing feature, recommendation engine, or intelligent automation workflow, the surrounding backend architecture plays an important role in its success.&lt;/p&gt;

&lt;p&gt;If your business is planning to introduce intelligent capabilities into an existing software product, explore Dev Technosys AI Integration Services to learn more about integrating AI technologies into business applications.&lt;/p&gt;

&lt;p&gt;Related Keywords: AI integration, AI-powered applications, AI API integration, AI application development, backend AI integration, generative AI integration, AI security, AI workflow automation, AI application scalability, AI integration services.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>lowcode</category>
      <category>api</category>
    </item>
    <item>
      <title>AI Integration Patterns Every Backend Developer Should Know</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Sat, 31 Oct 2026 09:39:56 +0000</pubDate>
      <link>https://dev.to/aartijangid23/ai-integration-patterns-every-backend-developer-should-know-5cjh</link>
      <guid>https://dev.to/aartijangid23/ai-integration-patterns-every-backend-developer-should-know-5cjh</guid>
      <description>&lt;p&gt;Artificial Intelligence is becoming an important part of modern software development. From intelligent chatbots and recommendation engines to automated workflows and predictive analytics, businesses are finding new ways to add AI capabilities to their existing applications.&lt;/p&gt;

&lt;p&gt;However, integrating an AI model into an application is not simply about connecting an API and displaying its response. Backend developers must also consider security, scalability, response time, data privacy, error handling, and infrastructure costs.&lt;/p&gt;

&lt;p&gt;This is where choosing the right AI integration patterns becomes important.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore practical AI integration patterns that backend developers should understand, how they work, when to use them, and which companies provide AI integration services.&lt;/p&gt;

&lt;p&gt;What Are AI Integration Patterns?&lt;/p&gt;

&lt;p&gt;AI integration patterns are reusable architectural approaches that help developers connect artificial intelligence capabilities with existing applications, databases, APIs, and business workflows.&lt;/p&gt;

&lt;p&gt;Instead of building every AI feature from scratch, developers can use established patterns to manage communication between different systems.&lt;/p&gt;

&lt;p&gt;For example, an e-commerce application might use AI to recommend products, understand customer questions, or predict purchasing behavior.&lt;/p&gt;

&lt;p&gt;The backend architecture determines how the application communicates with AI models, processes information, and delivers results to users.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;API-Based AI Integration Pattern&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;API-based integration is one of the simplest ways to introduce AI capabilities into an existing application.&lt;/p&gt;

&lt;p&gt;In this approach, the backend communicates with an external AI service through an API. The service processes the request and returns a generated response.&lt;/p&gt;

&lt;p&gt;How It Works&lt;/p&gt;

&lt;p&gt;A user submits a request through the frontend.&lt;/p&gt;

&lt;p&gt;The backend receives the request.&lt;/p&gt;

&lt;p&gt;The backend validates the input and sends it to an AI API.&lt;/p&gt;

&lt;p&gt;The AI service processes the request.&lt;/p&gt;

&lt;p&gt;The backend returns the response to the frontend.&lt;/p&gt;

&lt;p&gt;Example Using Node.js&lt;/p&gt;

&lt;p&gt;const express = require("express");&lt;br&gt;
const OpenAI = require("openai");&lt;/p&gt;

&lt;p&gt;const app = express();&lt;/p&gt;

&lt;p&gt;app.use(express.json());&lt;/p&gt;

&lt;p&gt;const openai = new OpenAI({&lt;br&gt;
  apiKey: process.env.OPENAI_API_KEY,&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;app.post("/api/ai", async (req, res) =&amp;gt; {&lt;br&gt;
  try {&lt;br&gt;
    const { message } = req.body;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (typeof message !== "string" || !message.trim()) {
  return res.status(400).json({
    error: "A valid message is required",
  });
}

const response = await openai.responses.create({
  model: process.env.OPENAI_MODEL,
  input: message,
  max_output_tokens: 300,
});

res.json({
  result: response.output_text,
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;} catch (error) {&lt;br&gt;
    console.error("AI request failed:", error.message);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;res.status(500).json({
  error: "Unable to process the AI request",
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;app.listen(3000, () =&amp;gt; {&lt;br&gt;
  console.log("Server running on port 3000");&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;When Should You Use It?&lt;/p&gt;

&lt;p&gt;AI chatbots&lt;/p&gt;

&lt;p&gt;Text summarization&lt;/p&gt;

&lt;p&gt;Content generation&lt;/p&gt;

&lt;p&gt;Sentiment analysis&lt;/p&gt;

&lt;p&gt;AI-powered application features&lt;/p&gt;

&lt;p&gt;Developer tip: Keep API credentials on the backend. Never expose private AI API keys in frontend JavaScript.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Retrieval-Augmented Generation (RAG) Pattern&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Large language models can generate useful answers, but they may not automatically know the latest or private information stored in a company's systems.&lt;/p&gt;

&lt;p&gt;Retrieval-Augmented Generation (RAG) addresses this challenge by retrieving relevant information from an external knowledge source before generating an answer.&lt;/p&gt;

&lt;p&gt;How RAG Works&lt;/p&gt;

&lt;p&gt;A typical RAG architecture includes these steps:&lt;/p&gt;

&lt;p&gt;Collect documents, FAQs, product information, or other business data.&lt;/p&gt;

&lt;p&gt;Divide the content into smaller chunks.&lt;/p&gt;

&lt;p&gt;Convert the chunks into vector embeddings.&lt;/p&gt;

&lt;p&gt;Store the embeddings in a vector database.&lt;/p&gt;

&lt;p&gt;Convert a user's question into an embedding.&lt;/p&gt;

&lt;p&gt;Retrieve relevant information based on similarity.&lt;/p&gt;

&lt;p&gt;Send the retrieved context to the AI model.&lt;/p&gt;

&lt;p&gt;Generate a response using the available information.&lt;/p&gt;

&lt;p&gt;Example Use Case&lt;/p&gt;

&lt;p&gt;Imagine a customer support application containing thousands of product documents.&lt;/p&gt;

&lt;p&gt;Instead of asking an AI model to answer questions without business context, the backend retrieves relevant product information and includes it in the model request.&lt;/p&gt;

&lt;p&gt;This makes it possible to build more context-aware applications.&lt;/p&gt;

&lt;p&gt;When Should You Use RAG?&lt;/p&gt;

&lt;p&gt;Enterprise knowledge assistants&lt;/p&gt;

&lt;p&gt;Customer support applications&lt;/p&gt;

&lt;p&gt;Document search systems&lt;/p&gt;

&lt;p&gt;Internal company chatbots&lt;/p&gt;

&lt;p&gt;Product information assistants&lt;/p&gt;

&lt;p&gt;Useful technologies include Pinecone, Weaviate, and PostgreSQL with pgvector.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Event-Driven AI Integration Pattern&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Not every AI task needs to happen immediately when a user submits a request.&lt;/p&gt;

&lt;p&gt;Some operations, such as document analysis, large-scale data processing, and automated report generation, can take several seconds or even minutes.&lt;/p&gt;

&lt;p&gt;An event-driven architecture allows backend systems to process these tasks asynchronously.&lt;/p&gt;

&lt;p&gt;How It Works&lt;/p&gt;

&lt;p&gt;The user submits a task.&lt;/p&gt;

&lt;p&gt;The backend creates a job and publishes an event.&lt;/p&gt;

&lt;p&gt;A message queue receives the event.&lt;/p&gt;

&lt;p&gt;A background worker processes the AI request.&lt;/p&gt;

&lt;p&gt;The result is stored in a database.&lt;/p&gt;

&lt;p&gt;The application notifies the user when processing is complete.&lt;/p&gt;

&lt;p&gt;Example Architecture&lt;/p&gt;

&lt;p&gt;User Request&lt;br&gt;
     |&lt;br&gt;
     v&lt;br&gt;
Backend API&lt;br&gt;
     |&lt;br&gt;
     v&lt;br&gt;
Message Queue&lt;br&gt;
     |&lt;br&gt;
     v&lt;br&gt;
Background Worker&lt;br&gt;
     |&lt;br&gt;
     v&lt;br&gt;
AI Model API&lt;br&gt;
     |&lt;br&gt;
     v&lt;br&gt;
Database&lt;br&gt;
     |&lt;br&gt;
     v&lt;br&gt;
User Notification&lt;/p&gt;

&lt;p&gt;When Should You Use It?&lt;/p&gt;

&lt;p&gt;AI-powered document processing&lt;/p&gt;

&lt;p&gt;Image classification&lt;/p&gt;

&lt;p&gt;Large data analysis&lt;/p&gt;

&lt;p&gt;Automated report generation&lt;/p&gt;

&lt;p&gt;Background content moderation&lt;/p&gt;

&lt;p&gt;Technologies such as RabbitMQ, Apache Kafka, and Redis can help implement asynchronous processing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AI Gateway Pattern&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As applications grow, developers may need to work with multiple AI providers and models.&lt;/p&gt;

&lt;p&gt;For example, one application might use one model for text generation, another for image processing, and a third for embeddings.&lt;/p&gt;

&lt;p&gt;Connecting every provider directly to different parts of the backend can make the architecture difficult to maintain.&lt;/p&gt;

&lt;p&gt;An AI gateway provides a centralized layer between the application and AI services.&lt;/p&gt;

&lt;p&gt;Key Responsibilities&lt;/p&gt;

&lt;p&gt;Route requests to appropriate AI models.&lt;/p&gt;

&lt;p&gt;Manage authentication and API credentials.&lt;/p&gt;

&lt;p&gt;Apply rate limits.&lt;/p&gt;

&lt;p&gt;Track usage and API costs.&lt;/p&gt;

&lt;p&gt;Handle provider failures.&lt;/p&gt;

&lt;p&gt;Standardize request and response formats.&lt;/p&gt;

&lt;p&gt;Example Architecture&lt;/p&gt;

&lt;p&gt;Frontend Application&lt;br&gt;
        |&lt;br&gt;
        v&lt;br&gt;
   Backend API&lt;br&gt;
        |&lt;br&gt;
        v&lt;br&gt;
     AI Gateway&lt;br&gt;
        |&lt;br&gt;
   +----+----+&lt;br&gt;
   |         |&lt;br&gt;
   v         v&lt;br&gt;
 Model A   Model B&lt;br&gt;
   |         |&lt;br&gt;
   +----+----+&lt;br&gt;
        |&lt;br&gt;
        v&lt;br&gt;
    AI Response&lt;/p&gt;

&lt;p&gt;When Should You Use It?&lt;/p&gt;

&lt;p&gt;Applications using multiple AI providers&lt;/p&gt;

&lt;p&gt;Enterprise AI platforms&lt;/p&gt;

&lt;p&gt;Applications requiring usage monitoring&lt;/p&gt;

&lt;p&gt;Systems with different model requirements&lt;/p&gt;

&lt;p&gt;Applications that need centralized AI security controls&lt;/p&gt;

&lt;p&gt;An AI gateway can simplify provider management and make it easier to change models without rewriting application logic.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Human-in-the-Loop AI Integration Pattern&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AI systems can automate many operations, but not every decision should be made without human involvement.&lt;/p&gt;

&lt;p&gt;Human-in-the-loop architecture introduces a review or approval step into an AI-powered workflow.&lt;/p&gt;

&lt;p&gt;For example, an AI system may analyze a customer refund request and recommend an action. However, a human employee can review the recommendation before the refund is processed.&lt;/p&gt;

&lt;p&gt;How It Works&lt;/p&gt;

&lt;p&gt;The application receives a request.&lt;/p&gt;

&lt;p&gt;The AI model analyzes the available information.&lt;/p&gt;

&lt;p&gt;The model generates a recommendation.&lt;/p&gt;

&lt;p&gt;The backend sends the recommendation for human review.&lt;/p&gt;

&lt;p&gt;An authorized person approves, rejects, or modifies it.&lt;/p&gt;

&lt;p&gt;The application performs the approved action.&lt;/p&gt;

&lt;p&gt;Common Use Cases&lt;/p&gt;

&lt;p&gt;Financial transaction approvals&lt;/p&gt;

&lt;p&gt;Healthcare decision support&lt;/p&gt;

&lt;p&gt;Fraud detection&lt;/p&gt;

&lt;p&gt;Customer refund processing&lt;/p&gt;

&lt;p&gt;AI-generated content moderation&lt;/p&gt;

&lt;p&gt;This pattern is especially useful when decisions involve sensitive data, financial impact, or business-critical operations.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AI Observability and Monitoring Pattern&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Deploying an AI feature is not the end of the integration process.&lt;/p&gt;

&lt;p&gt;Developers must continuously monitor how the AI system performs in real-world conditions.&lt;/p&gt;

&lt;p&gt;Traditional application monitoring focuses on server availability, response time, and errors. AI monitoring also needs to consider model-specific behavior.&lt;/p&gt;

&lt;p&gt;What Should Developers Monitor?&lt;/p&gt;

&lt;p&gt;Monitoring Area&lt;/p&gt;

&lt;p&gt;What to Track&lt;/p&gt;

&lt;p&gt;API performance&lt;/p&gt;

&lt;p&gt;Response time and request failures&lt;/p&gt;

&lt;p&gt;Token usage&lt;/p&gt;

&lt;p&gt;Input and output token consumption&lt;/p&gt;

&lt;p&gt;Model quality&lt;/p&gt;

&lt;p&gt;Accuracy and relevance of responses&lt;/p&gt;

&lt;p&gt;Security&lt;/p&gt;

&lt;p&gt;Unauthorized requests and sensitive data exposure&lt;/p&gt;

&lt;p&gt;Cost management&lt;/p&gt;

&lt;p&gt;Spending per request and user&lt;/p&gt;

&lt;p&gt;Reliability&lt;/p&gt;

&lt;p&gt;Rate limits, timeouts, and provider availability&lt;/p&gt;

&lt;p&gt;Monitoring tools and structured logs can help identify performance problems before they affect the overall user experience.&lt;/p&gt;

&lt;p&gt;Developers should also evaluate AI output quality regularly rather than relying only on successful API responses.&lt;/p&gt;

&lt;p&gt;Best Practices for Implementing AI Integration Patterns&lt;/p&gt;

&lt;p&gt;Choosing the right architecture is important, but implementation quality also matters.&lt;/p&gt;

&lt;p&gt;Here are some practices backend developers should follow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Protect API credentials: Store secrets in environment variables or a secure secrets manager.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Validate user inputs: Apply input validation, size limits, and appropriate content checks before sending requests to AI models.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Implement timeouts and retries: Handle temporary API failures with controlled retries and exponential backoff.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Monitor API costs: Track token consumption and establish usage limits to prevent unexpected expenses.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Protect sensitive information: Avoid sending unnecessary personal or confidential data to external AI providers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use asynchronous processing: Move time-consuming AI tasks into background workers when immediate responses are not required.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Evaluate AI responses: Test generated results for relevance, consistency, accuracy, and safety.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Plan for scalability: Design your integration architecture to handle increasing users, requests, and data volumes.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;5 AI Integration Companies Worth Exploring&lt;/p&gt;

&lt;p&gt;Businesses that want to introduce artificial intelligence into their existing applications may work with specialized AI development and integration providers.&lt;/p&gt;

&lt;p&gt;Here are five companies to explore based on their publicly described AI, software engineering, and integration capabilities. This is a shortlist, not a ranked industry comparison.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dev Technosys&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Dev Technosys provides software development and AI-related services, including AI model integration, API integration, workflow automation, and connecting AI technologies with existing applications.&lt;/p&gt;

&lt;p&gt;Its AI integration services cover areas such as:&lt;/p&gt;

&lt;p&gt;AI model and API integration&lt;/p&gt;

&lt;p&gt;AI-powered workflow automation&lt;/p&gt;

&lt;p&gt;Data integration&lt;/p&gt;

&lt;p&gt;Security configuration&lt;/p&gt;

&lt;p&gt;Integration testing&lt;/p&gt;

&lt;p&gt;Performance optimization&lt;/p&gt;

&lt;p&gt;Deployment and maintenance&lt;/p&gt;

&lt;p&gt;Businesses looking to add AI capabilities to existing digital products can explore its AI Integration Services.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;IBM&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;IBM offers enterprise AI integration and consulting capabilities. Its services cover AI-powered workflows, enterprise platforms, agent orchestration, and governance.&lt;/p&gt;

&lt;p&gt;IBM is worth exploring for organizations that need to coordinate AI capabilities across complex enterprise systems.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Accenture&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Accenture provides AI and data services focused on helping organizations adopt AI technologies and integrate them into business operations.&lt;/p&gt;

&lt;p&gt;Its capabilities include AI strategy, data modernization, generative AI, and enterprise transformation.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Deloitte&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Deloitte offers artificial intelligence and data consulting services, including AI strategy, intelligent automation, and the development of AI-powered business solutions.&lt;/p&gt;

&lt;p&gt;It can be considered by organizations looking for a combination of AI consulting and enterprise technology implementation.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Infosys&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Infosys provides applied AI, generative AI, automation, and enterprise AI capabilities.&lt;/p&gt;

&lt;p&gt;Its AI offerings support organizations looking to incorporate intelligent technologies into business applications and workflows.&lt;/p&gt;

&lt;p&gt;Note: The companies listed above have different service portfolios, target markets, and engagement models. Evaluate their technical expertise, relevant project experience, security practices, and pricing before selecting a provider.&lt;/p&gt;

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

&lt;p&gt;AI integration is more than connecting an application to an AI model. It requires a well-planned backend architecture that supports reliable communication, secure data handling, efficient processing, and continuous monitoring.&lt;/p&gt;

&lt;p&gt;API-based integration, RAG, event-driven architecture, AI gateways, human-in-the-loop workflows, and AI observability are important patterns that backend developers should understand.&lt;/p&gt;

&lt;p&gt;The right approach depends on the application's requirements, available data, expected traffic, security needs, and business objectives.&lt;/p&gt;

&lt;p&gt;As AI adoption continues to expand, understanding these integration patterns can help developers build more scalable and maintainable intelligent applications.&lt;/p&gt;

&lt;p&gt;If your business is planning to incorporate AI capabilities into an existing software product, explore Dev Technosys AI Integration Services to learn about possible integration approaches.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>developers</category>
    </item>
    <item>
      <title>How to Fix CORS Errors in a Local Development Environment</title>
      <dc:creator>Aarti Jangid</dc:creator>
      <pubDate>Fri, 30 Oct 2026 11:45:25 +0000</pubDate>
      <link>https://dev.to/aartijangid23/how-to-fix-cors-errors-in-a-local-development-environment-132l</link>
      <guid>https://dev.to/aartijangid23/how-to-fix-cors-errors-in-a-local-development-environment-132l</guid>
      <description>&lt;p&gt;Have you ever tried connecting your frontend application to a backend API on localhost, only to see a CORS error in your browser console?&lt;/p&gt;

&lt;p&gt;This is a common problem when developing applications locally. Your API might work perfectly in Postman, but the same request fails when you call it from React, Vue, or another frontend framework.&lt;/p&gt;

&lt;p&gt;The good news is that most local CORS issues can be fixed by understanding how browser security works and configuring your development environment correctly.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll explore what causes CORS errors, how to fix them using Express.js and Vite, and how to troubleshoot common problems during local development.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;What Is CORS?&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
CORS stands for Cross-Origin Resource Sharing. It is a browser security mechanism that controls whether a web application can access resources from a different origin.&lt;/p&gt;

&lt;p&gt;An origin consists of three parts:&lt;/p&gt;

&lt;p&gt;Protocol (HTTP or HTTPS)&lt;/p&gt;

&lt;p&gt;Domain or hostname&lt;/p&gt;

&lt;p&gt;Port number&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;Frontend: &lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt;&lt;br&gt;
Backend:  &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although both applications run on localhost, they use different ports. Therefore, the browser considers them different origins.&lt;/p&gt;

&lt;p&gt;When your frontend sends a request to the backend, the backend must provide appropriate CORS response headers to allow the browser to access the response.&lt;/p&gt;

&lt;p&gt;You can learn more from the MDN CORS documentation.&lt;/p&gt;

&lt;p&gt;Why Do CORS Errors Occur in Local Development?&lt;/p&gt;

&lt;p&gt;Several situations can trigger CORS errors while developing an application.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;1. Frontend and Backend Use Different Ports&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
A React application might run on port 5173, while its Node.js backend runs on port 3000.&lt;/p&gt;

&lt;p&gt;Since the origins are different, the browser checks whether the backend allows the frontend origin.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;2. Missing Access-Control-Allow-Origin Header&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
The backend response may not contain the required Access-Control-Allow-Origin header.&lt;/p&gt;

&lt;p&gt;Without an appropriate header, the browser blocks JavaScript from accessing the response.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;3. Preflight Request Failure&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Some HTTP requests trigger a preflight request before the actual request.&lt;/p&gt;

&lt;p&gt;For example, requests using methods such as PUT or DELETE, or custom headers such as Authorization, may trigger an OPTIONS request.&lt;/p&gt;

&lt;p&gt;If the backend does not handle the preflight request correctly, the browser may block the actual request.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;4. Incorrect Localhost Configuration&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
These URLs are not considered the same origin:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;&lt;br&gt;
&lt;a href="http://127.0.0.1:3000" rel="noopener noreferrer"&gt;http://127.0.0.1:3000&lt;/a&gt;&lt;br&gt;
&lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even small differences in the hostname, protocol, or port can cause cross-origin issues.&lt;/p&gt;

&lt;p&gt;How to Fix CORS Errors in a Local Development Environment&lt;/p&gt;

&lt;p&gt;Let's look at some practical solutions.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Method 1: Configure CORS in an Express.js Backend&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
If you are using Node.js and Express.js, the easiest approach is to configure the CORS middleware.&lt;/p&gt;

&lt;p&gt;First, install the package:&lt;/p&gt;

&lt;p&gt;npm install cors&lt;/p&gt;

&lt;p&gt;Now open your backend's main file, such as server.js, and add the following code:&lt;/p&gt;

&lt;p&gt;const express = require("express");&lt;br&gt;
const cors = require("cors");&lt;/p&gt;

&lt;p&gt;const app = express();&lt;/p&gt;

&lt;p&gt;app.use(&lt;br&gt;
  cors({&lt;br&gt;
    origin: "&lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt;",&lt;br&gt;
    methods: ["GET", "POST", "PUT", "DELETE"],&lt;br&gt;
    allowedHeaders: ["Content-Type", "Authorization"],&lt;br&gt;
  })&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;app.use(express.json());&lt;/p&gt;

&lt;p&gt;app.get("/api/users", (req, res) =&amp;gt; {&lt;br&gt;
  res.json({&lt;br&gt;
    message: "CORS configured successfully!",&lt;br&gt;
  });&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;app.listen(3000, () =&amp;gt; {&lt;br&gt;
  console.log("Server running on port 3000");&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;What Does This Code Do?&lt;/p&gt;

&lt;p&gt;origin specifies which frontend URL can access the backend.&lt;/p&gt;

&lt;p&gt;methods defines the allowed HTTP methods.&lt;/p&gt;

&lt;p&gt;allowedHeaders specifies which request headers are permitted.&lt;/p&gt;

&lt;p&gt;cors() automatically handles appropriate CORS response headers and preflight requests.&lt;/p&gt;

&lt;p&gt;Restart your backend server after making these changes.&lt;/p&gt;

&lt;p&gt;For additional configuration options, check the Express CORS middleware documentation.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Method 2: Use a Proxy in Vite&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Another useful solution is to configure a development proxy.&lt;/p&gt;

&lt;p&gt;If you are working with React and Vite, you can forward frontend API requests to your backend through the Vite development server.&lt;/p&gt;

&lt;p&gt;Open your vite.config.js file:&lt;/p&gt;

&lt;p&gt;import { defineConfig } from "vite";&lt;br&gt;
import react from "@vitejs/plugin-react";&lt;/p&gt;

&lt;p&gt;export default defineConfig({&lt;br&gt;
  plugins: [react()],&lt;br&gt;
  server: {&lt;br&gt;
    proxy: {&lt;br&gt;
      "/api": {&lt;br&gt;
        target: "&lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;",&lt;br&gt;
        changeOrigin: true,&lt;br&gt;
      },&lt;br&gt;
    },&lt;br&gt;
  },&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;Now, instead of calling the backend using its complete URL:&lt;/p&gt;

&lt;p&gt;fetch("&lt;a href="http://localhost:3000/api/users%22" rel="noopener noreferrer"&gt;http://localhost:3000/api/users"&lt;/a&gt;);&lt;/p&gt;

&lt;p&gt;Use a relative URL:&lt;/p&gt;

&lt;p&gt;fetch("/api/users");&lt;/p&gt;

&lt;p&gt;The Vite development server forwards the request to your backend.&lt;/p&gt;

&lt;p&gt;This approach helps avoid browser cross-origin requests during local development because the frontend communicates with the same development-server origin.&lt;/p&gt;

&lt;p&gt;Important: This proxy is intended for development. Your production application still needs an appropriate API and hosting configuration.&lt;/p&gt;

&lt;p&gt;You can explore more options in the official Vite server configuration guide.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Method 3: Configure CORS for Multiple Local Origins&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Sometimes you may work with multiple frontend environments.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;React frontend: &lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another frontend: &lt;a href="http://localhost:3001" rel="noopener noreferrer"&gt;http://localhost:3001&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Local testing environment: &lt;a href="http://127.0.0.1:5173" rel="noopener noreferrer"&gt;http://127.0.0.1:5173&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this situation, you can allow multiple specific origins.&lt;/p&gt;

&lt;p&gt;const allowedOrigins = [&lt;br&gt;
  "&lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt;",&lt;br&gt;
  "&lt;a href="http://localhost:3001" rel="noopener noreferrer"&gt;http://localhost:3001&lt;/a&gt;",&lt;br&gt;
  "&lt;a href="http://127.0.0.1:5173" rel="noopener noreferrer"&gt;http://127.0.0.1:5173&lt;/a&gt;",&lt;br&gt;
];&lt;/p&gt;

&lt;p&gt;app.use(&lt;br&gt;
  cors({&lt;br&gt;
    origin: function (origin, callback) {&lt;br&gt;
      if (!origin || allowedOrigins.includes(origin)) {&lt;br&gt;
        callback(null, true);&lt;br&gt;
      } else {&lt;br&gt;
        callback(new Error("Origin not allowed by CORS"));&lt;br&gt;
      }&lt;br&gt;
    },&lt;br&gt;
  })&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;This configuration checks the requesting origin against an allowlist.&lt;/p&gt;

&lt;p&gt;It is useful when multiple local applications need to access the same backend API.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Method 4: Handle OPTIONS Preflight Requests&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
A preflight request is an HTTP OPTIONS request that browsers send to check whether a cross-origin request is permitted.&lt;/p&gt;

&lt;p&gt;For example, consider this frontend request:&lt;/p&gt;

&lt;p&gt;fetch("&lt;a href="http://localhost:3000/api/users" rel="noopener noreferrer"&gt;http://localhost:3000/api/users&lt;/a&gt;", {&lt;br&gt;
  method: "PUT",&lt;br&gt;
  headers: {&lt;br&gt;
    "Content-Type": "application/json",&lt;br&gt;
    Authorization: "Bearer example-token",&lt;br&gt;
  },&lt;br&gt;
  body: JSON.stringify({&lt;br&gt;
    name: "John",&lt;br&gt;
  }),&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;The browser may first send an OPTIONS request to check whether the server allows the requested method and headers.&lt;/p&gt;

&lt;p&gt;If you use the Express CORS middleware globally, it handles preflight requests for supported routes.&lt;/p&gt;

&lt;p&gt;app.use(&lt;br&gt;
  cors({&lt;br&gt;
    origin: "&lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt;",&lt;br&gt;
    methods: ["GET", "POST", "PUT", "DELETE"],&lt;br&gt;
    allowedHeaders: ["Content-Type", "Authorization"],&lt;br&gt;
  })&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;Make sure this middleware is registered before your route handlers.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Common CORS Errors and Their Solutions&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Here are some common problems developers encounter while working with local APIs.&lt;/p&gt;

&lt;p&gt;CORS Error&lt;/p&gt;

&lt;p&gt;Possible Solution&lt;/p&gt;

&lt;p&gt;No Access-Control-Allow-Origin header&lt;/p&gt;

&lt;p&gt;Configure the allowed frontend origin on the backend.&lt;/p&gt;

&lt;p&gt;Request method not allowed&lt;/p&gt;

&lt;p&gt;Add the required HTTP method to the CORS configuration.&lt;/p&gt;

&lt;p&gt;Request header not allowed&lt;/p&gt;

&lt;p&gt;Include the required header in allowedHeaders.&lt;/p&gt;

&lt;p&gt;Preflight request failed&lt;/p&gt;

&lt;p&gt;Check OPTIONS handling and server responses.&lt;/p&gt;

&lt;p&gt;Credentials not supported with wildcard&lt;/p&gt;

&lt;p&gt;Use an explicit origin instead of *.&lt;/p&gt;

&lt;p&gt;Localhost and 127.0.0.1 mismatch&lt;/p&gt;

&lt;p&gt;Use consistent hostnames or allow both explicitly.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;How to Debug CORS Errors Effectively&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
If your CORS configuration looks correct but the error continues, follow these troubleshooting steps.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check the browser console&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Open Developer Tools using F12 and navigate to the Console tab. Read the complete CORS error message.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inspect the Network tab&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Find the failed API request and check its request method, status code, Origin header, and response headers.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check the backend server&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Make sure your backend is running and the API endpoint is accessible.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Test the OPTIONS request&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the browser sends a preflight request, check whether the server responds with the correct CORS headers.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify your frontend URL&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Confirm that the origin configured in your backend matches the actual frontend URL, including its protocol and port.&lt;/p&gt;

&lt;p&gt;Remember, Postman and curl do not enforce browser CORS restrictions. A successful Postman request does not prove that a browser request will work.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;CORS and Modern AI-Powered Applications&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
CORS configuration is also important when developing modern applications that communicate with external services.&lt;/p&gt;

&lt;p&gt;For example, an application with AI integration may use a frontend interface to communicate with a backend that connects to an AI API.&lt;/p&gt;

&lt;p&gt;In this architecture, the frontend should generally send requests to your own backend rather than exposing private API credentials directly in browser code.&lt;/p&gt;

&lt;p&gt;The backend can securely communicate with the external AI service and return the required response to the frontend.&lt;/p&gt;

&lt;p&gt;A correctly configured API architecture helps developers manage security, authentication, and cross-origin communication more effectively.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Final Thoughts&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
CORS errors are common during local development, especially when frontend and backend applications run on different ports.&lt;/p&gt;

&lt;p&gt;Fortunately, you can resolve most issues by configuring the correct backend response headers, using a development proxy, and checking preflight requests.&lt;/p&gt;

&lt;p&gt;Instead of disabling browser security or adding random headers, identify the actual cause of the error and apply the appropriate solution.&lt;/p&gt;

&lt;p&gt;Understanding CORS will make it easier to develop reliable web applications, connect APIs, and build more advanced solutions involving AI integration.&lt;/p&gt;

&lt;p&gt;If you are planning to add intelligent features to an existing application, you can also explore AI Integration Services to learn more about integrating AI capabilities into business applications.&lt;/p&gt;

</description>
      <category>core</category>
      <category>unoplatformchallenge</category>
      <category>infrastructure</category>
    </item>
  </channel>
</rss>
