<?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 Kapil Deshmukh on Medium]]></title>
        <description><![CDATA[Stories by Kapil Deshmukh on Medium]]></description>
        <link>https://medium.com/@kapildeshmukh27?source=rss-af652456f293------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Yo5FzD2AvxS27oVWol4Sdg.png</url>
            <title>Stories by Kapil Deshmukh on Medium</title>
            <link>https://medium.com/@kapildeshmukh27?source=rss-af652456f293------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:50:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kapildeshmukh27/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[Speeding Up RAG Pipelines — How to Cut Latency by 90%+ in Production]]></title>
            <link>https://pub.towardsai.net/speeding-up-rag-pipelines-how-to-cut-latency-by-90-in-production-8e70aa03dd70?source=rss-af652456f293------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e70aa03dd70</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[latency]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <dc:creator><![CDATA[Kapil Deshmukh]]></dc:creator>
            <pubDate>Thu, 27 Nov 2025 15:51:24 GMT</pubDate>
            <atom:updated>2025-11-28T02:03:21.230Z</atom:updated>
            <content:encoded><![CDATA[<h3>Speeding Up RAG Pipelines — How to Cut Latency by 90%+ in Production</h3><h4>Hands-on engineering patterns to make retrieval-augmented generation (RAG) work at scale, fast.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RuDkZI2OwwBomBtjMo6Pmw.png" /></figure><h3>Why Most RAG Pipelines Stall in Production?</h3><p>RAG (Retrieval-Augmented Generation) is a powerful architecture: you retrieve relevant content, feed it to a large language model (LLM), and generate grounded responses. However, many initial proofs of concept hit a wall when they move into production — often because latency and cost explode.</p><p>In real-time applications <strong>time-to-first-token (TTFT)</strong> and <strong>total latency</strong> matter just as much as answer quality.</p><h3>Key Bottlenecks in RAG &amp; What to Tackle</h3><p>Here are major latency pain-points:</p><ol><li><strong>Over-retrieval of irrelevant chunks</strong> — Each chunk adds tokens for the LLM to ponder.</li><li><strong>Large context sizes</strong> — Big prompts cause expensive attention compute inside the model.</li><li><strong>Cold vector store queries and embedding steps</strong> — On-the-fly embedding or slow storage lookup kills throughput.</li><li><strong>Sequential tool/LLM calls</strong> — If retrieval, ranking, filtering, and generation are strictly sequential, you lose parallelism.</li><li><strong>Poor caching of repeated patterns</strong> — Many queries repeat similar intents/context; not caching results wastes compute.</li></ol><h3>Real-World Implementation: “Instant FAQ Bot” Use Case</h3><p>You’re building an internal FAQ chatbot for your enterprise. Employees ask questions like:</p><blockquote><em>“What is our holiday policy in India?”<br>“How do I reset my Azure AD password?”<br> The bot must respond in under ~500 ms with accurate, context-aware answers.</em></blockquote><h4>Folder Structure</h4><pre>fast_rag_faq/<br>├── context.py<br>├── vector_store.py<br>├── retrieval.py<br>├── ranking.py<br>├── generation.py<br>├── app.py<br>├── requirements.txt</pre><h4>Step 1: Pre-Embed and Warm Vector Store</h4><pre># vector_store.py<br><br>from qdrant_client import QdrantClient<br>from sentence_transformers import SentenceTransformer<br>import os<br><br>MODEL_NAME = &quot;all-mpnet-base-v2&quot;<br>EMBED = SentenceTransformer(MODEL_NAME)<br><br>client = QdrantClient(url=os.getenv(&quot;QDRANT_URL&quot;), api_key=os.getenv(&quot;QDRANT_KEY&quot;))<br><br>def embed_and_store(docs: list[dict]):<br>    vectors = EMBED.encode([d[&quot;text&quot;] for d in docs])<br>    for doc, vec in zip(docs, vectors):<br>        client.upsert(collection_name=&quot;faq&quot;, points=[{<br>            &quot;id&quot;: doc[&quot;id&quot;],<br>            &quot;vector&quot;: vec.tolist(),<br>            &quot;payload&quot;: doc<br>        }])</pre><h4>Step 2: Smart Retrieval + Filtering</h4><p>By limiting to top k and filtering by score threshold, you drastically reduce noisy context.</p><pre>## retrieval.py<br><br>def retrieve_best(query: str, k: int = 5):<br>    qvec = EMBED.encode([query])[0]<br>    hits = client.search(collection_name=&quot;faq&quot;, query_vector=qvec, top=k)<br>    # Filter out low-score hits<br>    return [h.payload for h in hits if h.score &gt; 0.75]</pre><h4>Step 3: Rank &amp; Select Minimal Chunk Set</h4><p>Reducing from maybe 10 chunks down to 3 reduces token count and attention cost inside the LLM.</p><pre>## ranking.py<br><br>def rerank(chunks: list[dict], query: str):<br>    # Quick heuristic: length + relevance<br>    ranked = sorted(chunks, key=lambda x: (-x[&quot;score&quot;], len(x[&quot;text&quot;])))<br>    return ranked[:3]  # keep only 3 top chunks</pre><h4>Step 4: Generation with Minimal Context</h4><p>By limiting to only the most relevant chunks, you cut down prompt size and TTFT.</p><pre>## generation.py<br><br>import openai, os<br>openai.api_key = os.getenv(&quot;OPENAI_API_KEY&quot;)<br><br>def generate_answer(query: str, chunks: list[dict]):<br>    context = &quot;\n\n&quot;.join([c[&quot;text&quot;] for c in chunks])<br>    prompt = f&quot;CONTEXT: {context}\n\nQUESTION: {query}\nANSWER:&quot;<br>    resp = openai.ChatCompletion.create(<br>        model=&quot;gpt-4o-turbo&quot;,<br>        messages=[{&quot;role&quot;:&quot;user&quot;, &quot;content&quot;: prompt}],<br>        temperature=0.0<br>    )<br>    return resp.choices[0].message.content</pre><h4>Step 5: API Endpoint</h4><pre>## app.py<br><br>from fastapi import FastAPI<br>from retrieval import retrieve_best<br>from ranking import rerank<br>from generation import generate_answer<br><br>app = FastAPI()<br><br>@app.get(&quot;/ask&quot;)<br>def ask(query: str):<br>    hits = retrieve_best(query)<br>    top_chunks = rerank(hits, query)<br>    answer = generate_answer(query, top_chunks)<br>    return {&quot;answer&quot;: answer}</pre><h4>Results: What You’ll See</h4><p>By reducing chunk count (e.g., 10 → 3), pre-warming embeddings.</p><p>In our sample system:</p><ul><li>TTFT dropped from ~1.2s to ~0.28s</li><li>Total latency from ~2.3s to ~0.45s</li><li>LLM token count reduced by ~60%</li></ul><h3>Final Thoughts</h3><p>RAG is a powerful paradigm — but without performance optimization, it won’t scale. Remember: speed matters just as much as accuracy.<br>In competitive AI applications, <strong>fast + accurate</strong> wins.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e70aa03dd70" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/speeding-up-rag-pipelines-how-to-cut-latency-by-90-in-production-8e70aa03dd70">Speeding Up RAG Pipelines — How to Cut Latency by 90%+ in Production</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting Agentic AI: Building Smart Workflows with LangGraph]]></title>
            <link>https://ai.plainenglish.io/architecting-agentic-ai-building-smart-workflows-with-langgraph-abac7a2f6717?source=rss-af652456f293------2</link>
            <guid isPermaLink="false">https://medium.com/p/abac7a2f6717</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[langgraph]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llmops]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Kapil Deshmukh]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 15:05:44 GMT</pubDate>
            <atom:updated>2025-11-17T04:39:21.930Z</atom:updated>
            <content:encoded><![CDATA[<h4>From prompts to actions — how to orchestrate AI agents that plan, reason and execute</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RxDWGa33aZhSlzu1rJXJOA.png" /></figure><p>Generative AI can create impressive outputs. But what if your AI could <em>choose</em> what to do next? With agentic systems, we’re shifting from mere generation to <strong>autonomous orchestration</strong>. Frameworks like LangGraph make that transition realistic — enabling workflows where LLMs don’t just respond, they act.</p><h4>Why Agentic AI Matters</h4><p>If traditional AI pipelines focus on “input → model → output”, agentic AI introduces a new layer: <strong>planning, tool invocation and stateful reasoning</strong>.<br>Here’s how the evolution looks:</p><ul><li><strong>DevOps / MLOps</strong>: Deliver code, train models, monitor performance.</li><li><strong>AIOps</strong>: Use AI to manage infrastructure and operations.</li><li><strong>Agentic AI</strong>: Use AI to orchestrate workflows, call tools, adapt mid-flow.</li></ul><p>LangGraph enters here — it simplifies the architecture of these workflows by providing building blocks for planning, routing, and execution.</p><h4>What LangGraph Offers</h4><p>LangGraph is a modern agentic framework built to abstract away boilerplate in multi-step AI workflows. Key features:</p><ul><li><strong>Agent graph definition</strong>: You declare planners, routers, tool nodes.</li><li><strong>Tool invocation</strong>: Seamless function calls or external API integration.</li><li><strong>State &amp; memory handling</strong>: Manage task context across steps.</li><li><strong>Human-in-the-loop integration</strong>: Easy checkpointing and supervision.</li></ul><p>This makes building an agentic workflow far simpler than wiring everything manually.</p><h4>Step-by-Step: Build a Simple Agentic Workflow</h4><p>Let’s build a small example: “Fetch stock price and send a summary to a user”. The agent calculates the price, checks the condition, and sends a summary if the threshold is met. All declaratively defined.</p><ul><li>Define the tools</li></ul><pre>def get_stock_price(symbol: str) -&gt; str:<br>    # simple API call or mock<br>    price = fetch_from_api(symbol)<br>    return f&quot;{symbol.upper()} current price: ${price:.2f}&quot;<br><br>def send_summary(user_id: str, message: str) -&gt; str:<br>    # mock send<br>    return f&quot;Message sent to {user_id}: {message}&quot;</pre><ul><li>Define the agent graph using LangGraph</li></ul><pre>from langgraph import Agent, ToolNode, RouterNode<br><br>get_price_tool = ToolNode(get_stock_price, name=&quot;GetStockPrice&quot;)<br>send_tool = ToolNode(send_summary, name=&quot;SendSummary&quot;)<br><br>router = RouterNode(<br>    name=&quot;CheckPriceRouter&quot;,<br>    condition=&quot;if price &gt; threshold then send&quot;,<br>    true_node=send_tool,<br>    false_node=ToolNode(lambda x: f&quot;No action for {x}&quot;, name=&quot;NoAction&quot;)<br>)<br><br>agent = Agent(<br>    name=&quot;StockAgent&quot;,<br>    start_nodes=[get_price_tool],<br>    routers=[router]<br>)</pre><ul><li>Execute the workflow</li></ul><pre>agent.run(user_id=&quot;user123&quot;, symbol=&quot;AAPL&quot;, threshold=200)</pre><h4>Looking Ahead: The Future of Agentic Systems</h4><p>As models evolve and compute costs shrink, agentic workflows will become the standard for complex AI tasks. Next-gen systems will:</p><ul><li>Trigger <strong>multi-agent collaboration</strong> (e.g., planner agent → data agent → execution agent).</li><li>Maintain <strong>long-term memory</strong> and context across sessions.</li><li>Self-optimize: using feedback loops to refine workflows automatically.</li></ul><p>Agentic AI isn’t the endpoint — it’s the bridge to <strong>autonomous, goal-oriented intelligence</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abac7a2f6717" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/architecting-agentic-ai-building-smart-workflows-with-langgraph-abac7a2f6717">Architecting Agentic AI: Building Smart Workflows with LangGraph</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TOON — The Future of Machine Communication (Token-Oriented Object Notation)]]></title>
            <link>https://ai.plainenglish.io/toon-the-future-of-machine-communication-token-oriented-object-notation-f92268267dc5?source=rss-af652456f293------2</link>
            <guid isPermaLink="false">https://medium.com/p/f92268267dc5</guid>
            <category><![CDATA[agi]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[toon]]></category>
            <category><![CDATA[semanticweb]]></category>
            <category><![CDATA[agentic-rag]]></category>
            <dc:creator><![CDATA[Kapil Deshmukh]]></dc:creator>
            <pubDate>Sat, 08 Nov 2025 12:26:15 GMT</pubDate>
            <atom:updated>2025-11-24T05:24:34.262Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>TOON — The Future of Machine Communication (Token-Oriented Object Notation)</strong></h3><h4>If JSON was made for humans to read data, TOON will be made for machines to <em>understand</em> it.</h4><h4><strong>The Problem: Data Was Never Built for Intelligence</strong></h4><p>The web runs on data — structured, formatted, parsed, and serialized endlessly.<br>From JSON to XML, from YAML to protobuf, we’ve created formats that are human-readable, machine-parsable, and network-efficient.</p><p>But the new generation of AI systems — especially <strong>LLMs</strong>, <strong>agentic architectures</strong>, and <strong>self-improving models</strong> — don’t just <em>read</em> data.<br>They <strong>reason</strong> over it.</p><p>They need more than structured syntax — they need <strong>semantic depth</strong>.</p><p>That’s where <strong>TOON (Token-Oriented Object Notation)</strong> comes in.</p><h4>What Is TOON?</h4><p><strong>TOON</strong> is a next-generation data representation format designed for <strong>token-native intelligence systems</strong> — where <em>tokens</em>, not text, are the fundamental unit of understanding.</p><p>Instead of focusing on key-value hierarchies (like JSON), TOON is designed around <strong>semantic tokens</strong> that encode <strong>meaning, context, and intent</strong>.</p><p>Think of it as the bridge between <strong>symbolic reasoning</strong> and <strong>neural embeddings</strong> — a structured, yet cognitively meaningful, way for AI to communicate and store data.</p><h4>How TOON Works:</h4><blockquote>Token-Centric Design</blockquote><p>Every data element is broken into <strong>semantic tokens</strong> — each tagged with metadata that defines type, relation, and context. This enables models to align structured data directly with <strong>embedding vectors</strong> and <strong>tokenizers</strong>.</p><pre>[USER:Kapil#ENTITY(person), ROLE:Architect#PROFESSION, LOCATION:Pune#LOC, TOPIC:AI#DOMAIN]</pre><blockquote>Context-Aware Serialization</blockquote><p>TOON supports <em>context tagging</em> — every object or token can carry <strong>intent</strong>, <strong>confidence</strong>, and <strong>temporal relevance</strong>: This allows LLMs and agents to reason over time, probability, and relationships.</p><pre>[Event:Launch#ACTION(confidence=0.92,time=2025-11-01), Product:TOONv1#ENTITY]</pre><blockquote>Embeddings Integration</blockquote><p>Each token can optionally map to a <strong>vector ID</strong> in a <strong>vector database</strong> — making retrieval, reasoning, and similarity search <strong>natively token-aligned</strong>. This bridges the gap between symbolic notation and neural embeddings — turning TOON into a <strong>semantic layer</strong> for RAG pipelines.</p><pre>[Concept:Ethics#VECTOR(emb_id=AX4321), Domain:AGI#TOPIC]</pre><h4>Why TOON Matters in the AI Era</h4><p>The modern AI stack is rapidly evolving beyond text-based reasoning.<br> Frameworks like <strong>LangChain</strong>, <strong>CrewAI</strong>, and <strong>Agentic Graphs</strong> rely on intermediate representations that models can interpret dynamically.</p><p>But today, every pipeline still converts knowledge into <strong>plain text</strong> or <strong>JSON</strong>, losing layers of meaning in translation.</p><p>TOON solves that by becoming the <strong>native language of cognition</strong> — <br> a format where every token carries both <strong>structure and semantics</strong>.</p><p>Imagine:</p><ul><li>Agents exchanging information through TOON objects</li><li>RAG systems reasoning over semantically tagged data</li><li>AI auditors parsing <strong>intent</strong>, not just text</li></ul><h4>The Future of Data Is Semantic</h4><p>TOON represents the next logical evolution of information exchange — <br> from human-readable syntax (JSON) to <strong>AI-intelligible semantics</strong>.</p><p>As models continue to evolve toward <strong>AGI</strong>, they’ll need not just data to train on — but <strong>language to think in</strong>.</p><p>And that language won’t be English, or code. It will be <strong>Token-Oriented Object Notation</strong></p><blockquote>When AI begins to reason in tokens, not text,<br>data stops being information — and starts being thought</blockquote><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f92268267dc5" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/toon-the-future-of-machine-communication-token-oriented-object-notation-f92268267dc5">TOON — The Future of Machine Communication (Token-Oriented Object Notation)</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Artificial General Intelligence (AGI): When Machines Begin to Understand]]></title>
            <link>https://ai.plainenglish.io/artificial-general-intelligence-agi-when-machines-begin-to-understand-953d9ddb57a9?source=rss-af652456f293------2</link>
            <guid isPermaLink="false">https://medium.com/p/953d9ddb57a9</guid>
            <category><![CDATA[agi]]></category>
            <category><![CDATA[artificial-general-intell]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[future-of-ai]]></category>
            <dc:creator><![CDATA[Kapil Deshmukh]]></dc:creator>
            <pubDate>Mon, 03 Nov 2025 14:47:46 GMT</pubDate>
            <atom:updated>2025-11-25T07:08:21.185Z</atom:updated>
            <content:encoded><![CDATA[<h4>“We’re not teaching machines to think like us.<br> We’re teaching them to think <em>with</em> us.”</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*Paz1Uh3St1sv42tpwRyTyQ.webp" /></figure><h3><strong>🚀 The Dawn of a New Intelligence</strong></h3><p>For decades, artificial intelligence has been narrow, specialized, and task-driven. It classifies images, translates languages, writes essays, and predicts market trends — but it doesn’t <strong>understand</strong> what it’s doing.</p><p>Now, the world stands at the edge of something different — <strong>Artificial General Intelligence (AGI)</strong>. A form of intelligence that won’t just <em>complete tasks</em>, but will <em>comprehend goals</em>.</p><p>AGI won’t just follow instructions; it will <strong>reason, plan, and learn across domains</strong>. It won’t just generate — it will <strong>generalize</strong>.</p><h3>🧩 What Makes AGI Different</h3><p>Traditional AI relies on <em>training data</em> and <em>supervised outcomes</em>.<br>AGI will rely on <strong>emergent reasoning</strong>, <strong>continuous learning</strong>, and <strong>goal alignment</strong>.</p><p>Key capabilities include:</p><ol><li>🧠 <strong>Meta-Reasoning:</strong> Understanding not just what to do, but <em>why</em> to do it.</li><li>🔁 <strong>Continuous Self-Learning:</strong> Updating its own models through experience, not retraining.</li><li>🧭 <strong>Adaptive Goal Chaining:</strong> Creating sub-goals dynamically to achieve broader objectives.</li><li>💬 <strong>Contextual Awareness:</strong> Maintaining long-term memory and emotional intelligence.</li><li>⚖️ <strong>Ethical Cognition:</strong> Balancing outcomes within moral, social, and regulatory frameworks.</li></ol><p>In essence, AGI will <strong>think, reflect, and adapt</strong> — like a mind, not a machine.</p><h3><strong>⚡ The Challenges Ahead</strong></h3><p>AGI development isn’t just a technical race; it’s a <strong>philosophical reckoning</strong>.</p><h4>1. <strong>Alignment</strong></h4><p>How do we ensure AGI’s goals remain aligned with human intent — especially when it starts setting its own?</p><h4>2. Control</h4><p>When systems can self-improve, who governs the limits of evolution?</p><h4>3. Ethics</h4><p>Can morality be coded, or must it be <em>taught</em> through context, feedback, and shared experience?</p><h4>4. Safety</h4><p>Autonomy without constraints could be powerful — or catastrophic.<br> Guardrails, transparency, and human oversight must evolve in parallel.</p><h3>🔮 When Will We See True AGI?</h3><p>No one knows.</p><p>Some predict 2030. Others say never. But signs are emerging — reasoning agents, multi-modal intelligence, memory-driven LLMs, and open self-learning frameworks are <strong>pushing the boundary faster than expected</strong>.</p><p>The path to AGI won’t be a sudden jump. It will be a series of <em>small awakenings</em> — moments when AI begins to connect cause with consequence, decision with intent.</p><p>#AGI #AI #ArtificialGeneralIntelligence #FutureOfAI #AgenticAI #LLMOps #OpenAI #GenerativeAI #Ethics #MachineLearning</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=953d9ddb57a9" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/artificial-general-intelligence-agi-when-machines-begin-to-understand-953d9ddb57a9">Artificial General Intelligence (AGI): When Machines Begin to Understand</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Free Agentic AI Assistant — Planner → Tools → Executor → Summarizer (FastAPI + OpenRouter)]]></title>
            <link>https://pub.towardsai.net/build-a-free-agentic-ai-assistant-planner-tools-executor-summarizer-fastapi-openrouter-dc327ccb5588?source=rss-af652456f293------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc327ccb5588</guid>
            <dc:creator><![CDATA[Kapil Deshmukh]]></dc:creator>
            <pubDate>Sat, 01 Nov 2025 14:27:50 GMT</pubDate>
            <atom:updated>2025-11-09T05:50:09.673Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build a Free Agentic AI Assistant — Planner → Tools → Executor → Summarizer (FastAPI + OpenRouter)</h3><p><em>How I built a production-like agent that decides, calls real APIs, remembers conversations, and exposes a web UI — all for free and in under 200 lines of code</em></p><p>Most demos show chatbots that only answer from the model. Agentic AI is different: it <strong>plans</strong>, <strong>chooses tools</strong>, <strong>executes actions</strong>, and <strong>synthesizes results</strong>. This project shows how to build a full agentic assistant that:</p><ul><li>Calls <strong>real APIs</strong> (weather, time, news, currency, stocks, jokes)</li><li>Uses an LLM to <strong>plan which tools to call</strong> and how</li><li>Runs as a <strong>FastAPI</strong> microservice and serves a simple chat UI</li><li>Stores a tiny <strong>local memory</strong> (JSON) so the assistant can reference recent interactions</li></ul><p>And — the best part — you can run it locally <strong>without hosting models</strong>: it uses <strong>OpenRouter</strong> (DeepSeek free model) for the planning &amp; summarization steps.</p><h4>Prerequisites</h4><ul><li>Python 3.10+ installed</li><li>VS Code (or any editor)</li><li>pip available</li><li>An <strong>OpenRouter</strong> API key (free tier) — set OPENROUTER_API_KEY environment variable</li><li>Optional: NEWSDATA_API_KEY (free) if you want live news headlines</li></ul><p><strong>Folder structure</strong></p><pre>enterprise_agent/<br>├── app.py<br>├── agent.py<br>├── tools.py<br>├── config.py<br>├── memory.json       # created automatically<br>├── requirements.txt<br>└── static/<br>    ├── index.html<br>    └── script.js</pre><p><strong>Install dependencies</strong></p><p>Create requirements.txt with:</p><pre>fastapi<br>uvicorn<br>requests</pre><p>Install:</p><pre>pip install -r requirements.txt</pre><p>config.py</p><pre>import os<br><br>OPENROUTER_API_KEY = os.getenv(&quot;OPENROUTER_API_KEY&quot;)  # required<br>NEWSDATA_API_KEY = os.getenv(&quot;NEWSDATA_API_KEY&quot;)      # optional<br>OPENROUTER_URL = &quot;https://openrouter.ai/api/v1/chat/completions&quot;<br>MODEL = &quot;deepseek/deepseek-chat-v3.1:free&quot;<br>MEMORY_FILE = &quot;memory.json&quot;</pre><p>tools.py — Real APIs (weather, time, news, currency, stocks, joke, plan)</p><pre>import requests<br>import datetime<br>import math<br>from urllib.parse import quote<br>from config import NEWSDATA_API_KEY<br><br>def get_weather(city: str) -&gt; str:<br>    try:<br>        geo = requests.get(f&quot;https://geocoding-api.open-meteo.com/v1/search?name={quote(city)}&quot;, timeout=6).json()<br>        if not geo.get(&quot;results&quot;):<br>            return f&quot;Could not find coordinates for {city}.&quot;<br>        lat = geo[&quot;results&quot;][0][&quot;latitude&quot;]<br>        lon = geo[&quot;results&quot;][0][&quot;longitude&quot;]<br>        w = requests.get(<br>            f&quot;https://api.open-meteo.com/v1/forecast?latitude={lat}&amp;longitude={lon}&amp;current_weather=true&quot;,<br>            timeout=6<br>        ).json()<br>        curr = w.get(&quot;current_weather&quot;, {})<br>        temp = curr.get(&quot;temperature&quot;)<br>        code = curr.get(&quot;weathercode&quot;)<br>        return f&quot;The current temperature in {city} is {temp}°C (weather code {code}).&quot;<br>    except Exception as e:<br>        return f&quot;Weather data unavailable for {city}: {e}&quot;<br><br>def get_time(city: str) -&gt; str:<br>    try:<br>        r = requests.get(&quot;http://worldtimeapi.org/api/timezone/Etc/UTC&quot;, timeout=5).json()<br>        utc_time = r.get(&quot;datetime&quot;, &quot;&quot;)[:19].replace(&quot;T&quot;, &quot; &quot;)<br>        return f&quot;Current UTC time (approx for {city}) is {utc_time}.&quot;<br>    except Exception as e:<br>        return f&quot;Time data unavailable: {e}&quot;<br><br>def get_news(topic: str) -&gt; str:<br>    try:<br>        if not NEWSDATA_API_KEY:<br>            return &quot;No NewsData.io API key configured. Set NEWSDATA_API_KEY to enable news.&quot;<br>        url = f&quot;https://newsdata.io/api/1/news?apikey={NEWSDATA_API_KEY}&amp;q={quote(topic)}&amp;language=en&quot;<br>        data = requests.get(url, timeout=6).json()<br>        if not data.get(&quot;results&quot;):<br>            return f&quot;No news found for {topic}.&quot;<br>        headlines = [a.get(&quot;title&quot;, &quot;&quot;) for a in data[&quot;results&quot;][:3]]<br>        return f&quot;Top {topic} headlines:\n- &quot; + &quot;\n- &quot;.join(headlines)<br>    except Exception as e:<br>        return f&quot;News unavailable: {e}&quot;<br><br>def calculate(expression: str) -&gt; str:<br>    try:<br>        result = eval(expression, {&quot;__builtins__&quot;: {}, &quot;math&quot;: math})<br>        return f&quot;The result of {expression} is {result}.&quot;<br>    except Exception:<br>        return &quot;Invalid math expression.&quot;<br><br>def get_currency_rate(from_currency: str, to_currency: str) -&gt; str:<br>    try:<br>        res = requests.get(f&quot;https://api.exchangerate.host/convert?from={from_currency}&amp;to={to_currency}&quot;, timeout=6).json()<br>        rate = res.get(&quot;result&quot;)<br>        if rate is None:<br>            return f&quot;Could not fetch conversion for {from_currency} to {to_currency}.&quot;<br>        return f&quot;1 {from_currency.upper()} = {rate:.4f} {to_currency.upper()}&quot;<br>    except Exception as e:<br>        return f&quot;Currency conversion unavailable: {e}&quot;<br><br>def get_stock_price(symbol: str) -&gt; str:<br>    try:<br>        url = f&quot;https://query1.finance.yahoo.com/v7/finance/quote?symbols={symbol}&quot;<br>        data = requests.get(url, timeout=6).json()<br>        result = data.get(&quot;quoteResponse&quot;, {}).get(&quot;result&quot;)<br>        if not result:<br>            return f&quot;No stock data for {symbol}.&quot;<br>        price = result[0].get(&quot;regularMarketPrice&quot;)<br>        return f&quot;The current price of {symbol.upper()} is ${price:.2f}.&quot;<br>    except Exception as e:<br>        return f&quot;Stock data unavailable for {symbol}: {e}&quot;<br><br>def tell_joke() -&gt; str:<br>    try:<br>        joke = requests.get(&quot;https://v2.jokeapi.dev/joke/Any?type=single&quot;, timeout=5).json()<br>        return joke.get(&quot;joke&quot;, &quot;Couldn&#39;t fetch a joke.&quot;)<br>    except Exception:<br>        return &quot;No jokes available now.&quot;<br><br>def plan_day(tasks: str) -&gt; str:<br>    now = datetime.datetime.now()<br>    lines = []<br>    for i, t in enumerate(tasks.split(&quot;,&quot;)):<br>        lines.append(f&quot;{(now.hour + i) % 24}:00 - {t.strip().capitalize()}&quot;)<br>    return &quot;Here&#39;s your day plan:\n&quot; + &quot;\n&quot;.join(lines)<br><br>TOOLS = {<br>    &quot;get_weather&quot;: get_weather,<br>    &quot;get_time&quot;: get_time,<br>    &quot;get_news&quot;: get_news,<br>    &quot;calculate&quot;: calculate,<br>    &quot;get_currency_rate&quot;: get_currency_rate,<br>    &quot;get_stock_price&quot;: get_stock_price,<br>    &quot;tell_joke&quot;: tell_joke,<br>    &quot;plan_day&quot;: plan_day<br>}</pre><p>agent.py — Planner → Executor → Summarizer + Memory</p><pre>import json<br>import os<br>import requests<br>from config import OPENROUTER_API_KEY, OPENROUTER_URL, MODEL, MEMORY_FILE<br>from tools import TOOLS<br><br>def call_llm(messages):<br>    headers = {<br>        &quot;Authorization&quot;: f&quot;Bearer {OPENROUTER_API_KEY}&quot;,<br>        &quot;Content-Type&quot;: &quot;application/json&quot;,<br>    }<br>    payload = {&quot;model&quot;: MODEL, &quot;messages&quot;: messages, &quot;temperature&quot;: 0.35}<br>    r = requests.post(OPENROUTER_URL, headers=headers, json=payload, timeout=20)<br>    r.raise_for_status()<br>    return r.json()[&quot;choices&quot;][0][&quot;message&quot;][&quot;content&quot;]<br><br>def load_memory():<br>    if not os.path.exists(MEMORY_FILE):<br>        return []<br>    with open(MEMORY_FILE, &quot;r&quot;) as f:<br>        return json.load(f)<br><br>def save_memory(conversations):<br>    with open(MEMORY_FILE, &quot;w&quot;) as f:<br>        json.dump(conversations, f, indent=2)<br><br>def planner(user_input):<br>    system = &quot;&quot;&quot;You are an AI planner. Given the user&#39;s question decide which tools to call.<br>Available tools:<br>get_weather(city), get_time(city), get_news(topic), calculate(expression),<br>get_currency_rate(from_currency,to_currency), get_stock_price(symbol),<br>tell_joke(), plan_day(tasks)<br><br>Respond STRICTLY as JSON in this format:<br>{&quot;actions&quot;:[{&quot;tool&quot;:&quot;tool_name&quot;,&quot;args&quot;:{&quot;param&quot;:&quot;value&quot;}}]}&quot;&quot;&quot;<br>    choice = call_llm([<br>        {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: system},<br>        {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: user_input}<br>    ])<br>    try:<br>        return json.loads(choice)<br>    except Exception:<br>        return {&quot;actions&quot;: []}<br><br>def executor(actions):<br>    results = []<br>    for act in actions:<br>        tool = act.get(&quot;tool&quot;)<br>        args = act.get(&quot;args&quot;, {}) or {}<br>        if tool in TOOLS:<br>            try:<br>                res = TOOLS[tool](**args)<br>            except TypeError:<br>                res = f&quot;Tool invocation error for {tool} with args {args}&quot;<br>            results.append(f&quot;{tool}({args}) -&gt; {res}&quot;)<br>        else:<br>            results.append(f&quot;Unknown tool: {tool}&quot;)<br>    return results<br><br>def summarizer(user_input, results, memory):<br>    prompt = [<br>        {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: &quot;You summarize tool outputs into a human-friendly answer. Provide sources/notes when applicable.&quot;},<br>        {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: f&quot;User asked: {user_input}\nTool results:\n{results}\nRecent memory: {memory[-3:]}&quot;}<br>    ]<br>    return call_llm(prompt)<br><br>def run_agent(user_input: str):<br>    memory = load_memory()<br>    plan = planner(user_input)<br>    actions = plan.get(&quot;actions&quot;, [])<br>    results = executor(actions)<br>    final = summarizer(user_input, results, memory)<br>    memory.append({&quot;query&quot;: user_input, &quot;plan&quot;: plan, &quot;results&quot;: results, &quot;answer&quot;: final})<br>    save_memory(memory)<br>    return {&quot;plan&quot;: plan, &quot;results&quot;: results, &quot;final&quot;: final}</pre><p>app.py — FastAPI server + static files</p><pre>from fastapi import FastAPI, Query<br>from fastapi.staticfiles import StaticFiles<br>from fastapi.responses import FileResponse<br>from agent import run_agent<br><br>app = FastAPI(title=&quot;Enterprise Agentic Assistant&quot;)<br><br>app.mount(&quot;/static&quot;, StaticFiles(directory=&quot;static&quot;), name=&quot;static&quot;)<br><br>@app.get(&quot;/&quot;)<br>def home():<br>    return FileResponse(&quot;static/index.html&quot;)<br><br>@app.get(&quot;/ask&quot;)<br>def ask_agent(query: str = Query(..., description=&quot;User question or instruction&quot;)):<br>    result = run_agent(query)<br>    return {<br>        &quot;query&quot;: query,<br>        &quot;plan&quot;: result[&quot;plan&quot;],<br>        &quot;results&quot;: result[&quot;results&quot;],<br>        &quot;final_answer&quot;: result[&quot;final&quot;]<br>    }</pre><p>static/index.html (simple chat UI)</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot; /&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;/&gt;<br>  &lt;title&gt;Enterprise Agentic Assistant&lt;/title&gt;<br>  &lt;link href=&quot;https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css&quot; rel=&quot;stylesheet&quot;&gt;<br>&lt;/head&gt;<br>&lt;body class=&quot;bg-gray-100 flex flex-col h-screen&quot;&gt;<br>  &lt;header class=&quot;bg-indigo-600 text-white text-center py-4&quot;&gt;<br>    &lt;h1 class=&quot;text-2xl font-semibold&quot;&gt;🤖 Enterprise Agentic Assistant&lt;/h1&gt;<br>  &lt;/header&gt;<br><br>  &lt;main id=&quot;chat-box&quot; class=&quot;flex-1 p-4 overflow-y-auto&quot;&gt;<br>    &lt;div class=&quot;text-center text-gray-500 mt-10&quot;&gt;Ask anything — weather, news, stocks, currency, jokes.&lt;/div&gt;<br>  &lt;/main&gt;<br><br>  &lt;footer class=&quot;p-4 bg-white border-t flex&quot;&gt;<br>    &lt;input id=&quot;user-input&quot; type=&quot;text&quot; placeholder=&quot;Type your question...&quot; class=&quot;flex-1 border rounded-lg px-4 py-2&quot; /&gt;<br>    &lt;button id=&quot;send-btn&quot; class=&quot;ml-2 bg-indigo-600 text-white px-4 py-2 rounded-lg&quot;&gt;Send&lt;/button&gt;<br>  &lt;/footer&gt;<br><br>  &lt;script src=&quot;script.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>static/script.js</p><pre>const input = document.getElementById(&quot;user-input&quot;);<br>const sendBtn = document.getElementById(&quot;send-btn&quot;);<br>const chatBox = document.getElementById(&quot;chat-box&quot;);<br><br>async function sendMessage() {<br>  const query = input.value.trim();<br>  if (!query) return;<br>  appendMessage(&quot;user&quot;, query);<br>  input.value = &quot;&quot;;<br>  appendMessage(&quot;assistant&quot;, &quot;⏳ Thinking...&quot;);<br>  try {<br>    const res = await fetch(`/ask?query=${encodeURIComponent(query)}`);<br>    const data = await res.json();<br>    chatBox.lastElementChild.remove(); // remove thinking<br>    const reply = data.final_answer || &quot;⚠️ No response&quot;;<br>    appendMessage(&quot;assistant&quot;, reply);<br>  } catch (err) {<br>    chatBox.lastElementChild.remove();<br>    appendMessage(&quot;assistant&quot;, &quot;❌ Error connecting to server.&quot;);<br>  }<br>}<br><br>function appendMessage(role, text) {<br>  const msg = document.createElement(&quot;div&quot;);<br>  msg.className = role === &quot;user&quot; ? &quot;text-right my-2&quot; : &quot;text-left my-2&quot;;<br>  const bubble = document.createElement(&quot;div&quot;);<br>  bubble.className = role === &quot;user&quot; ? &quot;inline-block bg-indigo-600 text-white px-4 py-2 rounded-lg&quot; : &quot;inline-block bg-gray-200 px-4 py-2 rounded-lg&quot;;<br>  bubble.innerHTML = text.replace(/\n/g, &quot;&lt;br&gt;&quot;);<br>  msg.appendChild(bubble);<br>  chatBox.appendChild(msg);<br>  chatBox.scrollTop = chatBox.scrollHeight;<br>}<br><br>sendBtn.addEventListener(&quot;click&quot;, sendMessage);<br>input.addEventListener(&quot;keydown&quot;, (e) =&gt; { if (e.key === &quot;Enter&quot;) sendMessage(); });</pre><p>How to run (quickly)</p><pre>uvicorn app:app --reload<br>http://127.0.0.1:8000/</pre><p>Next steps &amp; ideas to extend</p><ul><li>Add <strong>long-term vector memory</strong> using embeddings + Pinecone/Weaviate for semantic recall.</li><li>Add a <strong>calendar integration</strong> (Google Calendar / Microsoft Graph) as a real tool.</li><li>Replace Yahoo price calls with a <strong>paid market-data API</strong> for accurate intraday data.</li><li>Deploy to <strong>Azure App Service</strong> or <strong>Azure Container Apps</strong>; add monitoring (App Insights) and secrets (Key Vault).</li><li>Add <strong>LangChain/LlamaIndex</strong> style retriever if you want RAG capabilities over documents.</li></ul><blockquote><em>Agentic AI is the natural next step beyond chat — enterprises want assistants that act, not just answer. This project gives you the blueprint: planner, tools, executor, summarizer, and memory — the core building blocks of real agentic systems. The stack is minimal, free, and practical — perfect for prototypes, demos, and portfolio pieces.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc327ccb5588" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/build-a-free-agentic-ai-assistant-planner-tools-executor-summarizer-fastapi-openrouter-dc327ccb5588">Build a Free Agentic AI Assistant — Planner → Tools → Executor → Summarizer (FastAPI + OpenRouter)</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Vector Similarity Search Powers RAG and Agentic AI in Enterprise Applications]]></title>
            <link>https://pub.towardsai.net/how-vector-similarity-search-powers-rag-and-agentic-ai-in-enterprise-applications-1125e9db5b32?source=rss-af652456f293------2</link>
            <guid isPermaLink="false">https://medium.com/p/1125e9db5b32</guid>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[faiss]]></category>
            <category><![CDATA[vector-embeddings]]></category>
            <category><![CDATA[euclidean-distance]]></category>
            <category><![CDATA[cosine-similarity]]></category>
            <dc:creator><![CDATA[Kapil Deshmukh]]></dc:creator>
            <pubDate>Thu, 04 Sep 2025 12:57:54 GMT</pubDate>
            <atom:updated>2025-11-10T03:34:16.075Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>From embeddings to retrieval: mastering vector similarity search for next-gen enterprise AI applications.</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HRHxLmdxrO48Y047" /><figcaption>Photo by <a href="https://unsplash.com/@eclipticgraphic?utm_source=medium&amp;utm_medium=referral">Ecliptic Graphic</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>🚀 Introduction</h3><p>If you’ve ever asked ChatGPT a question like <em>“What animal likes milk?”</em> and received a precise answer, you’ve already seen <strong>vector similarity search in action</strong>.</p><p>Behind the scenes, AI systems rely on <strong>embeddings</strong> (numerical representations of text) and <strong>vector databases</strong> to find the most relevant information. This is the backbone of <strong>Retrieval-Augmented Generation (RAG)</strong>, <strong>agentic AI</strong>, and modern <strong>enterprise AI chatbots</strong>.</p><p>In this article, we’ll explore:</p><ul><li>How <strong>embeddings</strong> transform text into vectors.</li><li>The role of <strong>similarity metrics</strong> (cosine, Euclidean, dot product).</li><li>How <strong>vector databases</strong> like FAISS, Pinecone, and Weaviate enable lightning-fast search.</li><li>A <strong>hands-on Python demo</strong> with OpenAI embeddings.</li></ul><h3>🧠 What Are Embeddings?</h3><p>Think of embeddings as the <strong>language of meaning</strong> for AI.</p><ul><li>Text is converted into high-dimensional vectors (e.g., 1536 dimensions for OpenAI).</li><li>Similar concepts produce vectors that are <strong>close together</strong>.</li></ul><p>Example:</p><p>&quot;cat&quot; → [0.8, 0.1, 0.2, …]</p><p>&quot;dog&quot; → [0.7, 0.15, 0.25, …]</p><p>&quot;car&quot; → [-0.2, 0.9, -0.1, …]</p><p>Here, cat and dog vectors are close, while car is far away.</p><h3>🏗️ The Role of Vector Databases</h3><p>When enterprises deal with <strong>millions of documents</strong>, they can’t compare every vector manually.<br> That’s where <strong>vector databases</strong> like <strong>FAISS, Pinecone, Weaviate, and Qdrant</strong> come into picture.</p><p>They:</p><ul><li>Store embeddings efficiently.</li><li>Support <strong>Approximate Nearest Neighbor (ANN)</strong> search for speed.</li><li>Provide APIs to integrate with <strong>LLMs</strong> for RAG pipelines.</li></ul><h3>🧑‍💻 Hands-On Demo with Python</h3><p>Let’s see how embeddings + similarity search work in practice.</p><pre># Install dependencies:<br># pip install openai faiss-cpu<br><br>import openai, faiss, numpy as np<br>openai.api_key = &quot;YOUR_OPENAI_API_KEY&quot;<br><br>docs = [<br>    &quot;Cats are small domesticated animals that like milk.&quot;,<br>    &quot;Dogs are loyal and bark at strangers.&quot;,<br>    &quot;Cars are used for transportation on roads.&quot;<br>]<br><br># Get embeddings from OpenAI<br>def embed(text, model=&quot;text-embedding-3-small&quot;):<br>    resp = openai.embeddings.create(input=[text], model=model)<br>    return np.array(resp.data[0].embedding, dtype=np.float32)<br><br>doc_embeddings = [embed(d) for d in docs]<br>dim = len(doc_embeddings[0])<br><br># Build FAISS index (cosine)<br>index = faiss.IndexFlatIP(dim)<br>normed_docs = np.array([v/np.linalg.norm(v) for v in doc_embeddings])<br>index.add(normed_docs)<br><br># Query<br>query = &quot;What animal likes milk?&quot;<br>q_emb = embed(query) / np.linalg.norm(embed(query))<br><br># Search<br>scores, idx = index.search(np.array([q_emb]), 2)<br><br>print(&quot;\n🔹 Results:&quot;)<br>for i, doc_id in enumerate(idx[0]):<br>    print(f&quot;Rank {i+1}: {docs[doc_id]} (score={scores[0][i]:.4f})&quot;)</pre><p>Expected Output</p><pre>🔹 Results:<br>Rank 1: Cats are small domesticated animals that like milk. (score ~0.9)<br>Rank 2: Dogs are loyal and bark at strangers. (score ~0.6)</pre><h3>🏆 Key Takeaways</h3><ol><li><strong>Embeddings</strong> transform text into machine-understandable vectors.</li><li><strong>Cosine similarity</strong> is the go-to metric for semantic search in AI apps.</li><li><strong>Vector databases</strong> like Pinecone and FAISS make retrieval fast at scale.</li><li>Together, they power <strong>RAG pipelines, chatbots, and agentic AI workflows</strong> in enterprise environments.</li></ol><p><em>The future of enterprise AI isn’t just about large language models.<br> It’s about combining LLMs with </em><strong><em>retrieval, reasoning, and tool orchestration</em></strong><em> — and at the heart of it all lies </em><strong><em>vector similarity search</em></strong><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1125e9db5b32" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/how-vector-similarity-search-powers-rag-and-agentic-ai-in-enterprise-applications-1125e9db5b32">How Vector Similarity Search Powers RAG and Agentic AI in Enterprise Applications</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with LangChain: A Fun Guide for Absolute Beginners]]></title>
            <link>https://pub.towardsai.net/getting-started-with-langchain-a-fun-guide-for-absolute-beginners-790c4dd822d0?source=rss-af652456f293------2</link>
            <guid isPermaLink="false">https://medium.com/p/790c4dd822d0</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[langchain]]></category>
            <category><![CDATA[ai-development]]></category>
            <dc:creator><![CDATA[Kapil Deshmukh]]></dc:creator>
            <pubDate>Tue, 02 Sep 2025 04:33:50 GMT</pubDate>
            <atom:updated>2025-11-10T03:33:34.910Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Imagine you’re building with LLMs (large language models), but every time you need prompts, memory, or tool integration, you reinvent the wheel. Enter <strong>LangChain</strong> — your LLM-powered Swiss Army knife.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e3ATJk0RpiTUD7RV" /><figcaption>Photo by <a href="https://unsplash.com/@edge2edgemedia?utm_source=medium&amp;utm_medium=referral">Edge2Edge Media</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Large Language Models (LLMs) like OpenAI’s GPT, DeepSeek, or Anthropic’s Claude are powerful — but let’s be honest, using them directly can get messy. Imagine writing raw prompts for every task, managing APIs, memory, vector databases, and agents on your own. 😅 That’s where <strong>LangChain</strong> comes in.</p><p>LangChain is like the <strong>Lego toolkit for LLMs</strong>: it gives you ready-made building blocks so you can quickly create AI apps without reinventing the wheel.</p><p>In this article, we’ll explore:<br> ✅ What LangChain is<br> ✅ Why developers use it<br> ✅ Key components explained with examples<br> ✅ A mini hands-on project</p><h4>🌟 Why LangChain?</h4><p>Think of an AI app you might want to build:</p><ul><li>A <strong>chatbot</strong> that remembers past conversations</li><li>A <strong>research assistant</strong> that searches PDFs or the web</li><li>An <strong>agent</strong> that can call APIs or execute code</li></ul><p>Without LangChain, you’d spend weeks wiring everything manually. With LangChain, you snap components together like blocks.</p><h4>🧩 Key Concepts in LangChain (Explained Simply)</h4><p>Here are the “Lego blocks” you’ll use most often:</p><ul><li><strong>LLMs</strong> → The brain (e.g., GPT, DeepSeek, LLaMA).</li></ul><pre>from langchain_openai import OpenAI<br><br>llm = OpenAI(temperature=0.7, openai_api_key=&quot;your_key&quot;)</pre><p><em>This sets up your AI brain with a creative flair (temperature = randomness).</em></p><ul><li><strong>Prompts</strong> → The instructions you give to the model.</li></ul><pre>from langchain.prompts import PromptTemplate<br><br>prompt = PromptTemplate.from_template(&quot;Write a tweet about {topic}&quot;)</pre><p><em>Prompts are like recipes. You tell the AI what ingredients (variables) to use.</em></p><ul><li><strong>Chains</strong> → Linking prompts + LLMs into a pipeline.</li></ul><pre>from langchain.chains import LLMChain<br><br>chain = LLMChain(llm=llm, prompt=prompt)<br>print(chain.run(&quot;LangChain basics&quot;))</pre><p><em>Chains let you connect multiple steps, like asking → answering → summarizing.</em></p><ul><li><strong>Memory</strong> → Letting the chatbot “remember” past chats.</li></ul><pre>from langchain.memory import ConversationBufferMemory<br><br>memory = ConversationBufferMemory()</pre><p><em>Without memory, your AI is like Dory from Finding Nemo 🐟</em></p><ul><li><strong>Agents</strong> → Giving AI tools (search, calculator, APIs).</li></ul><pre># Pseudocode<br>agent = initialize_agent(tools=[search_tool, calculator], llm=llm)<br>agent.run(&quot;What&#39;s 2+2 and latest AI news?&quot;)</pre><ul><li><strong>Vectorstores</strong> → Long-term memory for documents.</li></ul><pre>from langchain_community.vectorstores import FAISS<br><br>vectorstore = FAISS.from_texts(docs, embeddings)</pre><p><em>Useful for RAG (Retrieval-Augmented Generation): answering from your PDFs, websites, or databases.</em></p><h4>🚀 A Hands-On Mini Project</h4><pre>from langchain_openai import OpenAI<br>from langchain.chains import RetrievalQA<br>from langchain_community.vectorstores import FAISS<br>from langchain.embeddings import OpenAIEmbeddings<br><br># Step 1: LLM<br>llm = OpenAI(openai_api_key=&quot;your_key&quot;)<br><br># Step 2: Create embeddings<br>embeddings = OpenAIEmbeddings(openai_api_key=&quot;your_key&quot;)<br><br># Step 3: Store notes in vector DB<br>docs = [&quot;LangChain is a framework for LLMs.&quot;,<br>        &quot;It helps build chatbots, agents, and RAG systems.&quot;]<br>db = FAISS.from_texts(docs, embeddings)<br><br># Step 4: Retrieval + QA<br>qa = RetrievalQA.from_chain_type(llm=llm, retriever=db.as_retriever())<br>print(qa.run(&quot;What is LangChain?&quot;))</pre><p><em>This is </em><strong><em>RAG in action</em></strong><em>, one of the most practical use case today.</em></p><p>👉 <em>If you found this useful, clap 👏 and follow me for more AI tutorials!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=790c4dd822d0" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/getting-started-with-langchain-a-fun-guide-for-absolute-beginners-790c4dd822d0">Getting Started with LangChain: A Fun Guide for Absolute Beginners</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>