<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhishek Bhardwaj on Medium]]></title>
        <description><![CDATA[Stories by Abhishek Bhardwaj on Medium]]></description>
        <link>https://medium.com/@abhishekbhardwaj.ddn?source=rss-2ca14c275dc0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ir40pbUMxau5XyJP</url>
            <title>Stories by Abhishek Bhardwaj on Medium</title>
            <link>https://medium.com/@abhishekbhardwaj.ddn?source=rss-2ca14c275dc0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 14:52:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhishekbhardwaj.ddn/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Databrick Release — 2026 — That matter]]></title>
            <link>https://medium.com/@abhishekbhardwaj.ddn/databrick-release-2026-that-matter-f89aab3348d2?source=rss-2ca14c275dc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f89aab3348d2</guid>
            <dc:creator><![CDATA[Abhishek Bhardwaj]]></dc:creator>
            <pubDate>Thu, 10 Sep 2026 16:54:18 GMT</pubDate>
            <atom:updated>2026-09-10T17:00:56.170Z</atom:updated>
            <content:encoded><![CDATA[<h3>Databricks 2026 — Releases That Actually Matter</h3><p>I went through the 2026 Databricks releases and tried to look at them from an architecture point of view.</p><p>I am not interested in every UI enhancement, connector, or runtime patch. These are the changes that I think are actually worth understanding and talking about.</p><h3>1. Unity Catalog ABAC — Governance is becoming policy-driven</h3><h3>Before</h3><p>Unity Catalog already gave us centralized permissions, row filters, column masking, etc.</p><p>The challenge was scale.</p><p>If an organization has hundreds or thousands of tables, we don’t really want to keep doing this:</p><pre>customer.ssn     → masking rule<br>employee.ssn     → masking rule<br>claims.ssn       → masking rule<br>vendor.ssn       → masking rule</pre><p>It works, but governance becomes very object-specific.</p><h3>What changed in 2026</h3><p>Databricks made <strong>Governed Tags</strong> and <strong>Attribute-Based Access Control (ABAC)</strong> generally available.</p><p>Now a table or column can carry a controlled tag such as:</p><pre>PII<br>CONFIDENTIAL<br>FINANCE<br>HR</pre><p>and a policy can use that tag to decide what should happen.</p><p>For example:</p><pre>              customer.ssn<br>                     │<br>                 tag = PII<br>                     │<br>                     ▼<br>                ABAC Policy<br>                  /      \<br>                 /        \<br>             HR User    Other User<br>                │            │<br>                ▼            ▼<br>             Full SSN      Masked</pre><p>Databricks made Governed Tags GA on April 2 and ABAC GA on April 28.</p><h3>After</h3><p>Instead of thinking:</p><blockquote><strong><em>Which masking policy should I add to this table?</em></strong></blockquote><p>we can think:</p><blockquote><strong><em>This column is PII. What is our enterprise policy for PII?</em></strong></blockquote><p>That is a much better governance model when the platform becomes large.</p><h3>Why I think this matters</h3><p>The interesting part is not just masking.</p><p>The important change is that governance starts becoming <strong>policy-driven rather than table-driven</strong>.</p><p>For me, this is one of the strongest Unity Catalog releases this year.</p><h3>In Nutshell</h3><blockquote><em>“ABAC is interesting because it gives us a way to move away from maintaining security rules object by object. If we classify data properly using governed tags, we can apply policies consistently across the platform.”</em></blockquote><h3>2. Iceberg + OpenSharing — Databricks is getting much more open</h3><h3>Before</h3><p>When we talked about Databricks tables, the natural association was:</p><pre>Databricks<br>    │<br>    ▼<br> Delta Lake</pre><p>But a real enterprise may have other engines:</p><pre>Databricks<br>Snowflake<br>Trino<br>Spark<br>Flink<br>AWS services</pre><p>and some of those environments may prefer Apache Iceberg.</p><p>That creates an architecture question:</p><blockquote><strong><em>Do I need separate copies of the same data for different engines?</em></strong></blockquote><h3>What changed in 2026</h3><p>Databricks made <strong>Unity Catalog managed Apache Iceberg tables generally available</strong> in May.</p><p>Those tables can be managed through Unity Catalog while still being accessible by external Iceberg-compatible engines.</p><p>Then Databricks renamed <strong>Delta Sharing to OpenSharing</strong> in June and continued expanding sharing support for Iceberg and external consumers.</p><h3>After</h3><p>The architecture can look more like:</p><pre>                Unity Catalog<br>                      │<br>             ┌────────┴────────┐<br>             │                 │<br>           Delta             Iceberg<br>             │                 │<br>        Databricks         Other Engines<br>                                │<br>                       ┌────────┼────────┐<br>                       │        │        │<br>                     Trino    Spark   Others</pre><p>So Unity Catalog can increasingly act as the governance layer while the underlying table ecosystem is more open.</p><h3>Another release connected to this: Transactions</h3><p>Databricks also made transactions across one or more managed Delta tables GA in July.</p><p>That means several SQL changes can be committed together or rolled back together.</p><p>Example:</p><pre>BEGIN TRANSACTION<br><br>Update booking<br>Update payment<br>Update inventory<br>COMMIT</pre><p>If one part fails, we don’t want two tables updated and the third one left behind.</p><h3>Why I think this matters</h3><p>This is bigger than just saying:</p><blockquote><em>“Databricks supports Iceberg.”</em></blockquote><p>The interesting architecture story is:</p><p><strong>Unity Catalog is becoming a governance layer that can work across a more open data ecosystem.</strong></p><p>That reduces some of the pressure to make every consumer use exactly the same engine.</p><h3>In Nutshell</h3><blockquote><em>“The Iceberg work is important to me because enterprises rarely run only one analytics engine. If Unity Catalog can govern both Delta and Iceberg while those tables are consumed by different engines, it gives us much more flexibility when designing the platform.”</em></blockquote><h3>3. Real-time — Databricks is attacking latency from three sides</h3><p>This is one area where I would be careful not to put all the new products into one bucket.</p><p>I see three different problems.</p><pre>Getting data in<br>      ↓<br>Processing it<br>      ↓<br>Serving/querying it</pre><h3>Before</h3><p>Databricks has supported streaming for years through Spark Structured Streaming.</p><p>But many architectures still looked something like:</p><pre>          Applications<br>               │<br>               ▼<br>          Kafka / Kinesis<br>               │<br>               ▼<br>          Structured Streaming<br>               │<br>               ▼<br>              Delta<br>               │<br>               ▼<br>          SQL Warehouse</pre><p>That architecture is perfectly valid.</p><p>But when we move toward very low-latency operational workloads, every layer matters.</p><h3>What changed in 2026</h3><p>There are three releases I connect together:</p><pre>        Zerobus<br>           ↓<br>        Fast ingestion<br>        <br>        Real-Time Mode<br>           ↓<br>        Fast processing<br>        <br>        Lakehouse Real-Time<br>           ↓<br>        Fast serving/querying</pre><p><strong>Zerobus ingestion into streaming tables became GA in August.</strong></p><p><strong>Real-time mode for Spark Declarative Pipelines entered Public Preview in May</strong>, targeting very low-latency streaming workloads.</p><p>And <strong>Lakehouse Real-Time entered Beta in June.</strong></p><h3>After</h3><p>This starts giving us an architecture like:</p><pre>            GPS / App / Device Events<br>                      │<br>                      ▼<br>                   Zerobus<br>                      │<br>                      ▼<br>                Streaming Table<br>                      │<br>                      ▼<br>                Real-Time Pipeline<br>                      │<br>                      ▼<br>                  Serving Table<br>                      │<br>                      ▼<br>               Lakehouse Real-Time<br>                   /        \<br>                  /          \<br>            Dashboard         Application</pre><h3>Why I think this matters</h3><p>Previously, once a use case started demanding very low latency, architects often had to ask:</p><blockquote><strong><em>Do I now need another serving technology?</em></strong></blockquote><p>The interesting question going forward is whether more of these operational workloads can remain inside the Databricks ecosystem.</p><p>I would not say Databricks suddenly replaces Kafka, Flink, Redis, Cassandra, etc.</p><p>That would be too broad.</p><p>But the boundary of what we can realistically build inside Databricks is clearly moving.</p><h3>In Nutshell</h3><blockquote><em>“The real-time releases are interesting because Databricks isn’t only improving streaming processing. Zerobus addresses ingestion, real-time mode addresses processing latency, and Lakehouse Real-Time addresses the serving side. I would look at those three together when evaluating a real-time architecture.”</em></blockquote><h3>4. Lakeflow — fewer separate pieces in a data pipeline</h3><h3>Before</h3><p>A fairly normal enterprise pipeline can involve several products:</p><pre>              Source<br>                │<br>                ▼<br>              Fivetran / custom ingestion<br>                │<br>                ▼<br>              Kafka<br>                │<br>                ▼<br>              Airflow<br>                │<br>                ▼<br>              Spark<br>                │<br>                ▼<br>              Delta</pre><p>There is nothing inherently wrong with this.</p><p>The issue is that every tool adds another thing to deploy, secure, monitor, upgrade and support.</p><h3>What changed in 2026</h3><p>Lakeflow continued filling in more of that pipeline lifecycle.</p><p>I think the important pieces are:</p><pre>              Lakeflow Connect<br>                    │<br>                    │ ingestion<br>                    ▼<br>              Spark Declarative Pipelines<br>                    │<br>                    │ transformation<br>                    ▼<br>              Lakeflow Jobs<br>                    │<br>                    │ orchestration<br>                    ▼<br>              Unity Catalog Tables</pre><p>There are also two releases I would specifically call out.</p><p><strong>Lakeflow Designer became GA in June</strong>, giving analysts and engineers a visual way to build transformations while still producing governed, production-oriented workflows.</p><p>And <strong>AUTO CDC for streaming tables became GA in June.</strong> It can handle ordered CDC processing and SCD Type 1 / Type 2 patterns without engineers writing the same complex merge logic repeatedly.</p><p>Query-based Lakeflow Connect connectors also became GA in May for databases including Oracle, SQL Server, MySQL, PostgreSQL and Teradata.</p><h3>Before AUTO CDC</h3><p>We might have code dealing with:</p><pre>                Is this an insert?<br>                Is this an update?<br>                Which record came first?<br>                Is an older event arriving late?<br>                Do I close the previous SCD record?<br>                Do I create a new version?</pre><h3>After</h3><p>More of that becomes declarative:</p><pre>                    CDC Feed<br>                       │<br>                       ▼<br>                    AUTO CDC<br>                       │<br>                       ├── Ordering<br>                       ├── SCD Type 1<br>                       └── SCD Type 2<br>                       │<br>                       ▼<br>                    Streaming Table</pre><h3>Why I think this matters</h3><p>The story I see is <strong>tool consolidation</strong>.</p><p>Not because every company should immediately remove Airflow, Fivetran, Kafka or other products.</p><p>But when I design a new platform, I would now ask:</p><blockquote><em>“</em><strong><em>Do we actually need another product for this, or can Lakeflow handle it well enough?</em></strong><em>”</em></blockquote><p>That is a useful architecture question.</p><h3>In Nutshell</h3><blockquote><em>“Lakeflow is becoming more interesting because Databricks is bringing ingestion, transformation and orchestration closer together. The benefit isn’t just fewer products — it can also mean simpler governance, lineage and operations.”</em></blockquote><h3>5. Serverless — the platform team moves up a level</h3><h3>Before</h3><p>A lot of Databricks conversations used to begin with compute.</p><pre>What cluster?<br>Which VM?<br>How many workers?<br>Autoscaling?<br>Runtime version?<br>Cluster policy?<br>Startup time?</pre><p>Engineers had to understand both:</p><pre>                      their workload<br>                          AND<br>              the infrastructure running it</pre><h3>What changed</h3><p>Serverless has been evolving for several years, but 2026 is another important step.</p><p>Serverless workspaces became GA in January, giving customers a workspace preconfigured around serverless compute and storage. Databricks also made <strong>serverless compute access control GA in August</strong>, allowing admins to control who can use interactive and automated serverless compute.</p><h3>After</h3><p>The experience increasingly becomes:</p><pre>Engineer<br>   │<br>   ▼<br>Submit workload<br>   │<br>   ▼<br>Serverless Databricks<br>   │<br>   ├── provisions compute<br>   ├── scales compute<br>   └── manages runtime infrastructure</pre><p>The platform team still has plenty to do.</p><p>But the conversation shifts toward:</p><pre>Governance<br>Security<br>Networking<br>Cost<br>Workload isolation<br>Data architecture<br>Standards</pre><p>instead of spending as much time managing clusters.</p><h3>Why I think this matters</h3><p>This changes the role of a Databricks platform team.</p><p>A mature platform team should spend more time deciding:</p><blockquote><em>Who can run what?<br>What data can they access?<br>What is the cost?<br>What are the platform standards?</em></blockquote><p><strong><em>and less time acting as a cluster administration team</em></strong>.</p><h3>In Nutshell</h3><blockquote><em>“Serverless is important to me mainly because it changes the operating model. Databricks manages more of the compute lifecycle, while the platform team can focus more on governance, architecture and cost controls.”</em></blockquote><h3>6. Genie Code + Supervisor Agent — AI is becoming part of how the platform is operated</h3><h3>Before</h3><p>When AI assistants first appeared in data platforms, the main use cases were fairly simple:</p><pre>Write this SQL<br>Explain this error<br>Generate some Python<br>Fix this query</pre><p>Useful, but mostly an assistant sitting beside the engineer.</p><h3>What changed</h3><p>Databricks Assistant became <strong>Genie Code</strong>, and the product has moved more toward agent-style behavior.</p><p>Full-page Genie Code became GA in August and can work across notebooks, files, conversations, instructions and MCP servers.</p><p>Databricks also made <strong>Supervisor Agent GA in February</strong> for supported environments. Its purpose is to coordinate multiple agents and tools for more complex tasks.</p><h3>Before</h3><pre>              User<br>               │<br>               ▼<br>              One AI Assistant<br>               │<br>               ▼<br>              Answer</pre><h3>After</h3><p>We can start thinking about something like:</p><pre>                User<br>                 │<br>                 ▼<br>          Supervisor Agent<br>          /       |       \<br>         /        |        \<br>        ▼         ▼         ▼<br>   Data Agent   RAG Agent   API Agent<br>       │           │          │<br>       ▼           ▼          ▼<br>    Tables      Documents   Services</pre><p>The supervisor doesn’t necessarily do all the work itself.</p><p>Its job can be to decide:</p><blockquote><em>Which agent or tool should handle this part of the request?</em></blockquote><h3>Why I think this matters</h3><p>This is the shift I find interesting:</p><pre>                  AI helping a developer<br>                            ↓<br>              AI participating in a workflow</pre><p>That’s much more significant than code completion.</p><h3>In Nutshell</h3><blockquote><em>“What interests me about Genie Code and Supervisor Agent is the move from AI as a coding helper toward AI that can actually coordinate work across data, tools and other agents.”</em></blockquote><h3>7. Unity Gateway + MLflow Tracing — building AI is not enough; enterprises have to govern it</h3><h3>Before</h3><p>Imagine several teams start building AI applications.</p><ul><li>One uses OpenAI.</li><li>Another uses Anthropic.</li><li>Another uses Bedrock.</li><li>Another creates MCP tools.</li></ul><p>You can quickly get this:</p><pre>                      Company<br>                        |<br>                        ▼<br>        Team A ─────→ OpenAI<br>        Team B ─────→ Claude<br>        Team C ─────→ Bedrock<br>        Team D ─────→ MCP tools<br>    <br>         Who controls all of this?<br></pre><p>Now we have questions around:</p><pre>Who is allowed to use which model?<br>How much are we spending?<br>Where is sensitive data going?<br>Which application generated this call?<br>What happened when an agent produced a bad answer?</pre><h3>What changed</h3><p><strong>Unity Gateway became GA in August.</strong></p><p>It provides a centralized governance layer for AI services and can control model access, route traffic, govern MCP services, and monitor usage, cost, access and lineage.</p><p>At the same time, <strong>MLflow trace storage in Unity Catalog became GA in July.</strong></p><p>AI traces can be stored as governed Unity Catalog data using OpenTelemetry format and queried using the normal Databricks ecosystem.</p><h3>After</h3><p>I see the architecture becoming:</p><pre>                    Applications / Agents<br>                              │<br>                              ▼<br>                         Unity Gateway<br>                              │<br>                    ┌─────────┼─────────┐<br>                    │         │         │<br>                  Access     Cost    Guardrails<br>                    │         │         │<br>                    └─────────┼─────────┘<br>                              ▼<br>                     AI Model Providers <br>                              |<br>                              ▼<br>                        Agent execution<br>                              │<br>                              ▼<br>                         MLflow Tracing<br>                              │<br>                              ▼<br>                        Unity Catalog<br>                              │<br>                              ▼<br>                        Audit / Debug / Monitor<br>            <br>            <br>            </pre><h3>Why I think this matters</h3><p>A proof of concept can connect directly to an LLM API.</p><p>An enterprise platform cannot remain like that forever.</p><p>Eventually someone has to answer:</p><blockquote><em>Who used the model?<br>Why?<br>What did it cost?<br>What data was sent?<br>What happened during the response?</em></blockquote><p>That is why I think Unity Gateway and MLflow tracing are more important than adding yet another foundation model to the platform.</p><h3>In Nutshell</h3><blockquote><em>“For enterprise AI, model access itself isn’t the difficult part anymore. Governance and observability are becoming the real challenge. Unity Gateway and MLflow tracing are interesting because they give us centralized control and visibility around those AI workloads.”</em></blockquote><h3>8. Managed Disaster Recovery — Databricks is addressing more mission-critical workloads</h3><h3>Before</h3><p>Disaster recovery for a large Databricks platform could require a lot of work outside Databricks.</p><p>For example:</p><pre>Primary Region<br>     │<br>     ├── Data<br>     ├── Unity Catalog objects<br>     ├── Jobs<br>     ├── Notebooks<br>     ├── Configurations<br>     └── Workspace assets<br>            ↓<br>    How do we recreate all of this?<br>            ↓<br>      Secondary Region</pre><p>Teams could build their own DR approach using infrastructure-as-code, storage replication, deployment pipelines and recovery procedures.</p><p>But that is a fair amount of engineering.</p><h3>What changed</h3><p>Databricks introduced <strong>Managed Disaster Recovery in Public Preview in June</strong>.</p><p>It can replicate Unity Catalog metadata, managed table data and workspace assets to a secondary region, and Databricks provides a stable URL across failover.</p><p>Databricks also introduced the <strong>Mission Critical workspace add-on</strong> in Public Preview alongside it.</p><h3>After</h3><p>Conceptually:</p><pre>                            Databricks<br>                                │<br>                      Managed DR / Replication<br>                                │<br>             Primary Region                Secondary Region<br>             ┌───────────────┐            ┌───────────────┐<br>             │ UC Metadata   │───────────►│ UC Metadata   │<br>             │ Managed Data  │───────────►│ Managed Data  │<br>             │ Workspace     │───────────►│ Workspace     │<br>             │ Assets        │───────────►│ Assets        │<br>             └───────────────┘            └───────────────┘<br></pre><h3>Why I think this matters</h3><p>This isn’t as exciting as AI or real-time processing, but from an architect’s point of view it is a big deal .</p><p>Once Databricks starts running operationally important workloads, someone eventually asks:</p><blockquote><em>“</em><strong><em>What happens if the region goes down?</em></strong><em>”</em></blockquote><p>Having more of the recovery process managed by the platform can simplify that architecture significantly.</p><p>I would still validate RTO, RPO, regional support, application dependencies and everything outside Databricks before calling a solution disaster-recovery ready.</p><h3>In Nutshell</h3><blockquote><em>“Managed DR is interesting because it starts removing some of the custom work we normally have to build around regional recovery. I wouldn’t assume it solves the entire DR problem, but it can take responsibility for a meaningful part of the Databricks platform.”</em></blockquote><h3>How I connect all of these releases</h3><p>If I had to summarize what I noticed after looking through the releases, I would put it this way:</p><pre>                    2026 Databricks   <br>                           │<br>       ┌───────────────────┼───────────────────┐<br>       │                   │                   │<br>      DATA              PLATFORM              AI<br>       │                   │                   │<br>   Lakeflow              ABAC             Genie Code<br>   Zerobus             Serverless       Supervisor Agent<br>   Real-Time           Iceberg          Unity Gateway<br>   Transactions        OpenSharing      MLflow Tracing<br>                           │<br>                           │<br>                      Managed DR</pre><p>The pattern I see is that Databricks is filling in more pieces around the core lakehouse.</p><p>It is no longer only a discussion around:</p><pre>        Spark<br>          +<br>        Delta Lake</pre><p>The architecture conversation now covers:</p><pre>        Ingestion<br>        Streaming<br>        Data Engineering<br>        SQL<br>        Governance<br>        Open Table Formats<br>        AI<br>        Agents<br>        AI Governance<br>        Observability<br>        Serverless<br>        Disaster Recovery</pre><p>I would describe that as <strong>my observation from the releases</strong>, not as an official Databricks statement.</p><h3>The five releases I would be most comfortable bringing up in a conversation</h3><p>If I don’t have much time, I would focus on these:</p><pre>1. ABAC<br>   → Governance at scale<br>2. Zerobus + Real-Time<br>   → Lower-latency architecture<br>3. Lakeflow + AUTO CDC<br>   → Simplifying the data engineering stack<br>4. Iceberg + OpenSharing<br>   → Interoperability and open architecture<br>5. Unity Gateway + MLflow Tracing<br>   → Enterprise AI governance</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f89aab3348d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Vector Databases Work?]]></title>
            <link>https://medium.com/@abhishekbhardwaj.ddn/how-vector-databases-work-f74f71e754c1?source=rss-2ca14c275dc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f74f71e754c1</guid>
            <category><![CDATA[indexing]]></category>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[ann]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Abhishek Bhardwaj]]></dc:creator>
            <pubDate>Thu, 10 Apr 2025 06:22:09 GMT</pubDate>
            <atom:updated>2025-04-11T12:46:43.107Z</atom:updated>
            <content:encoded><![CDATA[<p>Chapter -3</p><p>How does Vector Databases Work?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SqWNT6e6ZzLv2Go1" /><figcaption>Photo by <a href="https://unsplash.com/@marvelous?utm_source=medium&amp;utm_medium=referral">Marvin Meyer</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>3. How Vector Databases Work?</strong></h3><p>In previous chapters we learned about how <strong>Vector databases</strong> store and search information based on meaning, not exact words. They use <strong>embeddings</strong>, which are number lists (called <strong>vectors</strong>) that represent things like text, images, or videos. This helps in finding similar items using <strong>similarity search</strong>, which compares how close vectors are using math formulas like <strong>cosine</strong> or <strong>Euclidean distance</strong>. The <strong>k-nearest neighbors (k-NN)</strong> method finds the top “k” similar items.</p><p>Unlike traditional databases that search by exact values, vector databases work great for AI tasks like chatbots, recommendation engines, and smart searches. They’re used by developers, data scientists, and AI tools, and cloud providers like Google, AWS, and Azure offer different vector database options</p><p>With a Vector Database, we can give our AI systems extra knowledge, such as <strong>semantic information retrieval</strong> (finding content-based meaning, not exact words<strong>), long-term memory</strong> (remembering past data or conversions), and more.</p><p>The diagram below helps explain how vector databases play a role in these kinds of applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XI_NIggXJV1uE1z3Bw8Vyg.png" /><figcaption>Image: <a href="https://www.pinecone.io/learn/vector-database/">https://www.pinecone.io/learn/vector-database/</a></figcaption></figure><p>Let’s talk about the diagram above:</p><p><strong>First</strong>, we used the <strong>embedding model</strong> (an AI model that turn text, images, or other data into numbers) to create <strong>vector embeddings (</strong>list of numbers that captures meaning of the content<strong>) </strong>for the content we want to store.</p><p>We then insert these embeddings into Vector Database (a special kind of database that stores and searches using these number lists), along with a reference to the original content they came from.</p><p>When the <strong>Application </strong>sends a query (search input), we use the <strong>same embedding model</strong> to convert the query into vector embedding and search the database for similar vector embeddings (<strong>one close in the meaning</strong>). As we saw before, each similar embedding is connected to its original content, which we can now retrieve.</p><h4><strong>3.1 What is the difference between Vector Index and Vector Database?</strong></h4><p>A <strong>vector index</strong> is a data structure designed to efficiently organize and retrieve high-dimensional vector data. It enables quick similarity searches by arranging vector embeddings (numerical representation of data such as text, images, or audio) so that similar items are located near each other. This organization facilitates rapid and accurate searches within large datasets.</p><p>Standalone <strong>Vector Indices</strong> like <strong>FAISS (Facebook AI Similarity Search, </strong>a tool for finding similar items quickly) can make searching through data faster. However, they miss features that regular databases have.</p><p><strong>Vector Databases</strong> are made to handle vector embeddings, <strong>offering several benefits</strong> over standalone vector indices:</p><ol><li><strong>Data Management:</strong></li></ol><p>Vector databases let you easily <strong>insert (add)</strong>, <strong>delete (remove),</strong> and <strong>update (change) </strong>data, making it simpler to manage. <strong>In contrast</strong>, tools like <strong>FAISS</strong> need extra steps to work with storage systems.</p><p><strong>2. Metadata Storage and Filtering</strong>:</p><p>They can store metadata (extra information about data) with each vector. This allows users to search using specific filters, leading to more precise results.</p><p><strong>3. Scalability</strong>:</p><p>Vector Databases are built to handle growing amounts of data and more users. They support <strong>distributed processing (spreading tasks across multiple computers), </strong>making them more scalable. <strong>Standalone indices</strong> might need custom setups to achieve this.</p><p>4. <strong>Real-time updates</strong>:</p><p>They support immediate data updates, so changes are reflected quickly.</p><p><strong><em>Standalone indices</em></strong> are often require reprocessing the entire dataset to include new data, which can be slow and resource-intensive.</p><p><strong>5. Backup and Collections</strong>:</p><p>Vector databases can automatically backup data.</p><p><strong>For example</strong>, some systems allow users to create “<strong>collections</strong>” that have specific <strong>datasets for future use</strong>.</p><p><strong>6. Ecosystem Integration</strong>:</p><p>They easily <strong>connect with other data tools and workflows</strong>, such as ETL pipelines and analytics platforms. This simplifies data management and enhances functionality.</p><p><strong>7. Data Security and Access Control</strong>:</p><p>Vector databases offer built-in feature to protect to sensitive information and control who can access the data. This level of security is often missing in standalone vector index solutions.</p><p>Now, we have good understanding about the indices and how Vector databases are better.</p><p>Let’s discuss the <strong>working of Vector Databases</strong>.</p><p>By now, we all know that <strong>traditional databases</strong> store things like <strong>text, numbers, and dates</strong> in rows and columns. They are great for <strong>exact matches, </strong>like “find all users where name = ‘Abhishek’.</p><p>But vector database works differently. It stores and searches through vectors. So instead of exact matching, it uses <strong>similarity metrics </strong>(math formulas like Cosine Similarity and Euclidean distance) to find vectors that are <strong>most like</strong> the one you’re searching for.</p><p>To do this, vector databases use <strong>Approximate Nearest Neighbor (ANN) search. </strong>This means they quickly find vectors that are close enough, even if not 100% exact. ANN uses smart techniques like <strong>hashing (grouping data using short codes), quantization (compressing the vector data), </strong>or<strong> graph-based search (connecting nearby vectors like a map)</strong> to make searches fast.</p><p>These steps are organized into a <strong>pipeline</strong>, which is a series of actions the database follows to return results quickly and accurately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n-4PwUHGnZg3rpExZfcYbA.png" /><figcaption><strong>Vector Database Pipeline</strong></figcaption></figure><h4><strong>Vector Database Pipeline</strong>:</h4><ol><li><strong>Indexing</strong>:</li></ol><p>Database prepares vectors for fast searching by organizing them using algorithms like:</p><ul><li><strong>PQ </strong>(Product Quantization — Compresses vectors)</li><li><strong>LSH </strong>(Locality-Sensitive Hashing — Groups Similar Vectors)</li><li><strong>HNSW </strong>(Hierarchical Navigable Small World — Connects vectors like a network or graph)</li></ul><p><strong>2. Querying</strong>:</p><p>When you search, the database converts your input into vector (called a query vector) and compares it to the <strong>indexed vectors</strong> using <strong>similarity metrics</strong> to find the nearest ones.</p><p><strong>3. Post-processing</strong>:</p><p>After finding the closest vectors, it may do extra steps <strong>like re-ranking the results</strong> to make them more accurate using another similarity check.</p><h4><strong>3.2 How Data is Converted to Vectors?</strong></h4><p>First, pick the type of data you want to vectorize:</p><ul><li><strong>Text</strong>: using NLP Models</li><li><strong>Images</strong>: using CNN and CLIP models</li><li><strong>Audio</strong>: using Speech Embeddings</li><li><strong>Structured Data</strong>: using feature vectors</li></ul><p>Let’s take an example of <strong>Text data</strong> which is easy to show here.</p><p>— Use and<strong> Embedding model </strong>that takes input and outputs a vector</p><p><strong>Examples</strong>:</p><ul><li>OpenAi’s <strong>text-embedding-ada-002</strong></li><li>HuggingFace’s <strong>sentence-transformer</strong></li><li>Google’s <strong>Universal Sentence Encoder</strong></li></ul><p>Let’s take a look at simple code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*zhE7MeulNWcvwo7TQDo3MQ.png" /><figcaption>Example from ChatGPT</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dWtwjpKUZlx_tttNt4tuEA.png" /></figure><h4><strong>3.3 Indexing and Search Process</strong></h4><p>We have already talked about indexing previously. To recap, indexing prepares the vectors for fast searching.</p><p>After we generate vector embeddings, the vector database needs to organize them in a way that makes searching fast. This is called <strong>indexing</strong>.</p><p><strong>Indexing</strong> — The database uses <strong>ANN (Approximate Nearest Neighbors)</strong> to build the index.</p><p><strong>Search</strong> — When user submits a search (like a question or image), the system:</p><blockquote>Converts the query into vector using the same embedding model.</blockquote><blockquote>Compares it to vectors in the index using a similarity metrics (e.g. Cosine similarity or Euclidean Distance).</blockquote><blockquote>Returns the most similar items (Called nearest neighbors)</blockquote><p><strong>Post-processing</strong> (optional)- Some databases do extra work after search:</p><blockquote><strong>Re-ranking</strong>: Sort results again using a more accurate metric.</blockquote><blockquote><strong>Filtering</strong>: Apply rules using metadata (e.g., filter by language or category)</blockquote><blockquote><strong>Hybrid Search</strong>: Combine Vector + Keyword search</blockquote><p>Let’s take a look at an example code.</p><p>We will see ANN in practice, ANN based index — <strong>IndexHNSWFlat </strong>(Popular graph-based ANN Algorithm)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*9XYKnUJR45C_Ed5Ax9t_Zw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*KQ8Tw0jqiuV84fQ5qFOhAg.png" /></figure><p><strong>Expected Console Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*B-G60gdeHqFhouXq6OzGoQ.png" /></figure><p><strong>Why this Output?</strong></p><p>The query is about places in Europe. The most semantically similar sentences are:</p><ul><li>“The Eiffel Tower is in Paris.”</li><li>“The Colosseum is in Rome.”</li></ul><blockquote>“The Taj Mahal is in India”, is <strong>somewhat related</strong>, so it comes third.</blockquote><blockquote>Cats and dogs are<strong> ignored</strong>.</blockquote><p>References:</p><ul><li><a href="https://www.pinecone.io/learn/vector-database/">What is a Vector Database &amp; How Does it Work? Use Cases + Examples | Pinecone</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f74f71e754c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vector Datbases — Chapter-2: Core Concepts]]></title>
            <link>https://medium.com/@abhishekbhardwaj.ddn/vector-datbases-chapter-2-core-concepts-8ecfc3f193d3?source=rss-2ca14c275dc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ecfc3f193d3</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Abhishek Bhardwaj]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 05:10:51 GMT</pubDate>
            <atom:updated>2025-04-10T05:59:04.558Z</atom:updated>
            <content:encoded><![CDATA[<p>Core Concepts</p><h3>Vector Databases — Chapter-2</h3><p>Part-2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvBNDxqmeYQgvj5kuGji8w.png" /><figcaption>Image: <a href="https://learn.microsoft.com/en-us/data-engineering/playbook/images/intro_file_processing.png">https://learn.microsoft.com/en-us/data-engineering/playbook/images/intro_file_processing.png</a></figcaption></figure><h3><strong>2. Core Concepts</strong></h3><p>We have read about the basic concepts in our introduction chapter about Vector Databases. We know that these are the special kind of database designed to handle data in the form of vectors (<strong>list of numbers</strong>) that <strong>represent the information</strong>. These databases are great for tasks like <strong>finding similar items</strong>, such as <strong>recommending products</strong> or <strong>searching for similar images</strong>. Now, we will talk about the core concepts in a simplest way possible.</p><h4><strong>2.1</strong> <strong>What are Vectors?</strong></h4><p>In mathematics and physics, the term vectors is colloquially (used in everyday life, informal term) to quantities. These are those quantities that cannot be expressed using single number (a scalar).</p><p>Let’s take an example of an arrow, A→B, Imagine, an arrow connecting an initial point A with Terminal point B, that arrow is a vector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*pgqV5w8QTnoWltt1nbVn0Q.png" /><figcaption>Vector Space</figcaption></figure><p>This image shows a vector space, like a map with arrows pointing to different data points. Each arrow (vector) represents something meaningful. All arrows starting from a common point (origin), and their direction and length shows their <strong>meaning and</strong> <strong>relationships</strong>.</p><p>Vectors pointing in <strong>similar direction</strong> meaning data is <strong>similar</strong> <strong>in meaning. </strong>This is how Vector Database finds related items (by checking which Vector/arrow are closest).</p><h4><strong>2.2</strong> <strong>What is a vector’s dimension?</strong></h4><p>Dimension is something which tells us how many directions we can move or measure something. Let’s understand using example:</p><p>· A line is 1D (<strong>One-Dimensional</strong>) — You need only one number to show a point (like 4 on a number line.)</p><p>· A flat surface (like a map or a piece of paper) is <strong>2D</strong> — You need two numbers to find a spot (Like Latitude and longitude).</p><p>· A cube or a room is <strong>3D</strong> — you need 3 numbers (Like where is something in your room).</p><p>In Vector databases, vector can have hundreds or even thousands of dimensions. Each dimension is like a tiny piece of information. Together, they describe something fully (like the meaning of the sentence)</p><p>e.g.</p><p>Let’s describe an apple using features:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*YyfbaoeWbbVSxtmueP0bOA.png" /><figcaption>Features of Apple</figcaption></figure><p>So, Apple becomes the vector like this — [1, 0.8, 0.5, 0.9, 0.7]</p><p>Now, let’s take orange — [0.7, 0.9, 0.6, 0.3, 1.0]</p><p>Now, if you see the list, these are the list of features, currently 5 features hence 5D.</p><h4><strong>2.3</strong> <strong>What are Embeddings?</strong></h4><p>You might have heard about <strong>embeddings</strong>, these are number/numeric encodings for the data we deal with.</p><p>AI/ML has enabled us to use ML models for these embeddings and we call them <strong>Embedding Models</strong>.</p><p>These embeddings <strong>encode</strong> all sort of data into <strong>vectors</strong> (list of numbers). These vectors capture the meaning or context of the piece of data also known as <strong>asset</strong>.</p><p>Let’s take an example of embedding:</p><p><strong>“Apple</strong> is a fruit” → [<strong>0.134</strong>, -0.888, 0.298, …]</p><p><strong>“Apple</strong> is a company” → [<strong>0.872</strong>, 0.541, -0.102, …]</p><p>Here, in example you will notice that “<strong>Apple</strong>” being same word in both sentences but has different text embeddings. It is because <strong>context</strong> is different.</p><p>Embeddings allows us to find similar assets by searching for neighboring data points.</p><p>Have you ever tried taking a photograph from your phone and searching for similar images, if yes then you have used a unique feature i.e. <strong>Vector Search method</strong>.</p><p>Embeddings capture the semantic relationships between words or documents by mapping them to continuous vector representations. In such a way, similar words or documents are closer together in a vector space.</p><h4><strong>2.4</strong> <strong>What is Similarity Search?</strong></h4><p>Similarity search meaning finding things that are most alike to something you already have.</p><p><strong>Example</strong>: You asked, “<em>Show me movies like Twister</em>”. The system will search for similar movies. Maybe it will show you something like “Geostorm”. This is called Similarity search.</p><p><strong>How does it work?</strong></p><p>1. Each item is turned into a vector (a list of numbers).</p><p>2. Your query is also turned into a vector.</p><p>3. The system compares these vectors to see which ones are closest.</p><p>4. It shows you the most similar ones.</p><blockquote>Close vectors = Similar items<br> Far vectors = Different items</blockquote><p>When you search using a vector (like a sentence or image), the vector search engine looks for other vectors that are most similar — like finding friends with similar interests.</p><p>Depending how the data is stored, it may check in two ways:</p><p>· Check <strong>Everything</strong>, which is <strong>slower</strong> but accurate.</p><p>· Check <strong>close neighbors</strong> only, which <strong>faster</strong> but bit <strong>less accurate</strong>.</p><p>Then it gives you a score for each result, <strong>higher score = more similar</strong></p><p>Let’s understand a bit more details how these searches work using different method in <strong>next sections</strong>.</p><p>Key Algorithms used in Vector search are, <strong>k-NN, ANN, HNSW.</strong></p><h4><strong>2.5</strong> <strong>What is k-Nearest Neighbors (k-NN)?</strong></h4><p>This is commonly used in Classification and Regression problems.</p><p>Think of it like this:</p><p>“<em>Let’s find the exact 3 (or K) closest people to you in a crowd who loves spicy food</em>”</p><p><strong>k-NN</strong> will search every person and find the 3 who matches the best.</p><p>· Its accurate but slower with lots of data.</p><h4><strong>2.6</strong> <strong>What are Approximate Nearest Neighbors (ANN)?</strong></h4><p><strong>ANN</strong> is an algorithm that finds the approximate nearest neighbors in the large datasets.</p><p>This is like:</p><p>“<em>Quickly guess, who eats spicy in the crowd, </em><strong><em>find the close enough</em></strong>”</p><p><strong>Example</strong>: You’re in a big city and want similar restaurants. ANN gives you a <strong>pretty close match</strong>, even if not the absolute closest.</p><blockquote>· Much faster</blockquote><blockquote>· Useful for <strong>very big datasets</strong></blockquote><blockquote>· Slightly less accurate, but usually good enough</blockquote><p>Both <strong>KNN and ANN</strong> are algorithms <strong>based on distance measurements</strong> to find the nearest neighbors. KNN finds the exact nearest neighbors, while ANN finds the approximate nearest neighbors. ANN can significantly improve search efficiency then KNN when dealing with massive data, especially in high-dimensional space searches.</p><h4><strong>2.7</strong> <strong>What are HNSW (Hierarchical Navigable Small World)</strong></h4><p>This is a smart shortcut system.</p><p>Imagine you are in a city with a map of neighborhoods. Instead of checking every house (like KNN), you jump through layers: Cities  AreasStreetsHomes</p><p>· <strong>HNSW</strong> builds a <strong>graph</strong> (like connected maps).</p><p>· It helps you <strong>navigate faster</strong> to find good matches.</p><p>· This balances <strong>speed and accuracy</strong> very well</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*RvtKwHphNAHuNLEONUf69g.png" /><figcaption>HNSW</figcaption></figure><h4><strong>Which One Should You Use?</strong></h4><blockquote>· <strong>KNN</strong> — Best for small, exact searches</blockquote><blockquote>· <strong>ANN</strong> — Great for fast search in large datasets</blockquote><blockquote>· <strong>HNSW</strong> — Smart and fast for most real-world searches (recommended in tools like Azure AI Search)</blockquote><h4><strong>2.8</strong> <strong>How does Indexing benefits in Vector Search?</strong></h4><p>Indexing is like a shortcut that helps the computer find similar vector faster — instead of finding every item one by one.</p><p>Imagine a Library:</p><p>o <strong>Without an index</strong>: You check every book to find the one you want.</p><p>o <strong>With an Index</strong>: You go the right shelf directly.</p><p>In vector search, an index helps you search smarter and faster</p><p>Types of Vector indexes:</p><h4><strong>1. Flat Index:</strong></h4><p>Think: looking through every book in the whole library.</p><blockquote>No shortcut, checks every vector one by one.</blockquote><blockquote>Very accurate, but slow.</blockquote><blockquote>Used to compare, how well other indexes work.</blockquote><h4><strong>2.</strong> <strong>IVF (Inverted File):</strong></h4><p>Think: dividing books by genre (like mystery, history, sci-fi)</p><blockquote>Breaks data into groups (clusters)</blockquote><blockquote>Search only in the relevant group, not the whole set.</blockquote><blockquote>Much faster thank the flat Index.</blockquote><ul><li>Often used with Product Quantization (PQ) to further improve search performance, especially in high dimensions.</li></ul><h4><strong>3.</strong> <strong>VPT (Vantage Point Tree):</strong></h4><p>Think: picking one key book and saying “<em>find books close to this one</em>”</p><blockquote>Chooses a vantage point and checks which data is closer of farther.</blockquote><blockquote>Splits data based on this distance.</blockquote><blockquote>Works well when you have few features (low dimensions)</blockquote><blockquote>Not great for complex or high-dimensional data</blockquote><p><strong>Summary Table:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2lu3OSdik-O9R_Ti06zHvA.png" /></figure><h4><strong>2.9</strong> <strong>Common Distance Metrics (Cosine, Euclidean)</strong></h4><p>In vector search, we compare vectors (like [1, 0.5, 0.8]) to find out how similar or different they are.<br> We use distance metrics to measure how “far apart” two vectors are.</p><blockquote>Closer = more similar<br>Farther = less similar</blockquote><h4>Two Most Common Distance Metrics</h4><blockquote>1. <strong>Euclidean Distance (Straight-Line Distance)</strong></blockquote><p><strong>Idea</strong>: “How far are two points in space?”</p><p><strong>Example</strong>:</p><p>· Point A: (1, 2)</p><p>· Point B: (4, 6)</p><p><strong>Euclidean Distance</strong> = √[(4–1)² + (6–2)²] = √(9 + 16) = √25 = <strong>5</strong></p><p>Think of it like a ruler measuring the <strong>straight-line distance</strong> between two dots on paper.</p><p><strong>Good when</strong>:</p><blockquote>· You care about <strong>actual size or magnitude</strong></blockquote><blockquote>· The data is in the <strong>same scale</strong>.</blockquote><p><strong>2.</strong> <strong>Cosine Similarity (Angle-Based Distance)</strong></p><p><strong>Idea: “</strong>How similar are the directions of two arrows?”</p><p><strong>Example:</strong></p><p>· If two vectors point in the same direction, the angle between them is small → very similar</p><p>· If they point in opposite directions, the angle is large → not similar</p><p><strong>Cosine Similarity = </strong>Cos(θ)</p><p>· 1 = Exactly the same direction</p><p>· 0 = Completely different direction</p><p>· -1 = Opposite direction</p><p><strong>Cosine Distance</strong> = 1 — Cosine Similarity</p><h4><strong>Good when</strong>:</h4><blockquote>· You care about <strong>meaning</strong>, not size (like in text or documents)</blockquote><blockquote>· Data has <strong>different magnitude</strong></blockquote><p><strong>Summary Table</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LCpZZ63i-eSZrJ7RnEn_MA.png" /></figure><h3><strong>References:</strong></h3><h4>· <a href="https://cloud.google.com/discover/what-is-a-vector-database"><strong>https://cloud.google.com/discover/what-is-a-vector-database</strong></a></h4><h4>· <a href="https://aws.amazon.com/what-is/vector-databases/"><strong>https://aws.amazon.com/what-is/vector-databases/</strong></a></h4><h4>· <a href="https://learn.microsoft.com/en-us/data-engineering/playbook/solutions/vector-database/"><strong>https://learn.microsoft.com/en-us/data-engineering/playbook/solutions/vector-database/</strong></a></h4><h4>· <a href="https://en.wikipedia.org/wiki/Vector_space"><strong>https://en.wikipedia.org/wiki/Vector_space</strong></a></h4><h4>· <a href="https://www.cuemath.com/euclidean-distance-formula/"><strong>https://www.cuemath.com/euclidean-distance-formula/</strong></a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ecfc3f193d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vector Databases - 1]]></title>
            <link>https://medium.com/@abhishekbhardwaj.ddn/part-1-cff7ea53d9aa?source=rss-2ca14c275dc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cff7ea53d9aa</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[mls]]></category>
            <dc:creator><![CDATA[Abhishek Bhardwaj]]></dc:creator>
            <pubDate>Wed, 02 Apr 2025 04:09:54 GMT</pubDate>
            <atom:updated>2025-04-10T05:59:50.604Z</atom:updated>
            <content:encoded><![CDATA[<p>Introduction</p><h3>Vector Databases — Chapter-1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mwG7Dl3EcxBTtMGp" /><figcaption>Photo by <a href="https://unsplash.com/@kommumikation?utm_source=medium&amp;utm_medium=referral">Mika Baumeister</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>1.</strong> <strong>Introduction to Vector Databases</strong></h3><p>Every day we hear about vector databases. These are mostly discussed in relation to the AI landscape. Let’s understand what these are and why these are so important.</p><p>I promise, like always I will be explaining in very simple language.</p><h3><strong>1.1</strong> <strong>What are Vector Databases</strong>?</h3><p>We know that there are many sources of information/data, some are structured and some unstructured.</p><p><strong>Unstructured</strong> can be text documents, rich media(video, flash files etc.), and audio.</p><p><strong>Structured</strong> can be application logs, tables, and graphs(Graph Data Structures).</p><p><strong>Vector Database</strong> is a special kind of database that is designed to <strong>store</strong>, <strong>search</strong>, and <strong>retrieve</strong> high dimensional vectors. High dimensional vectors usually generated from unstructured data like text, images, audio or video.</p><p>These vectors are just numerical representation of data, often generated by machine learning models or embeddings(CLIP, BERT etc).</p><p>These databases make it fast and easy to find similar items, even when working with high dimensional data (data with many features).</p><p>They use smart algorithms like <strong>k-nearest neighbors</strong> (k-NN) to search the closest matches. We have few more popular methods like <strong>HNSW</strong> (<strong>Hierarchical Navigable Small World</strong>) and <strong>IVF (Inverted File Index)</strong>, which helps speed up the search.</p><p>Besides just storing your and searching vectors, these databases also offer extra features like:</p><p>· Managing the data</p><p>· Keeping it safe if something goes wrong (fault tolerance)</p><p>· Controlling who can access it (authentication and access control)</p><p>· Letting you run powerful search queries.</p><h3><strong>1.2. Why vector databases are important / Why use a vector database?</strong></h3><ul><li>Mostly vector databases are used by developers. Developers can store vectors (created from text, images, etc. using embeddings) into vector database. This makes it easy to find similar items by searching for vectors that are close to each other.</li></ul><p>Vector database helps you put embedding models to work in real applications. They make it easier to build smart apps by offering useful features like :</p><p>1. <strong>Managing resources </strong>(so the system run smoothly)</p><p>2. <strong>Keeping data secure</strong> with access controls</p><p>3. <strong>Scaling up </strong>to Handle more data or users</p><p>4. <strong>Recovering</strong> <strong>from failures</strong> (fault tolerance)</p><p>5. <strong>Finding information quickly</strong> using powerful search tools.</p><p>All this makes app development <strong>faster and more efficien</strong>t when working with vector data from embeddings.</p><ul><li>Developers can use machine learning models to automatically pull-out useful information (<strong>metadata</strong>) from things like images or scanned documents. They can store this metadata along with the vector data, so the app can search using both keyword and meaning. This is called <strong>hybrid search</strong>.</li></ul><p>They can also use the meaning (or semantic understanding) of the content to make search results more accurate and useful.</p><ul><li><strong>Generative AI models</strong> can some time <strong>makeup things</strong> — this is called <strong>hallucination</strong>. It means the chatbot might give wrong or made-up answers. To fix this, we can use vector databases to help.</li></ul><p>A vector database can act like an external memory filled with real, trustworthy information. When chatbot gets a question, it can look in the database to find the accurate answers and then respond based on that. This helps chatbot gives better and more reliable responses.</p><h3><strong>1.3 How are Vector Databases used?</strong></h3><ul><li>Vector databases are mostly used to make smart searches better — like searching by meaning, by images, or using multiple types of data (like text + image together).</li></ul><p>Now, they are also being used with generative AI models (like ChatGPT) to built intelligent chatbots. These chatbots can have helpful, human-like conversations and give answers based on real information from the database.</p><ul><li>In development process, the first step is to create an <strong>embedding model</strong> that can turn things like <strong>product images</strong> into <strong>vectors</strong> (which are just list of numbers that capture what the image looks like).</li></ul><p>Bringing all this image data and turning it into vectors is called <strong>Data Hydration</strong>.</p><p>Once this is done, the <strong>developer can build an app</strong> where users can upload a product image. The app will <strong>turn into a vector</strong>, search the <strong>vector database</strong> and <strong>find similar-looking products</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*5Rm2H5H4LOJh8OEW2WQ_Xg.png" /></figure><p>Inside the model, a method called <strong>k-nearest neighbors (k-NN)</strong> helps quickly <strong>find the most similar vectors</strong>.</p><p>It uses <strong>distance formula (like cosine similarity</strong>) to compare vectors and <strong>rank them by how close or similar they are</strong>.</p><p>This makes it fast and easy to show the <strong>best matching results</strong> first.</p><h3><strong>1.4 Who uses Vector Databases?</strong></h3><p>Vector databases are helpful for developers who want to build smart search features — like searching by meaning not keywords.</p><p>A developer can use ready-made AI models or auto-ML tools to turn things like text or images into vectors (embeddings), and then load them into vector database. This doesn’t need deep machine learning knowledge.</p><p>If a company has data scientist and engineers, they can create more advanced, fined-tuned embeddings and use the vector database to build the AI feature faster.</p><p>For Operations team, managing a vactor database feels familiar — like managing regular database — so they can use same tools and processes they already know.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*hwVFknsuj5B6m7JdPVKJBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*-WatbIMgdFETk832xAPmZw.png" /></figure><h3><strong>1.5 Key differences between Traditional Databases and Vector Databases</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PIYZGP80_gT_GwIEzwjm-w.png" /></figure><h3><strong>1.6 Benefits of Vector Databases?</strong></h3><p><strong>Vector databases</strong> are important because they can solve problems that <strong>regular databases and keyword searches can’t handle well</strong>.</p><p>They work great with <strong>generative AI</strong> (like ChatGPT), because they help find <strong>useful information</strong> — like old chat messages or business documents — to help the AI <strong>give better answers</strong> to hard questions.</p><p>They also let you:</p><p>· <strong>Search using natural language</strong> (ask a question like a human)</p><p>· <strong>Search by example</strong> (like uploading a photo to find similar ones)</p><h3><strong>1.7 Vector Database Options by Cloud Provider</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQQL3JfkXqNaDjtfAIVIDg.png" /></figure><blockquote><strong>References</strong>:</blockquote><blockquote><a href="https://cloud.google.com/discover/what-is-a-vector-database">https://cloud.google.com/discover/what-is-a-vector-database</a></blockquote><blockquote><a href="https://aws.amazon.com/what-is/vector-databases/">https://aws.amazon.com/what-is/vector-databases/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cff7ea53d9aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[yet related, not same]]></title>
            <link>https://medium.com/@abhishekbhardwaj.ddn/yet-related-not-same-cf41d63100e1?source=rss-2ca14c275dc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf41d63100e1</guid>
            <category><![CDATA[comparison]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Abhishek Bhardwaj]]></dc:creator>
            <pubDate>Tue, 04 Feb 2025 03:04:59 GMT</pubDate>
            <atom:updated>2025-02-04T03:04:59.931Z</atom:updated>
            <content:encoded><![CDATA[<p>yet related, not same</p><h3>AI Agents vs. Agentic AI</h3><h3>Understanding the Key Differences</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TUd_U9yqgtCnrAdZ" /><figcaption>Photo by <a href="https://unsplash.com/@santesson89?utm_source=medium&amp;utm_medium=referral">Andrea De Santis</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>AI agents are a hot topic today, and many people use the term <strong>Agentic AI</strong> interchangeably, assuming they are the same. While they are related, they are <strong>not identical</strong>.</p><p>In this article, let’s explore the <strong>key differences</strong> between <strong>AI Agents</strong> and <strong>Agentic AI</strong>, both from a <strong>conceptual and technical perspective</strong>.</p><h3>What is an AI Agent? (Basic AI)</h3><p>Think of an <strong>AI agent</strong> as a <strong>smart assistant</strong> that does a <strong>specific job</strong> based on a set of rules or training. It follows <strong>clear instructions</strong> and doesn’t take initiative on its own.</p><h3>Examples of AI Agents</h3><p>✔ A chatbot that answers customer questions.<br> ✔ Google Maps suggesting the fastest route.<br> ✔ Siri setting an alarm when you ask.</p><p>These <strong>AI agents are reactive</strong>, meaning they respond <strong>only when commanded</strong> and do not act independently.</p><h3>What is Agentic AI? (Advanced &amp; Autonomous AI)</h3><p>Now, <strong>Agentic AI</strong> is like an AI with a <strong>brain that thinks and plans</strong>. Unlike AI agents, <strong>Agentic AI does not wait for orders</strong> — it figures out what to do next based on a goal.</p><h3>Examples of Agentic AI</h3><p>✔ An <strong>AI personal assistant</strong> that schedules your meetings, plans your workday, and even reminds you to take breaks — <strong>without you asking</strong>.<br> ✔ A <strong>trading bot</strong> that watches the stock market, analyzes trends, and <strong>makes smart investment decisions</strong> on its own.<br> ✔ A <strong>self-driving car</strong> that doesn’t just follow a fixed route but adapts to <strong>traffic, road closures, and weather conditions</strong>.</p><p><strong>Agentic AI is independent, proactive, and adaptable — far beyond the capabilities of a traditional AI agent.</strong></p><h3>Key Difference at a Glance</h3><p><strong>Feature</strong> <strong>AI Agent (Reactive)</strong> <strong>Agentic AI (Autonomous)</strong> <strong>Decision-making</strong> Follows rules, reacts to commands Thinks, plans, and acts on its own <strong>Memory</strong> No memory, stateless Uses past experiences, stateful <strong>Autonomy</strong> Requires human prompts Self-driven, proactive <strong>Adaptability</strong> Fixed response patterns Learns from real-time feedback <strong>Long-term Planning</strong> Not capable Plans multiple steps ahead <strong>Multi-agent Interaction</strong> Limited or none Can collaborate with other agents <strong>Examples</strong> Chatbots, Basic Automation Self-driving cars, AI assistants</p><h3>Technical Differences Between AI Agent and Agentic AI</h3><p>While both <strong>AI Agent and Agentic AI involve artificial intelligence</strong>, they differ significantly in their <strong>architecture, autonomy, decision-making capabilities, and adaptability</strong>.</p><h3>AI Agent (Reactive AI) — How It Works</h3><p>📌 <strong>Definition</strong>:<br> An <strong>AI system</strong> that performs a <strong>specific task</strong> based on <strong>predefined rules</strong> or <strong>machine learning models</strong>.</p><p>📌 <strong>Key Technical Aspects</strong>:</p><ul><li>Operates <strong>within a defined framework</strong> or <strong>decision tree</strong>.</li><li><strong>No long-term planning</strong> — only executes immediate tasks.</li><li>Uses <strong>supervised learning</strong> or <strong>predefined logic</strong>.</li><li><strong>Limited autonomy</strong> — only reacts to inputs, doesn’t take initiative.</li><li>Integrates with <strong>databases, NLP models, and APIs</strong>.</li></ul><p>📌 <strong>Technical Stack Examples</strong>:<br> ✅ <strong>Algorithms</strong>: Decision Trees, Rule-Based Systems, Logistic Regression, Random Forests.<br> ✅ <strong>Technologies</strong>: Chatbots (Dialogflow, Rasa), Recommendation Systems, Virtual Assistants (Alexa, Siri).<br> ✅ <strong>Data Handling</strong>: Works with <strong>structured data</strong> and predefined inputs.</p><h3>Agentic AI (Autonomous AI) — How It Works</h3><p>📌 <strong>Definition</strong>:<br> A <strong>self-driven AI system</strong> that can <strong>plan actions, adapt dynamically, and make decisions without human intervention</strong>.</p><p>📌 <strong>Key Technical Aspects</strong>:</p><ul><li>Uses <strong>Reinforcement Learning (RL)</strong> to <strong>optimize</strong> actions over time.</li><li><strong>Memory &amp; Context Awareness</strong> — learns from past actions.</li><li><strong>Self-Correction</strong> — adjusts its approach based on feedback.</li><li><strong>Autonomous Decision-Making</strong> — doesn’t require constant human input.</li><li><strong>Multi-Agent Collaboration</strong> — can interact with other AI agents.</li></ul><p>📌 <strong>Technical Stack Examples</strong>:<br> ✅ <strong>Algorithms</strong>: Deep Reinforcement Learning (DQN, PPO, A3C), Large Language Models (GPT, Gemini, Claude).<br> ✅ <strong>Technologies</strong>: Self-driving cars, AI-driven investment advisors, robotics, AI-powered game characters.<br> ✅ <strong>Data Handling</strong>: Processes <strong>structured, semi-structured, and unstructured data</strong> in real-time.</p><h3>Conclusion: Which One Do You Need?</h3><p>✔ If you need <strong>simple, rule-based AI</strong> → <strong>AI Agent is enough</strong>.<br> ✔ If you need <strong>independent, decision-making AI</strong> → <strong>Agentic AI is the future</strong>.</p><p>AI agents are <strong>useful for automation</strong> and handling <strong>repetitive tasks</strong>, while <strong>Agentic AI is a step toward artificial general intelligence (AGI)</strong>, capable of <strong>autonomous thinking and adaptation</strong>.</p><p>As AI evolves, <strong>Agentic AI will become the foundation</strong> for <strong>truly intelligent, decision-making machines.</strong> 🚀</p><h3>Final Thoughts</h3><p>Do you think <strong>Agentic AI</strong> will replace <strong>traditional AI agents</strong> in the near future? Let’s discuss in the comments! 👇💡</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf41d63100e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Agents — Simplified]]></title>
            <link>https://medium.com/@abhishekbhardwaj.ddn/ai-agents-simplified-707ca8905119?source=rss-2ca14c275dc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/707ca8905119</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Abhishek Bhardwaj]]></dc:creator>
            <pubDate>Mon, 03 Feb 2025 01:54:05 GMT</pubDate>
            <atom:updated>2025-02-03T02:14:27.015Z</atom:updated>
            <content:encoded><![CDATA[<h4>Emotionally Adaptive Narrative Generator</h4><h3>AI Agents — Simplified</h3><h4>Understanding AI Agents in Theory</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FRR8EsfOWqRASzp6" /><figcaption>Photo by <a href="https://unsplash.com/@omilaev?utm_source=medium&amp;utm_medium=referral">Igor Omilaev</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I am not a GenAI expert but a learner who likes to simplify things. I have gone through many articles, posts and ebooks talking about Agents and at first I was little confused as the terms and language they use is very brain heavy (They seem like experts in Agentic AI feild). In this short book I am not going to show complex code which personally I dont think is the need of an hour. We will understand the basics, components and intent behind Agents.</p><p>I will also discuss a use-case which is hypothetical, complex and yet achievable with research and hard work.</p><p>Please feel free to comment and help me grow as I am just learning and sharing.</p><h3>What is an AI Agent?</h3><p><strong>Copilot</strong>. <strong>“</strong>Collaborative partner that augments decision-making and execution while ensuring human oversight remains central.<strong>”</strong></p><p>OR</p><p>It is a computer program designed to perform tasks on its own, without needing human intervention. It can observe its surroundings, make decisions based on the information it gathers, and take actions to achieve specific goals. For example, an AI agent might help schedule your appointments by checking your calendar and setting up meetings automatically.</p><p>OR</p><p>AI Agents are autonomous systems designed to perform tasks or make decisions based on input, context, and access to tools and data.</p><p>All the above definitions means the same thing but different way of saying, here its an <em>augmentation</em> of the definition of AI Agent.</p><p>What makes AI Agents so different. Let’s discuss its components:</p><h3>Components of AI Agents:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*SAqYUaEDfi9bYOGj0sHQBg.png" /><figcaption>General agent architecture and components (Image: Google Whitepaper — Agents )</figcaption></figure><p><strong>Model</strong> (Central Decision-making unit)</p><p>The model is the central decision-making unit in an AI agent architecture because it serves as the core processor that integrates reasoning, logic, and knowledge to guide the agent’s actions.</p><p>The model uses reasoning frameworks such as <strong>ReAct</strong>, <strong>Chain-of-Thought</strong> (CoT), or <strong>Tree-of-Thoughts</strong> (ToT). There are more (e.g. <strong>Self-Consistency, maieutic prompting and Least-to-Most Prompting</strong>), but we are dicussing them being the central topics in current AI research and discussions.</p><blockquote><strong>ReAct (Reasoning + Acting):</strong></blockquote><p>Think of it like a detective solving a mystery step by step.</p><ul><li><em>Reasoning</em>: Model thinks about what user wants and best way to solve it.</li><li><em>Acting</em>: It takes an action based on its reasoning (e.g. searching for information or using a tool)</li></ul><p><em>This back-and-forth process repeats until it gets the final answer.</em></p><p>Let’s take an <strong>example</strong>:</p><p><em>Question</em>: “What is weather of New York?”</p><p><em>Thought</em>: “I need real-time information.”</p><p><em>Action</em>: Calls a weather API.</p><p><em>Observation</em>: Gets the weather.</p><p><em>Final Answer</em>: <strong>“It’s sunny in New York.”</strong></p><blockquote><strong>Chain-of-Thought (CoT):</strong></blockquote><p>Imagine explaining your solution to a math problem out loud, <strong>step by step</strong>.</p><ul><li>The model breaks down its thinking into smaller, clear steps to reason through the problem logically.</li><li>It’s like showing your work in a math test.</li></ul><p><strong>Let’s understand through an example</strong>:</p><p><em>Question</em>: “If I have $10, and I spend $3 on apples and $4 on bananas, how much is left?”</p><p><strong>CoT Steps</strong>:</p><ol><li>“I start with $10.”</li><li>“I spend $3, so I have $7 left.”</li><li>“I spend $4, so I have $3 left.”’</li></ol><p><strong><em>Final Answer</em></strong>: “$3.”</p><blockquote><strong>Tree-of-Thoughts (ToT):</strong></blockquote><ul><li>Picture a decision tree where each branch represents a possible way to solve a problem.</li><li>The model explores different paths or strategies, comparing them to pick the best one.</li><li>It’s like brainstorming multiple ideas and choosing the most promising solution.</li></ul><p><strong>Here is an example</strong>:</p><p><em>Question</em>: “How can I travel from New York to Chicago?”</p><p><strong><em>ToT Process</em></strong>:</p><p><em>Path 1</em>: Fly (Fast, expensive).</p><p><em>Path 2:</em> Drive (Flexible, slower).</p><p><em>Path 3</em>: Train (Comfortable, moderate speed).</p><p><strong><em>Final Answer</em></strong><em>:</em> “Fly if you need speed, train if you want comfort.”</p><blockquote><strong>Summary of differences:</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7k93SxAJ0T801wSBcBgLlA.png" /><figcaption>ReAct vs CoT vs ToT</figcaption></figure><p><strong>Tools</strong> (Talk to the world):</p><ul><li>Tools helps AI agents interact with the world and solve tasks effectively.</li><li>Tools includes <strong>Extension</strong>, <strong>Functions</strong> and <strong>Data Stores.</strong></li></ul><blockquote><strong><em>Extension</em></strong><em>:</em></blockquote><ul><li>Think of <strong>Extensions</strong> as bridges between the agent and external systems, like APIs.</li><li>They let the agent directly call APIs to get real-time information or perform actions</li></ul><p><strong>Example is our friend</strong>:</p><p><em>Task</em>: “Book me a flight.”</p><p>The agent uses an extension to connect to a flight booking API, fetch flight options, and complete the booking.</p><p><strong><em>Why use them?</em></strong></p><p>They allow agents to interact directly with the outside world and perform tasks autonomously.</p><blockquote><strong><em>Functions</em></strong>:</blockquote><ul><li>Functions are like mini-tools that the agent suggests but doesn’t run itself. Instead, the function is executed on your side (<strong>client-side</strong>).</li><li>They are designed to perform specific tasks, such as processing data, performing calculations, or accessing local resources.</li><li>This gives the developer more control over how the tool works.</li></ul><p><strong>Look at this Example</strong>:</p><p><em>Task</em>: “Find ski destinations.”</p><p>The agent suggests a function that provides a list of ski destinations (like Aspen, Vail). The developer runs this function on their system and sends the result back to the user.</p><p><strong><em>Why use them?</em></strong></p><p>Useful when you don’t want the agent directly calling APIs (e.g., for security reasons) or when more processing is needed on your side.</p><blockquote><strong>Data Stores:</strong></blockquote><ul><li>Imagine a <strong>Data Store</strong> as a big library or database that holds additional information the agent can use.</li><li>The agent can “<strong>look things up”</strong> in this library to get updated or specific knowledge it didn’t learn during training.</li></ul><p><strong>Example</strong>:</p><p><em>Task</em>: “What’s the sales report for last quarter?”</p><p>The agent searches a Data Store that contains your company’s sales data to provide the answer.</p><p><strong>Why use them?</strong></p><p>They allow agents to access new or dynamic data (like PDFs, spreadsheets, or live databases) that they wouldn’t otherwise know.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1doWdQ4DZwbkRgQEDxHwpw.png" /><figcaption><strong>Tools</strong> — Extensions, Functions and Data Stores</figcaption></figure><p><strong><em>Analogy</em></strong>:</p><p><strong><em>* Extensions</em></strong> &gt; are like a robot making phone calls to get information or do tasks for you.</p><p><strong><em>* Functions</em></strong> &gt; are like giving the robot a task list, but you handle the actual calls or actions.</p><p><strong><em>* Data</em> <em>Stores</em></strong> &gt; are like the robot using an encyclopedia to look up information it doesn’t already know.</p><p><strong>Orchestration Layer</strong> (The Manager)</p><p>In an AI agent, the <strong>Orchestration Layer</strong> acts like a manager, coordinating how the agent processes information and takes actions to achieve a goal. Let’s break down its key functions with simple explanations and examples:</p><p><strong>1. Handling User Input:</strong></p><ul><li><strong>What It Does:</strong> Receives and understands what the user is asking.</li><li><strong>Example:</strong> If you ask, “What’s the weather in New York?” the orchestration layer takes your question and prepares it for the agent to process.</li></ul><p><strong>2. Thinking Through the Problem (Reasoning):</strong></p><ul><li><strong>What It Does:</strong> Helps the agent figure out how to answer your question by planning the steps needed.</li><li><strong>Example:</strong> The agent realizes it needs to check a weather service (API) to find the current weather in New York.</li></ul><p><strong>3. Choosing the Right Tools:</strong></p><ul><li><strong>What It Does:</strong> Selects the appropriate resources or tools (Extensions, Functions, or Data Stores) the agent needs to use to find the answer.</li><li><strong>Example:</strong> Decides to use a weather API to get the latest weather information.</li></ul><p><strong>4. Performing Actions:</strong></p><ul><li><strong>What It Does:</strong> Carries out the necessary steps to gather information or complete tasks.</li><li><strong>Example:</strong> Makes a call to the weather API to retrieve the current weather data for New York.</li></ul><p><strong>5. Remembering Context (Memory and Context):</strong></p><ul><li><strong>What It Does:</strong> Keeps track of previous interactions to maintain a coherent conversation.</li><li><strong>Example:</strong> If you later ask, “What about tomorrow?” the agent remembers you’re talking about New York’s weather and provides the forecast for the next day.</li></ul><p><strong>6. Repeating Until the Goal is Achieved:</strong></p><ul><li><strong>What It Does:</strong> Continues processing and refining its actions until it successfully answers your question or completes the task.</li><li><strong>Example:</strong> If the first attempt to get the weather data fails, the agent tries again or uses a different method to find the information.</li></ul><p><strong>Analogy</strong></p><p>Think of the orchestration layer as a chef preparing a meal:</p><ul><li><strong>Ingredients:</strong> The tools and data sources.</li><li><strong>Recipe:</strong> The plan or reasoning process.</li><li><strong>Cooking:</strong> The actions taken to prepare the meal.</li><li><strong>Serving the Dish:</strong> Delivering the final answer to the user.</li></ul><p><strong><em>Why do you think Orchestration Layer is so important?</em></strong></p><p>Without the orchestration layer, the AI agent would struggle to:</p><ul><li>Understand which tools to use and when.</li><li>Complete tasks efficiently.</li><li>Maintain coherent and context-aware interactions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gk0IZ1BuMjV4YOB7hTCq1A.png" /></figure><h3>Whew!</h3><p>Its was lot of information in a simplified way, but it was fun indeed!!</p><p><em>Before</em>, I take you to the use-case, let me show you a world around <em>stories</em>…</p><p><strong><em>Stories have a unique power to touch our hearts, making us feel joy, sadness, fear, or inspiration. They help us understand the world and connect with others by sharing experiences and emotions. A well-told story can teach us lessons, inspire change, and leave a lasting impression. It’s not just about entertainment; stories are how we relate to each other and ourselves, bridging gaps and creating shared understanding across different times and cultures.</em></strong></p><p><strong><em>Imagine if, while reading a story, you could express your feelings, and the story would adapt to match your mood. For instance, if you’re feeling down, the narrative could shift to become more uplifting, providing comfort and joy. This dynamic interaction would make storytelling even more personal and engaging, catering to our emotional needs in real-time.</em></strong></p><p>Now, let’s talk about our <strong>use-case</strong> around stories</p><h3>“Emotionally Adaptive Narrative Generator”</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LCH5axd82ucYEwzK" /><figcaption>Photo by <a href="https://unsplash.com/@jontyson?utm_source=medium&amp;utm_medium=referral">Jon Tyson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Purpose</strong>: Generate personalized, interactive stories that adapt dynamically to the reader’s emotional responses in real-time.</p><p><strong>Target Audience</strong>: Creative writers, gamers, or educators.</p><p><strong>Core Features</strong>:</p><p>Analyze the reader’s emotional tone from text feedback (e.g., “I feel excited!” or “This part is boring.”).</p><p>Modify the story dynamically to align with the emotional input (e.g., add tension, humor, or calmness).</p><p>Incorporate multi-modal data (e.g., speech tone analysis, sentiment from text).</p><h3>Key Considerations for Architecture</h3><h4>Core Components:</h4><blockquote><strong>Model</strong>:</blockquote><ul><li>Use a <strong>language model</strong> capable of storytelling and reasoning.</li><li>Fine-tune a pre-trained model (e.g., GPT, LLaMA) for narrative generation.</li></ul><blockquote><strong>Tools</strong>:</blockquote><ul><li><strong>Sentiment Analyzer</strong>: For detecting emotional tone in user feedback.</li><li><strong>Emotion-Based Modifiers</strong>: Adjust narrative tone, pacing, or content dynamically.</li><li><strong>Speech and Text Analyzer</strong>: For multimodal emotional feedback.</li></ul><blockquote><strong>Orchestration Layer</strong>:</blockquote><ul><li>Manage interaction cycles:</li><li><strong>Input</strong>: Process user feedback.</li><li><strong>Reasoning</strong>: Decide on story adjustments.</li><li><strong>Action</strong>: Update and present the narrative.</li><li>Maintain state and context for continuity.</li></ul><p><strong>Memory</strong>:</p><ul><li>Maintain session memory to track story progression and user preferences.</li><li>Include short-term (<strong>current session</strong>) and long-term (<strong>cross-session preferences</strong>) memory.</li></ul><p><strong>Data Stores</strong>:</p><ul><li>Store pre-generated story templates and emotional adjustment rules.</li><li>Include a database of emotional triggers and responses for better personalization.</li></ul><p>Technical Architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SUD9DUnnrbIJznSoGRgrDw.png" /><figcaption>Technical Architecture</figcaption></figure><p><strong>Reasoning Framework:</strong></p><p>Use ReAct (<strong>Reason and Act</strong>):</p><ul><li>Thought: Analyze the reader’s feedback.</li><li>Action: Choose adjustments to tone, content, or pacing.</li><li>Observation: Gather user response to new content.</li><li><strong>Final Answer</strong>: Present the updated story</li></ul><h3>Implementation Steps:</h3><h4>1. Build and Fine-Tune the Model</h4><ul><li>Start with a large language model pre-trained for general text generation.</li><li>Fine-tune it on story datasets, focusing on narrative genres, styles, and structures.</li></ul><h4>2. Integrate Sentiment Analysis</h4><ul><li>Use sentiment analysis models (e.g., BERT or Hugging Face pipelines).</li><li>Map sentiment scores (e.g., positive, neutral, negative) to narrative changes.</li></ul><h4>3. Develop the Orchestration Layer</h4><ul><li>Implement a reasoning loop that:<br>- Collects feedback (e.g., “Add more suspense.”).<br>- Modifies the narrative based on pre-defined emotional triggers.<br>- Continuously refines content in multi-turn interactions.</li></ul><h4>4. Design the Memory System</h4><ul><li>Use a vector database (e.g., <strong>Pinecone, Weaviate</strong>) for embedding-based session storage.</li><li>Maintain story progression and user preferences for continuity.</li></ul><h4>5. Build the Data Store</h4><ul><li>Create a library of:<br>- Pre-written story fragments categorized by tone or emotion.<br>- Emotion-specific modifiers (e.g., suspenseful phrases, humorous twists).</li></ul><h4>6. Develop an Interactive Frontend</h4><ul><li>Provide a user-friendly interface with:<br>- Options to input emotional feedback.<br>- Real-time updates to the story.<br>- Visual aids or audio narration for multi-modal interaction.</li></ul><p><strong>Challenges and Solutions:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MObunbPv96TQLw5H7rNc0Q.png" /><figcaption><strong>Challenges and Solutions</strong></figcaption></figure><h3>Potential Enhancements</h3><ul><li><strong><em>Personalization</em></strong>: Use reinforcement learning to tailor stories to individual user preferences over time.</li><li><strong><em>Collaboration</em></strong>: Enable users to co-create narratives with the agent.</li><li><strong><em>Gamification</em></strong>: Add achievements or rewards for interactive storytelling.</li><li><strong><em>Multimodal Capabilities</em></strong>: Incorporate images, videos, or music to enhance the emotional impact of the story.</li></ul><h3>Tools and Libraries</h3><ol><li><strong><em>Natural Language Processing (NLP)</em></strong></li></ol><ul><li><strong>Language Models</strong>: OpenAI GPT, Hugging Face Transformers, Cohere, or fine-tuned BERT models.</li><li><strong>Text Processing</strong>: NLTK, SpaCy, or TextBlob.</li><li><strong>Fine-Tuning Frameworks</strong>: Hugging Face Trainer, TensorFlow, PyTorch Lightning.</li></ul><p><strong><em>2. Sentiment and Emotion Analysis</em></strong></p><ul><li><strong>Libraries</strong>: Hugging Face Transformers, VADER (Valence Aware Dictionary), or AWS Comprehend.</li><li><strong>Pre-trained Models</strong>: RoBERTa for sentiment analysis, Emotions NLP models.</li></ul><p><strong><em>3. Speech Processing</em></strong></p><ul><li><strong>Speech-to-Text</strong>: Google Cloud Speech-to-Text, Whisper by OpenAI, or AWS Transcribe.</li><li><strong>Emotion Detection</strong>: DeepSpeech with emotion-detection models trained on speech data.</li></ul><p><strong><em>4. Memory Management</em></strong></p><ul><li><strong>Vector Databases</strong>: Pinecone, Weaviate, Milvus, or FAISS for embedding-based retrieval.</li><li><strong>Session Management</strong>: Redis or DynamoDB for maintaining active session states.</li></ul><p><strong><em>5. Data Storage and Management</em></strong></p><ul><li><strong>Structured Data</strong>: PostgreSQL, MySQL for story fragments and emotional triggers.</li><li><strong>Unstructured Data</strong>: AWS S3, Google Cloud Storage for narrative libraries and multimedia assets.</li><li><strong>Data Processing</strong>: Pandas, Dask, or PySpark for pre-processing.</li></ul><p><strong><em>6. Visualization</em></strong></p><ul><li><strong>Frontend</strong>: React.js, Vue.js, or Angular for a dynamic user interface.</li><li><strong>Data Visualization</strong>: Plotly, D3.js, or Chart.js for tracking story evolution or engagement metrics.</li></ul><p><strong><em>7. Model Deployment</em></strong></p><ul><li><strong>APIs</strong>: FastAPI, Flask, or Django REST Framework.</li><li><strong>Inference Servers</strong>: TensorFlow Serving, TorchServe, or Hugging Face Inference API.</li><li><strong>Cloud Platforms</strong>: AWS SageMaker, Google Vertex AI, Azure Machine Learning.</li></ul><p><strong><em>8. Multi-modal Capabilities</em></strong></p><ul><li><strong>Image Generation</strong>: Stable Diffusion or DALL-E for accompanying visual elements.</li><li><strong>Audio Generation</strong>: ElevenLabs or Amazon Polly for narration.</li></ul><p><strong><em>9. Agent Frameworks</em></strong></p><ul><li><strong>Orchestration</strong>: LangChain, LangGraph, or custom orchestration with state machines.</li><li><strong>Reasoning Frameworks</strong>: ReAct, Chain-of-Thought (CoT), Tree-of-Thoughts (ToT).</li></ul><p><strong>Technology Stack:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V_GESF3-Ri84aPCH0yKDeA.png" /><figcaption><strong>Technology Stack</strong></figcaption></figure><h3>Types of Agents:</h3><p><strong><em>Task-Oriented Agents</em></strong></p><ul><li>Focus on specific tasks like sentiment analysis, feedback processing, and narrative updates.</li></ul><p><strong><em>Multi-modal Agents</em></strong></p><ul><li>Combine text and speech inputs to provide personalized experiences.</li></ul><p><strong><em>Interactive Agents</em></strong></p><ul><li>Engage in dynamic, multi-turn conversations, adapting to feedback and maintaining context.</li></ul><p><strong><em>Memory-Driven Agents</em></strong></p><ul><li>Use short-term and long-term memory to track narrative progression and user preferences.</li></ul><h3>Key Considerations:</h3><p><strong><em>Agent Design</em></strong></p><ul><li><strong>Core Features</strong>: Story generation, emotional adaptation, multi-turn interactions.</li><li><strong>Memory Management</strong>: Implement stateful memory to track session data across interactions.</li></ul><p><strong><em>Model Fine-Tuning</em></strong></p><ul><li>Fine-tune a pre-trained language model on storytelling datasets with emotional context (e.g., <strong>Project Gutenberg</strong>, story-specific datasets).</li></ul><p><strong><em>Orchestration Layer</em></strong></p><ul><li>Use frameworks like LangChain to coordinate reasoning, memory, and tool usage.</li></ul><p><strong><em>Feedback Loop</em></strong></p><ul><li>Incorporate real-time feedback to adjust narrative style and tone dynamically.</li></ul><p><strong><em>Data Privacy and Security</em></strong></p><ul><li>Ensure compliance with GDPR and other regulations for user data handling.</li></ul><h3>Relevant Techniques</h3><p><strong><em>Reinforcement Learning</em></strong>:</p><ul><li>Use <strong>Reinforcement Learning with Human Feedback (RLHF)</strong> to improve narrative adaptation based on user preferences.</li></ul><p><strong><em>Dynamic Prompt Engineering</em></strong>:</p><ul><li>Leverage techniques like Chain-of-Thought (CoT) to handle complex storytelling logic.</li></ul><p><strong><em>Sentiment Mapping</em></strong><em>:</em></p><ul><li>Map user sentiment to predefined narrative adjustments (e.g., increase suspense, add humor).</li></ul><p><strong><em>Narrative Consistency</em></strong><em>:</em></p><ul><li>Use memory embeddings to ensure story continuity and coherence across iterations.</li></ul><p>Workflow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sv1a0o8RFZf9QNTlBz3GXA.png" /><figcaption>Workflow</figcaption></figure><h3>1. Initial Input and Story Generation</h3><p><strong><em>User Input</em></strong>: The user provides the initial prompt or feedback (e.g., “Tell me a story about a brave knight.”).</p><p><strong><em>Processing</em></strong>: The AI agent analyzes the input using natural language understanding and generates a story using a fine-tuned model.</p><h3>2. Sentiment Analysis and Intent Detection</h3><p>The agent uses sentiment analysis and intent detection tools to interpret emotional tone or specific requests from the user.</p><p><strong>Example</strong>: If the feedback is “Make it more thrilling,” the agent identifies the need for added tension and excitement in the narrative.</p><h3>3. Dynamic Reasoning and Adjustments</h3><p>The agent applies reasoning frameworks (e.g., ReAct) to determine the appropriate narrative adjustments.</p><p>It retrieves or generates relevant story fragments, modifies tone, pacing, or content dynamically, and ensures coherence with the existing plot.</p><h3>4. Updated Output and Multi-modal Integration</h3><p><strong><em>Execution</em></strong>: The agent updates the story based on the adjustments and optionally enhances it with visuals or audio for an immersive experience.</p><p><strong><em>Output</em></strong>: The updated story is presented to the user, ready for further feedback.</p><h3>5. Feedback Loop and Iterative Refinement</h3><p><strong><em>User Feedback</em></strong>: The user reacts to the output, providing new input (e.g., “Add humor” or “Make the ending surprising.”).</p><p>The feedback is fed back into the system as new input, allowing the agent to refine and enhance the story iteratively.</p><h3>6. Memory and State Management</h3><p>The agent uses session memory (e.g., Redis, vector databases) to maintain narrative continuity across interactions.</p><p>Past user inputs and story progression are tracked to align future adjustments with user preferences.</p><h3>Summary</h3><p><em>This workflow emphasizes how the AI agent ensures dynamic interaction, personalization, and continuity while iteratively refining the story based on user feedback. This feedback loop makes the agent adaptive, engaging, and user-focused.</em></p><h3>Hang on… Before you go…</h3><p>Now that you have read and enjoyed the content above, I’m thrilled to share highlights from our <strong>collaborative whitepaper/eBook</strong>, <strong>“Navigating the Era of Agentic AI — Agents,”</strong> where we deep dive into the technology, potential, and game-changing applications of AI Agents.</p><h4>Why Read This eBook?</h4><p>🔍 <strong>From Assistants to Autonomous Agents</strong><br>Discover how the journey from Siri and chatbots to copilots and now <strong>AI Agents</strong> is transforming workflows into self-sufficient ecosystems.</p><p>⚙️ <strong>Core Components Unpacked</strong><br>Understand the brains (LLMs like GPT-4), tools (APIs, knowledge bases), orchestration (ReAct logic), and memory (CosmosDB) that power these agents.</p><p>💥 <strong>Real-World Wins</strong></p><ul><li><strong>Smart SaaS Integrations:</strong> AI Agents merging data for actionable insights.</li><li><strong>Auto-Enrollments:</strong> AI streamlining processes like email validation and system updates.</li><li><strong>Smart Approvals:</strong> Autonomous financial decisions for faster operations.</li></ul><p>🔐 <strong>Key Considerations</strong></p><ul><li>Balancing <strong>low-code vs pro-code</strong> for agent development.</li><li>Ensuring security and compliance with tools like <strong>Microsoft Purview</strong> and <strong>Azure AI Agent Service</strong>.</li></ul><p>🏭 <strong>Industry Game-Changers</strong><br>From <strong>manufacturing</strong> (reducing energy waste) to <strong>healthcare</strong> and <strong>finance</strong> (domain-specific brilliance), AI Agents are reshaping industries.</p><p>🚨 <strong>The Future is Now</strong></p><ul><li><strong>SaaS disruption:</strong> AI Agents will directly CRUD backend systems, eliminating middle layers.</li><li><strong>Collaboration is critical:</strong> Success requires alignment across IT, legal, and business teams.</li></ul><h4>📖 Why You Need This Whitepaper</h4><p>This eBook is your guide to <strong>future-proofing your workflows</strong> with actionable insights into <strong>AI Agents’ capabilities, implementation strategies, and industry-specific use cases</strong>. Whether you’re a tech enthusiast, a business leader, or just curious about AI, this is the roadmap you need to stay ahead.</p><p>👉 <strong>Ready to dive in?</strong><br>Grab the whitepaper here and start transforming your workflows with <strong>AI Agents</strong> today!</p><p><strong>📖 </strong><a href="https://www.linkedin.com/feed/update/urn:li:activity:7290421234775773184/"><strong>Read the eBook</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=707ca8905119" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Big O]]></title>
            <link>https://medium.com/@abhishekbhardwaj.ddn/big-o-5550c466a5c2?source=rss-2ca14c275dc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5550c466a5c2</guid>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[big-o-notation]]></category>
            <category><![CDATA[freshers]]></category>
            <category><![CDATA[code-efficiency]]></category>
            <category><![CDATA[learner]]></category>
            <dc:creator><![CDATA[Abhishek Bhardwaj]]></dc:creator>
            <pubDate>Mon, 18 Nov 2024 18:32:49 GMT</pubDate>
            <atom:updated>2024-11-18T18:34:19.807Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*3Q1RTr0CwyEbjhg5CisMCw.png" /></figure><p>Yes, we are talking about Big O, it’s the first step when we prepare for <strong>Data Structures and Algorithms</strong>.</p><p>I am starting a series as I know many of us are <strong>struggling</strong> to understand about these concepts and I went through the same struggle. I will try to use very simple and layman way of explaining the things and you will digest that.</p><p>First, understand what an <strong>Algorithm</strong> is??</p><h3><strong>Algorithm</strong>:</h3><p>Computer works on <strong>commands</strong> that we provide, the commands which are in <strong>sequence</strong> of <strong>steps.</strong></p><p>Here is an <strong>example → </strong>“<strong>drinking water from a bottle</strong>”.</p><p><em>Step-1: Hold a bottle filled with water.</em></p><p><em>Step-2: Twist and open a cap</em></p><p><em>Step-3: Pour wate</em>r in a glass or drink directly from it.</p><p><strong>Above</strong> steps is an <strong>algorithm</strong> to solve a problem: “<strong>drinking water from a bottle”</strong></p><h3><strong><em>“Algorithm takes input and produce an output</em></strong>.”</h3><p><strong>Input</strong>: Steps (1,2,3).</p><p><strong>Output</strong>: Thirst is satisfied.</p><p>Hence, Algorithm is a set of instructions that a computer will follow to solve a problem <strong>step by step</strong>.</p><p>There are some requirements for algorithms.</p><h3><strong>Requirements</strong>:</h3><p><strong>First</strong>, for <em>any given input the output should always remain same</em>.</p><p>&gt; If we want to <strong>add two positive numbers greater than 0</strong>.</p><p>&gt; let’s see two ways of doing it</p><pre>def add_num():<br>num1 = 1<br>num2 = 2<br>return num1 + num2 <br><br>Output is 3</pre><pre>1+2 = 3 <br><br>Output is 3</pre><p>In the above two examples, with same inputs we get same output irrespective of the way of solution we use. Again, for both the solution output remains unchanged i.e. 3</p><p><strong>Second</strong>, we should <strong>NOT</strong> deviate from the <strong>INPUT</strong> problem</p><p>For the above example of adding numbers focus on the <strong>statement</strong>,</p><p><strong>add two positive numbers greater than 0</strong></p><p><strong>&gt; Two numbers (only two numbers)</strong></p><p><strong>&gt; Positive (cannot use negative number)</strong></p><p><strong>&gt; Greater than zero (Cannot use zero)</strong></p><p>So, if any of the above requirements for the problem is not fulfilled the algorithm’s requirements is not met.</p><h3>What is Big O?</h3><figure><img alt="Big O and its Computational Complexities" src="https://cdn-images-1.medium.com/max/300/1*3Q1RTr0CwyEbjhg5CisMCw.png" /><figcaption>Big O and its Compuational Complexities</figcaption></figure><p>We understood the idea about the algorithm and its requirements, but what about its efficiency.</p><ol><li>How fast an algorithm will run?</li><li>How much memory will it need?</li></ol><p>These questions can be answered using <strong>Big O</strong> notation.</p><p>Big O will help in describing the computational complexity.</p><p>Let’s understand in easy way.</p><p><strong>Big O</strong> will help you:</p><ol><li>Choose the best algorithm for your problem. (<strong>consider how we added two numbers</strong>)</li><li>Avoid writing slow or memory-heavy code. (<strong>will understand from example later</strong>)</li><li>Understand trade-offs between speed and resource use. (<strong>will discuss about scenarios</strong>)</li></ol><p>Before diving into how it will help, let’s talk about how the algorithm’s <strong>complexity</strong> is divided:</p><p>It is split into two parts:</p><ul><li><strong>Time Complexity</strong></li><li><strong>Space Complexity</strong></li></ul><h3><strong>Time Complexity</strong></h3><p><strong>Time Complexity, </strong>of an algorithm is the amount of <strong>time</strong> an algorithm needs to run relative to input size.</p><p>Simply, as the number of elements increases, the time taken to compute a problem increase.</p><p><strong>Example</strong>: <strong>Summing Numbers in a List</strong></p><p>Imagine you have a list of numbers, and you want to calculate their total sum.</p><p>· <strong>Input Size (n):</strong> The number of elements in the list.</p><p>· <strong>Operation:</strong> Adding each number to a running total.</p><h3><strong>Process:</strong></h3><p>1. Start with a total of 0.</p><p>2. For each number in the list, add it to the total.</p><p>3. Continue until all numbers have been added.</p><p><strong>Time Complexity Analysis:</strong></p><p>· For a list with 5 numbers, you perform 5 additions.</p><p>· For a list with 10 numbers, you perform 10 additions.</p><p>· In general, for a list with n numbers, you perform n additions.</p><h3><strong>Space complexity</strong></h3><p><strong>Space complexity</strong> of an algorithm refers to the amount of <strong>memory</strong> it uses while running, relative to the size of the <strong>input.</strong></p><p>Simply, it measures how much memory the algorithm uses based on the size of input.</p><p><strong>Example in Words:</strong></p><p><strong>“Imagine you are writing down the numbers from a list”</strong></p><p><strong>Low Space Complexity/ Minimal Memory (O(1))</strong>:</p><ul><li>You write one number at a time on a small notepad, erase it, and then write the next number.</li><li>The memory used doesn’t grow with the number of elements.</li><li>Fixed memory, regardless of input size.</li></ul><p><strong>Higher Space Complexity/ More Memory (O(n))</strong>:</p><ul><li>You write all the numbers on a big sheet of paper at once.</li><li>The memory used grows with the number of elements.</li><li>Memory grows proportionally with input size.</li></ul><h3><strong>Now, let’s understand using examples:</strong></h3><h3><strong>O(1) — Constant Time</strong></h3><p><strong>Example</strong>: Accessing an element in a list by index</p><p>The algorithm does a single operation, regardless of the input size.</p><pre>numbers = [10, 20, 30, 40, 50]<br>print(numbers[2])</pre><p><strong><em>Explanation</em></strong><em>:</em></p><p>Accessing an element in a list by index is constant because no matter how large the list is, it’s a direct lookup. <strong>We are not iterating.</strong></p><h3><strong>O(n) — Linear Time</strong></h3><p><strong>Example: </strong>Summing all numbers in a list</p><p>The algorithm processes each element once.</p><pre>numbers = [1, 2, 3, 4, 5]<br>total = 0<br>for num in numbers:<br>  total += num<br>  print(total)</pre><p><strong><em>Explanation</em></strong><em>:</em></p><p>The time grows directly with the number of elements. For a list of size n, the loop runs n times.</p><h3><strong>O(n²) — Quadratic Time</strong></h3><p><strong>Example: </strong>Comparing every pair of numbers</p><p>The algorithm processes pairs of elements (nested loops).</p><pre>numbers = [1, 2, 3]<br>for i in range(len(numbers)):<br>  for j in range(len(numbers)):<br>  print(numbers[i], numbers[j])</pre><p><strong><em>Explanation</em></strong><em>:</em></p><p>For n elements, there are n * n comparisons. Adding more numbers dramatically increases the time.</p><h3><strong>O(log n) — Logarithmic Time</strong></h3><p>Its an inverse operation to exponents. The time complexity O(log n) is called time and its extremely fast.</p><p><strong>Example:</strong> Doubling a Number Until It Exceeds a Limit</p><p>The algorithm reduces the problem size in each step.</p><pre>def double_until_limit(x, limit):<br>    steps = 0<br>    while x &lt;= limit:<br>        x *= 2<br>        steps += 1<br>    return steps<br><br># Example usage:<br>initial_value = 1<br>limit_value = 100<br>print(double_until_limit(initial_value, limit_value))</pre><p><strong>Output: 7</strong></p><p><strong><em>Explanation</em></strong><em>:</em></p><p>In this function, x is repeatedly doubled until it surpasses the specified limit. Each iteration of the loop effectively halves the remaining range between x and the limit. This halving process is characteristic of logarithmic time complexity, O(log n), because the number of iterations required is proportional to the logarithm of the ratio between limit and the initial x.</p><h3><strong>O(2ⁿ) — Exponential Time</strong></h3><p><strong>Example</strong>: Generating all subsets of a list</p><p>The algorithm explores all possibilities.</p><pre># Generating all subsets of a list<br>def subsets(nums):<br>    if not nums:<br>        return [[]]<br>    smaller = subsets(nums[1:])<br>    current = nums[0]<br>    return smaller + [subset + [current] for subset in smaller]<br><br>print(subsets([1, 2]))  <br><br><br># All subsets: [], [1], [2], [1, 2]</pre><p><strong><em>Explanation</em></strong><em>:</em></p><p>For a list of size n, the function generates 2^n subsets. Doubling the input size causes the time to skyrocket.</p><p><strong>Table with an extract of our understanding:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*qZae5Rgvqggj721lcLNvBA.png" /></figure><p>These examples highlights how input size affects the performance of an algorithm.</p><blockquote><strong><em>Stay tuned for more content……</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5550c466a5c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[About Me~ Abhishek Bhardwaj]]></title>
            <link>https://medium.com/@abhishekbhardwaj.ddn/about-me-dab5e52e1c6f?source=rss-2ca14c275dc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/dab5e52e1c6f</guid>
            <category><![CDATA[about-me-stories]]></category>
            <dc:creator><![CDATA[Abhishek Bhardwaj]]></dc:creator>
            <pubDate>Tue, 12 Nov 2024 00:30:01 GMT</pubDate>
            <atom:updated>2024-11-12T00:33:34.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*ocayFXmWkVBUaDT3QAIwVA.png" /><figcaption>Never leave a stone unturned!</figcaption></figure><p>Born in New Delhi, India, I have been fortunate to experience a multitude of languages and cultures, shaping my worldview. Cooking and watching movies are my cherished pastimes, and I’ve become adept at preparing various dishes by following instructional videos on YouTube.</p><p>For my bachelor’s degree, I attended CITM Faridabad, focusing on Electronics and Communication Engineering. Starting my career as a network engineer, I gradually transitioned across different roles, acquiring diverse technical skills along the way. One notable milestone was obtaining a Master’s degree in Data Science from IUPUI in Indianapolis, USA, which is now renamed as Indiana University Indianapolis.</p><p>With over 10 years of IT experience, I have gained proficiency in monitoring and troubleshooting Linux and Windows Servers, assuming responsibilities as both a Linux and Windows Admin. I have also worked extensively with Identity Management Tools, implementing secure authentication through SSO and MFA. As part of my role, I managed local and remote IT systems, including VMWare hosted systems.</p><p>My expertise extends to AWS cloud, where I have hands-on experience in provisioning, supporting, and decommissioning infrastructure. In AWS Glue, I have developed data pipelines for transforming and delivering data to consumers. In fact, I singlehandedly built an AWS cloud infrastructure for a Data Engineering Project. Additionally, I have completed numerous academic projects in Data Science and serve on the review committee for security and best practices in architectural design implementation.</p><p>In summary, my journey has been marked by diverse experiences and a constant pursuit of knowledge. With a strong foundation in engineering and a Master’s degree in Data Science, I have developed expertise in network engineering, Linux and Windows administration, identity management, AWS cloud, and data engineering. I am passionate about staying abreast of emerging technologies and leveraging my skills to drive innovation and excellence in the field of IT.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dab5e52e1c6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>