Close Menu
    Trending
    • What I Learned From my First Major Crisis as a CEO
    • Vision Transformer on a Budget
    • Think You Know AI? Nexus Reveals What Everyone Should Really Know | by Thiruvarudselvam suthesan | Jun, 2025
    • How Cloud Innovations Empower Hospitality Professionals
    • Disney Is Laying Off Hundreds of Workers Globally
    • LLMs + Pandas: How I Use Generative AI to Generate Pandas DataFrame Summaries
    • Genel Yapay Zeka Eşiği. Analitik düşünme yapımızı, insani… | by Yucel | Jun, 2025
    • Thomson Reuters Launches Agentic AI for Tax, Audit and Accounting
    Finance StarGate
    • Home
    • Artificial Intelligence
    • AI Technology
    • Data Science
    • Machine Learning
    • Finance
    • Passive Income
    Finance StarGate
    Home»Artificial Intelligence»The Simplest Possible AI Web App
    Artificial Intelligence

    The Simplest Possible AI Web App

    FinanceStarGateBy FinanceStarGateMay 29, 2025No Comments11 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    📙 in a multi-part sequence on creating net purposes with generative AI integration. Half 1 targeted on discussing the AI stack and why the applying layer is the most effective place within the stack to be. Verify it out here. Half 2 targeted on why Ruby is the most effective net language for constructing AI MVPs. Verify it out here. I extremely advocate you learn via each elements earlier than studying this text to get caught up on terminology used right here.

    Desk of Contents


    Introduction

    On this article, we can be conducting a enjoyable thought experiment. We search to reply the query:

    How easy can we make an online software with AI integration?

    My readers will know that I worth simplicity very highly. Easy net apps are simpler to grasp, quicker to construct, and extra maintainable. In fact, because the app scales, complexity arises out of necessity. However you all the time wish to begin easy.

    We’ll take a typical case research for an online software with AI integration (RAG), and have a look at 4 completely different implementations. We’re going to start with essentially the most advanced setup that’s composed of the most well-liked instruments, and try and simplify it step-by-step, till we find yourself with the simplest setup attainable.

    Why are we doing this?

    I wish to encourage builders to suppose extra merely. Oftentimes, the “mainstream” path to constructing net apps or integrating AI is much too advanced for the use case. Builders take inspiration from firms like Google or Apple, with out acknowledging that instruments that work for them are oftentimes inappropriate for purchasers working at a a lot smaller scale.

    Seize a espresso or tea, and let’s dive in.

    Degree 1: As Advanced As It Will get

    Suppose a shopper has requested you to construct a RAG software for them. This software can have one web page the place customers can add their paperwork and one other web page the place they’ll chat with their paperwork utilizing RAG. Going with the most well-liked net stack at the moment in use, you resolve to go together with the MERN stack (MongoDB, Categorical.js, React, and Node.js) to construct your software.

    To construct the RAG pipelines that can be dealing with doc parsing, chunking, embedding, retrieval, and extra, you once more resolve to go together with the most well-liked stack: LangChain deployed by way of FastAPI. The online app will make API calls to the endpoints outlined in FastAPI. There’ll have to be not less than two endpoints: one for calling the indexing pipeline and one other for calling the question pipeline. In follow, additionally, you will want upsert and delete endpoints, to make sure that the information in your database stays in sync with the embeddings in your vector retailer.

    Word that you’ll be utilizing JavaScript for the online software, and Python for the AI integration. This duo-lingual app means you’ll doubtless be utilizing a Microservices structure (see part 2 of this sequence for extra on this). This isn’t a strict requirement, however is commonly inspired in a setup like this.

    There may be yet another option to be made: what vector database will you be utilizing? The vector database is the place the place you retailer the doc chunks created by the indexing pipeline. Let’s once more go together with the most well-liked selection on the market: Pinecone. It is a managed cloud vector database that many AI builders are at the moment utilizing.

    The entire system would possibly look one thing like the next:

    A standard RAG software. Picture by creator.

    Yikes! There are a whole lot of transferring items right here. Let’s break issues down:

    • On the backside rectangle, we now have the online software and MongoDB backend. Within the center we now have the RAG pipelines constructed with LangChain and FastAPI. On the prime, we now have the Pinecone vector database. Every rectangle right here represents a distinct service with their very own separate deployments. Whereas the Pinecone cloud vector database can be managed, the remaining is on you.
    • I’ve wrapped instance HTTP requests and corresponding responses with a dotted border. Keep in mind, it is a microservices structure, so this implies HTTP requests can be wanted anytime inter-service communication happens. For simplicity, I’ve solely illustrated what the question pipeline calls would seem like and I’ve omitted any calls to OpenAI, Anthropic, and many others. For readability, I numbered the requests/responses within the order by which they’d happen in a question state of affairs.
    • As an instance one ache level, making certain the paperwork in your MongoDB database are synced with their corresponding embeddings within the Pinecone index is doable however could be tough. It takes a number of HTTP requests to go out of your MongoDB database to the cloud vector database. It is a level of complexity and overhead for the developer.

    A easy analogy: that is like attempting to maintain your bodily bookshelf synced up with a digital e book catalog. Any time you get a brand new e book or donate a e book out of your shelf (seems you solely just like the Recreation of Thrones present, not the e book), you must go and manually replace the catalog to mirror the change. On this world of books a small discrepancy received’t actually impression you, however on the planet of net purposes this generally is a large drawback.

    Degree 2: Drop the Cloud

    Can we make this structure any easier? Maybe you learn an article just lately that mentioned how Postgres has an extension referred to as pgvector. This implies you possibly can forgo Pinecone and simply use Postgres as your vector database. Ideally you possibly can migrate your information over from MongoDB so that you just stick with just one database. Nice! You refactor your software to now seem like the next:

    A simplified RAG software. Picture by creator.

    Now we solely have two providers to fret about: the online software + database and the RAG pipelines. As soon as once more, any calls to mannequin suppliers has been omitted.

    What have we gained with this simplification? Now, your embeddings and the related paperwork or chunks can stay in the identical desk in the identical database. For instance, you possibly can add an embeddings column to a desk in PostgreSQL by doing:

    ALTER TABLE paperwork
      ADD COLUMN embedding vector(1536);

    Sustaining coherence between the paperwork and embeddings needs to be a lot easier now. Postgres’ ON INSERT/UPDATE triggers allow you to compute embeddings in-place, eliminating the two-phase “write doc/then embed” dance totally.

    Returning to the bookshelf analogy, that is like ditching the digital catalog and as a substitute simply attaching a label immediately to each e book. Now, whenever you transfer round a e book or toss one, there isn’t any have to replace a separate system, for the reason that labels go wherever the books go.

    Degree 3: Microservices Begone!

    You’ve carried out a great job simplifying issues. Nonetheless, you suppose you are able to do even higher. Maybe you possibly can create a monolithic app, as a substitute of utilizing the microservices structure. A monolith simply signifies that your software and your RAG pipelines are developed and deployed collectively. A problem arises, nonetheless. You coded up the online app in JavaScript utilizing the MERN stack. However the RAG pipelines had been constructed utilizing Python and LangChain deployed by way of FastAPI. Maybe you possibly can attempt to squeeze these right into a single container, utilizing one thing like Supervisor to supervise the Python and JavaScript processes, however it’s not a pure match for polyglot stacks.

    So what you resolve to do is to ditch React/Node and as a substitute use Django, a Python net framework to develop your app. Now, your RAG pipeline code can simply stay in a utility module in your Django app. This implies no extra HTTP requests are being made, which removes complexity and latency. Any time you wish to run your question or indexing pipelines all you must do is make a perform name. Spinning up dev environments and deployments is now a breeze. In fact, if you happen to learn half 2, our desire is to not use an all Python stack, however as a substitute go together with an all Ruby stack.

    You’ve simplified even additional, and now have the next structure:

    An excellent easier RAG structure. Picture by creator.

    An vital observe: in earlier diagrams, I mixed the online software and database right into a single service, for simplicity. At this level I feel it’s vital to indicate that they’re, in actual fact, separate providers themselves! This does not imply you might be nonetheless utilizing a microservices structure. So long as the 2 providers are developed and deployed altogether, that is nonetheless a monolith.

    Wow! Now you solely have a single deployment to spin up and preserve. You may have your database arrange as an adjunct to your net software. This sadly means you’ll nonetheless doubtless wish to use Docker Compose to develop and deploy your database and net software providers collectively. However with the pipelines now simply working as features as a substitute of a separate service, now you can ditch FastAPI! You’ll not want to take care of these endpoints; simply use perform calls.

    A little bit of technical element: on this chart, the legend signifies that the dotted line is not HTTP, however as a substitute a Postgres frontend/backend protocol. These are two completely different protocols on the software layer of the internet protocol model. It is a completely different software layer than the one I mentioned in part 1. Utilizing an HTTP connection to switch information between the applying and the database is theoretically attainable, however not optimum. As a substitute the creators of Postgres created their very own protocol that’s lean and tightly coupled to the wants of the database.

    Degree 4: SQLite Enters the Chat

    “Absolutely we’re carried out simplifying?”, you could be asking your self.

    Improper!

    There may be yet another simplification we will make. As a substitute of utilizing Postgres, we will use SQLite! You see, at the moment your app and your database are two separate providers deployed collectively. However what in the event that they weren’t two completely different providers, however as a substitute your database was only a file that lives in your software? That is what SQLite can provide you. With the just lately launched sqlite-vec library, it may even deal with RAG, identical to how pgvector works for Postgres. The caveat right here is that sqlite-vec is pre-v1, however that is nonetheless nice for an early stage MVP.

    The best attainable structure. Picture by creator.

    Really wonderful. Now you can ditch Docker Compose! That is actually a single service Web Application. The LangChain modules and your database now all are simply features and recordsdata dwelling in your repository.

    Involved about the usage of SQLite in a manufacturing net software? I wrote recently about how SQLite, as soon as thought-about only a plaything on the planet of net apps, can grow to be production-ready via some tweaks in its configuration. Actually Ruby on Rails 8 just lately made these variations default and is now pushing SQLite as a default database for new applications. In fact because the app scales, you’ll doubtless have to migrate to Postgres or another database, however keep in mind the mantra I discussed at first: solely introduce complexity when completely vital. Don’t assume your app goes to explode with hundreds of thousands of concurrent writes if you find yourself simply attempting to get your first few customers.

    Abstract

    On this article, we began with the standard stacks for constructing an online software with AI integration. We noticed the quantity of complexity concerned, and determined to simplify piece by piece till we ended up with the Platonic splendid of straightforward apps.

    However don’t let the simplicity idiot you; the app remains to be a beast. Actually, due to the simplicity, it may run a lot quicker than the standard app. If you’re noticing that the app is beginning to decelerate, I’d strive sizing up the server earlier than contemplating migrating to a brand new database or breaking apart the monolith.

    With such a lean software, you possibly can actually transfer quick. Native growth is a dream, and including new capabilities could be carried out at lightning pace. You may nonetheless get backups of your SQLite database utilizing one thing like Litestream. As soon as your app is displaying actual indicators of pressure, then transfer up the degrees of complexity. However I counsel towards beginning a brand new software at degree 1.

    I hope you’ve gotten loved this sequence on constructing net purposes with AI integration. And I hope I’ve impressed you to suppose easy, not difficult!

    🔥 If you’d like a custom web application with generative AI integration, visit losangelesaiapps.com



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleAutonomous Learning: From Child’s Play to Agentic AI on the Path to AGI | by Bran Kop, Engineer @Conformal, Founder of aiHQ | May, 2025
    Next Article 10 Leadership Myths You Need to Stop Believing
    FinanceStarGate

    Related Posts

    Artificial Intelligence

    Vision Transformer on a Budget

    June 3, 2025
    Artificial Intelligence

    LLMs + Pandas: How I Use Generative AI to Generate Pandas DataFrame Summaries

    June 3, 2025
    Artificial Intelligence

    Evaluating LLMs for Inference, or Lessons from Teaching for Machine Learning

    June 2, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    Meet GuruAI : Your Spiritual Guide powered by the wisdom of the Gita. | by Tarun Balaji K S | Apr, 2025

    April 20, 2025

    MIT engineers grow “high-rise” 3D chips | MIT News

    February 10, 2025

    Integrating ML model in React js. Hey folks! 👋 | by Pranav | Mar, 2025

    March 30, 2025

    Imagine If Watching More TV Made You Smarter

    February 2, 2025

    Decoding Neural Architecture Search: The Next Evolution in AI Model Design | by Analyst Uttam | May, 2025

    May 24, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    Most Popular

    Cracking the code of spatio-temporal patterns in time series data | by Katy | Mar, 2025

    March 20, 2025

    Two new benchmarks could help make AI models less biased

    March 11, 2025

    Brookhaven Researcher’s ‘Exocortex’ for AI (Artificial Imagination)

    February 2, 2025
    Our Picks

    The Income Limit To Qualify For College Scholarships And Grants

    April 30, 2025

    Time Series Forecasting Made Simple (Part 2): Customizing Baseline Models

    May 9, 2025

    Why Entrepreneurship Is the Cure to an Unstable Economy

    March 23, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2025 Financestargate.com All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.