<?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 Nagh on Medium]]></title>
        <description><![CDATA[Stories by Nagh on Medium]]></description>
        <link>https://medium.com/@17nagh?source=rss-df190c4c23fb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LFqv5wIyKLmrE_oVsk0QXg.jpeg</url>
            <title>Stories by Nagh on Medium</title>
            <link>https://medium.com/@17nagh?source=rss-df190c4c23fb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 14:23:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@17nagh/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[Building an Enterprise AI Gateway with Azure API Management and Azure AI Foundry]]></title>
            <link>https://medium.com/@17nagh/building-an-enterprise-ai-gateway-with-azure-api-management-and-azure-ai-foundry-504e1d5e6e97?source=rss-df190c4c23fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/504e1d5e6e97</guid>
            <category><![CDATA[apim]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[microsoft-foundry]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[openai]]></category>
            <dc:creator><![CDATA[Nagh]]></dc:creator>
            <pubDate>Mon, 25 May 2026 16:36:45 GMT</pubDate>
            <atom:updated>2026-05-25T16:36:45.817Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LkTBOvytCMkhPPNqPv1A_w.png" /></figure><p>As organizations scale Generative AI applications, one of the biggest challenges is no longer just model access - it’s reliability, scalability, governance, and traffic management.</p><p>A single Azure OpenAI / Azure AI Foundry deployment can quickly hit:</p><ul><li>TPM (Tokens Per Minute) limits</li><li>RPM (Requests Per Minute) limits</li><li>regional throttling</li><li>availability constraints</li></ul><p>To solve this, I recently explored building an AI Gateway architecture using Azure API Management (APIM) in front of multiple Azure AI Foundry GPT-4.1 deployments.</p><p>The setup turned out to be a very interesting enterprise-grade architecture pattern for scalable GenAI systems.</p><h3>Architecture Overview</h3><p>The architecture looked like this:</p><pre>Client Applications<br>        ↓<br>Azure API Management (APIM)<br>        ↓<br>Backend Pool (Load Balancer)<br>     ├── Azure AI Foundry Instance 1<br>     └── Azure AI Foundry Instance 2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URgE6CS50lvWyamint7HOA.png" /></figure><p>The idea was simple:</p><ul><li>expose a single AI endpoint through APIM</li><li>distribute requests across multiple GPT-4.1 deployments</li><li>centralize authentication and governance</li><li>improve throughput and resiliency</li></ul><h3>Why APIM for Azure OpenAI?</h3><p>Azure API Management acts as an AI Gateway layer.</p><p>Instead of applications directly calling Azure OpenAI deployments, all traffic flows through APIM.</p><p>This enables:</p><ul><li>centralized authentication</li><li>traffic routing</li><li>rate limiting</li><li>retries</li><li>observability</li><li>backend abstraction</li><li>multi-region failover</li><li>model governance</li></ul><p>In enterprise environments, this becomes extremely valuable when multiple teams and applications consume AI models at scale.</p><h3>Infrastructure Setup</h3><p>I created:</p><ul><li><strong>Azure AI Foundry Instance 1</strong> — GPT-4.1 deployment</li><li><strong>Azure AI Foundry Instance 2</strong> — GPT-4.1 deployment</li><li><strong>Azure API Management (APIM)</strong> — AI Gateway</li></ul><p>Both Foundry instances had:</p><ul><li>Model: gpt-4.1</li><li>Deployment Name: gpt-4.1</li></ul><p>Using identical deployment names simplifies backend routing significantly.</p><h3>Backend Pool Configuration</h3><p>Inside APIM, I configured:</p><ul><li>Two backend services</li><li>A backend pool called gpt41-pool</li><li>Weighted load balancing across deployments</li></ul><p>Configuration used:</p><ul><li><strong>aoai-dev-01 → </strong>Priority: 1 → Weight: 50</li><li><strong>aoai-dev-02 → </strong>Priority: 1 → Weight: 50</li></ul><p>This allowed APIM to distribute traffic approximately evenly across both GPT-4.1 deployments.</p><p>Instead of using API keys, APIM authenticated to Azure OpenAI using Managed Identity.</p><p>This is one of the cleanest patterns for enterprise deployments.</p><p>The APIM Managed Identity was assigned:</p><pre>Cognitive Services OpenAI User</pre><p>role on both Azure AI Foundry resources.</p><h3>APIM Policy Configuration</h3><p>The core of the architecture was implemented using APIM policies.</p><pre>&lt;policies&gt;<br>    &lt;inbound&gt;<br>        &lt;base /&gt;<br>          &lt;set-backend-service backend-id=&quot;gpt41-pool&quot; /&gt;<br>          &lt;authentication-managed-identity<br>            resource=&quot;https://cognitiveservices.azure.com&quot;<br>            output-token-variable-name=&quot;mi-token&quot;<br>            ignore-error=&quot;false&quot; /&gt;<br>        &lt;set-header name=&quot;Authorization&quot; exists-action=&quot;override&quot;&gt;<br>            &lt;value&gt;@(&quot;Bearer &quot; + (string)context.Variables[&quot;mi-token&quot;])&lt;/value&gt;<br>        &lt;/set-header&gt;<br>        &lt;rewrite-uri template=&quot;/openai/deployments/gpt-4.1/chat/completions?api-version=2025-01-01-preview&quot; /&gt;<br>    &lt;/inbound&gt;<br>    &lt;backend&gt;<br>        &lt;forward-request /&gt;<br>    &lt;/backend&gt;<br>    &lt;outbound&gt;<br>        &lt;base /&gt;<br>    &lt;/outbound&gt;<br>&lt;/policies&gt;</pre><p>This policy handled:</p><ul><li>backend pool selection</li><li>Managed Identity authentication</li><li>deployment-specific routing</li></ul><h3>One Important Learning About Deployment Routing</h3><p>Even though the Foundry resources also contained other models such as:</p><ul><li>gpt-4o</li><li>gpt-4.1-mini</li></ul><p>APIM still routed specifically to:</p><pre>gpt-4.1</pre><p>because of:</p><pre>&lt;rewrite-uri template=&quot;/openai/deployments/gpt-4.1/chat/completions?api-version=2025-01-01-preview&quot; /&gt;</pre><p>This was an important insight.</p><p>The backend URL only points to the Foundry service endpoint.</p><p>The actual model/deployment selection happens through the rewritten deployment path.</p><h3>Testing Load Balancing</h3><p>To validate the setup properly, I used Python async load testing instead of relying only on the APIM Test Console.</p><p>Using aiohttp + asyncio, I sent concurrent requests through APIM and observed:</p><ul><li>request distribution</li><li>throttling behavior</li><li>backend utilization</li><li>throughput scaling</li></ul><p>Example test setup:</p><pre>TOTAL_REQUESTS = 10<br>CONCURRENT_REQUESTS = 2<br>max_tokens = 10</pre><h3>Understanding TPM and 429 Errors</h3><p>One surprising observation was how Azure OpenAI handles TPM throttling.</p><p>At first glance, it seems intuitive that:</p><pre>20 requests × 10 max_tokens = 200 tokens</pre><p>should easily fit within a 1K TPM deployment.</p><p>But Azure OpenAI throttling is more nuanced.</p><p>Token estimation includes:</p><ul><li>input prompt tokens</li><li>output tokens</li><li>formatting overhead</li><li>internal token estimation</li><li>rolling token windows</li><li>RPM limits</li><li>burst concurrency behavior</li></ul><p>This means even relatively small concurrent bursts can still trigger:</p><pre>429 Too Many Requests</pre><p>especially with lower TPM allocations.</p><h3>Why This Architecture Matters</h3><p>This pattern effectively creates:</p><ul><li>a scalable AI gateway</li><li>centralized governance layer</li><li>abstraction between applications and models</li></ul><p>Benefits include:</p><ul><li>horizontal TPM scaling</li><li>multi-region resiliency</li><li>centralized security</li><li>retry/failover support</li><li>easier observability</li><li>simplified client integration</li></ul><p>Applications only talk to APIM.</p><p>APIM handles:</p><ul><li>backend selection</li><li>authentication</li><li>routing</li><li>retries</li><li>scaling</li></ul><h3>Interesting New APIM AI Features</h3><p>While exploring this architecture, I also came across new APIM AI capabilities:</p><ul><li>Language Model API</li><li>Microsoft Foundry API</li><li>A2A Agent support</li></ul><p>These features suggest Microsoft is evolving APIM into a full-fledged Enterprise AI Gateway platform.</p><p>The newer Foundry integration especially looks promising because it can automate much of the manual setup:</p><ul><li>backend configuration</li><li>model routing</li><li>AI policies</li><li>authentication</li></ul><p>This feels like the future direction for scalable enterprise GenAI systems on Azure.</p><h3>Final Thoughts</h3><p>Building scalable AI systems is quickly becoming less about “calling an LLM” and more about:</p><ul><li>governance</li><li>resiliency</li><li>observability</li><li>throughput management</li><li>platform engineering</li></ul><p>Azure API Management combined with Azure AI Foundry provides a powerful pattern for solving these challenges in enterprise environments.</p><p>This was a very interesting architecture to experiment with, especially around:</p><ul><li>APIM backend pools</li><li>deployment routing</li><li>TPM behavior</li><li>AI gateway design</li><li>concurrent traffic management</li></ul><p>And it’s clear that AI Gateway architectures are going to become increasingly important as enterprise GenAI adoption grows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=504e1d5e6e97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AutoGen by Microsoft: A Framework for Conversational AI Agent]]></title>
            <link>https://medium.com/@17nagh/autogen-by-microsoft-a-framework-for-conversational-ai-agent-15cde5ba97af?source=rss-df190c4c23fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/15cde5ba97af</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[autogen]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[openai]]></category>
            <dc:creator><![CDATA[Nagh]]></dc:creator>
            <pubDate>Mon, 04 Aug 2025 08:34:14 GMT</pubDate>
            <atom:updated>2025-08-04T08:34:14.839Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction:</h3><p><strong>AutoGen</strong> is an open-source framework designed to orchestrate multi-agent LLM systems using a <strong>conversational programming paradigm</strong>. It allows developers to create and manage AI agents that can communicate, delegate tasks, and collaborate — just like human teams do. Whether you’re building a code generation assistant, an automated researcher, or a multi-agent RAG pipeline, AutoGen makes it easy to define roles, structure agent interactions, and execute complex tasks with minimal boilerplate.</p><p>There are multiple versions available for Autogen, be cautious while using code completions like chatgpt, perplexity as it may provide older version functionalities (V0.2)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/0*CCOl5JQ1_CDq635i.png" /></figure><h3>📚 A Word on Documentation: Surprisingly Enjoyable!</h3><p>One of the most pleasant surprises I encountered while working with AutoGen was its exceptional documentation. I’ve never been the type to enjoy reading long docs before diving into code — but AutoGen changed that for me. The documentation is clean, intuitive, and beginner-friendly, even for developers who are new to multi-agent frameworks or LLM orchestration.</p><p>From clear examples to step-by-step guides, the docs make it easy to go from “What is this?” to “I just built something useful!” in no time. Huge kudos to the AutoGen documentation team — you’ve made the learning curve not just manageable, but actually enjoyable. 👏👏👏</p><ul><li>Docs ≥ <a href="https://microsoft.github.io/autogen/stable/">V0.4</a></li><li>Docs = <a href="https://microsoft.github.io/autogen/0.2/docs/Getting-Started">V0.2</a></li></ul><h3>📊 Comparison of AutoGen with Other AI Frameworks</h3><p>When it comes to building agentic or LLM-powered applications, several frameworks are available — each with its own strengths and ideal use cases. Here’s how <strong>AutoGen v0.4</strong> stacks up against popular alternatives:</p><p><a href="https://medium.com/@shiqs90/getting-started-with-autogen-agents-a-beginners-guide-ecbe676bba50">source</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*0QOcUSl2LsAvK4Uf.png" /></figure><h3>Connect AzureOpenAI Model</h3><pre>provider: autogen_ext.models.openai.AzureOpenAIChatCompletionClient<br>config:<br>  azure_deployment: &quot;&lt;deployment_name&gt;&quot;<br>  model: &lt;model_name&gt;<br>  api_version: &lt;api_key&gt;<br>  azure_endpoint: https://&lt;openai_service_name&gt;.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2025-01-01-preview<br>  api_key: &lt;api_key&gt;</pre><pre># uv add pyyaml                     &quot;pyyaml&gt;=6.0.2&quot;<br># uv add autogen-ext[azure,openai]  &quot;autogen-ext[azure,openai]&gt;=0.7.1&quot;<br>import yaml<br>with open(&quot;model_config.yaml&quot;, &quot;r&quot;) as f:<br>    model_config = yaml.safe_load(f)<br>model_client = ChatCompletionClient.load_component(model_config)</pre><h3>🧩 Types of Agents in AutoGen</h3><p>AutoGen comes with several <strong>built-in agent types</strong>, each designed for a specific purpose:</p><p>🔹 UserProxyAgent</p><ul><li>Represents a <strong>human or external user</strong>.</li><li>Can inject messages, execute code, or act as a proxy for human interaction.</li></ul><p>🔹 AssistantAgent</p><ul><li>A general-purpose <strong>LLM assistant</strong>.</li><li>Often acts as the <strong>primary problem solver</strong> in an agent team.</li></ul><p>🔹 Custom Agents</p><ul><li>You can subclass any agent to create a <strong>custom role</strong> with unique behavior.</li></ul><p>Add-on feature is that you can define the agent output schema using pydantic</p><pre># The response format for the agent as a Pydantic base model.<br>class AgentResponse(BaseModel):<br>    thoughts: str<br>    response: Literal[&quot;happy&quot;, &quot;sad&quot;, &quot;neutral&quot;]<br><br>agent = AssistantAgent(<br>    &quot;assistant&quot;,<br>    model_client=model_client,<br>    system_message=&quot;Categorize the input as happy, sad, or neutral following the JSON format.&quot;,<br>    # Define the output content type of the agent.<br>    output_content_type=AgentResponse,<br>)</pre><p>Most of the use cases you solve can be acheived using AssistantAgent, but in case you have to define a custom agent that can also be done</p><pre><br>class RequirementsGatheringAgent(BaseChatAgent):<br>    def __init__(self, name: str, user_message: str, llm_client:AzureOpenAIChatCompletionClient, requirement_gathering_agent_prompt: str) -&gt; None:<br><br>        super().__init__(name, &quot;An LLM-powered requirement gathering agent.&quot;)<br>        self._user_message = user_message<br>        self._llm_client = llm_client<br>        self._requirement_gathering_agent_prompt = requirement_gathering_agent_prompt.format(user_message=self._user_message)<br><br>    @property<br>    def produced_message_types(self) -&gt; Sequence[type[BaseChatMessage]]:<br>        return (TextMessage,) [4-6]<br><br><br>    async def on_messages(self, messages: Sequence[BaseChatMessage], cancellation_token: CancellationToken) -&gt; Response:<br>        # Calls the on_messages_stream.<br>        response: Response | None = None<br>        async for message in self.on_messages_stream(messages, cancellation_token):<br>            if isinstance(message, Response):<br>                response = message<br>        assert response is not None<br>        return response<br><br>    async def on_messages_stream(<br>        self, messages: Sequence[BaseChatMessage], cancellation_token: CancellationToken<br>    ) -&gt; AsyncGenerator[BaseAgentEvent | BaseChatMessage | Response, None]:<br>        inner_messages: List[BaseAgentEvent | BaseChatMessage] = []<br>        result = await self._llm_client.create([UserMessage(content=self._requirement_gathering_agent_prompt, source=&quot;user&quot;)])<br>        # Create a proper message from result<br>        response_msg = TextMessage(content=result.content, source=self.name)<br>        inner_messages.append(response_msg)<br><br>        # Return actual model output as chat_message<br>        yield response_msg  # Optionally yield it as a normal message too<br>        yield Response(chat_message=response_msg, inner_messages=inner_messages)</pre><h3>🤖 Teams in AutoGen: Coordinated Agent Collaboration</h3><ul><li><strong>RoundRobinGroupChat</strong>: A simple coordination model where agents take turns in a fixed sequence, like a roundtable discussion. This is ideal for structured conversations where each agent needs to contribute in order.</li><li>SelectorGroupChat: This preset uses an LLM-powered selector to decide which agent should speak next after each message. It’s useful for dynamic conversations where the most relevant agent is chosen based on context.</li><li>MagenticOneGroupChat: A general-purpose multi-agent system designed for solving open-ended tasks across domains like web search, file analysis, and information retrieval. It leverages AutoGen’s tooling and agent roles to handle complex, cross-domain workflows.</li><li>Swarm: A more advanced and flexible preset where agents use <strong>HandoffMessage</strong> to explicitly transfer control of the conversation to another agent. This allows for fine-grained coordination and delegation between agents.</li></ul><pre>from autogen_agentchat.teams import RoundRobinGroupChat<br><br>planning_group = RoundRobinGroupChat(<br>        participants=[<br>            team.create_backend_requirements_agent(),<br>            team.create_frontend_planner_agent(),<br>            team.create_user_proxy_agent()<br>        ],<br>        termination_condition=MaxMessageTermination(max_messages=4),<br>    )<br><br>print(&quot;\n🚀 Starting Planning Phase...\n&quot;)<br>planning_response = await Console(planning_group.run_stream(task=initial_task))</pre><h3>Upcoming Blog: Building a Mini-Manus with AutoGen</h3><p>In my next blog, I’ll walk you through building a <strong>lightweight version of Manus</strong> using <strong>AutoGen’s multi-agent framework</strong>. The idea is simple but powerful:<br> A user provides a prompt describing an application — <strong>including frontend, backend, and business logic</strong> — and a team of AI agents collaboratively gathers requirements, confirms them, and generates complete code for:</p><ul><li>✅ Backend (e.g., APIs, DB models)</li><li>🎨 Frontend (UI code)</li><li>🧪 Test cases (unit + integration)</li></ul><p>Think of it as an AI-powered product engineer — fast, structured, and test-aware.</p><p>Stay tuned to see how I design the agent team, manage the user flow, and orchestrate everything using AutoGen’s latest features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hBcSXL4iaIsYXGZ6j81cAQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15cde5ba97af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LLM-Powered Review Processing with Azure and LangGraph]]></title>
            <link>https://medium.com/@17nagh/llm-powered-review-processing-with-azure-and-langgraph-6e62ac31e70e?source=rss-df190c4c23fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e62ac31e70e</guid>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[langgraph]]></category>
            <category><![CDATA[gpt]]></category>
            <dc:creator><![CDATA[Nagh]]></dc:creator>
            <pubDate>Mon, 14 Jul 2025 18:32:19 GMT</pubDate>
            <atom:updated>2025-07-16T01:42:49.036Z</atom:updated>
            <content:encoded><![CDATA[<p>This project, which uses an Azure Function wrapped around a Langgraph application, is a great example of using AI to automate business processes. It’s designed to analyze customer reviews, providing a powerful solution for businesses that want to quickly understand and respond to customer feedback.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/0*lMlV8BIkOMVh4A66" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6zwIQmtAzyXtPEnvthaaUA.png" /></figure><h4>How It Works: The Workflow</h4><p>The core of this project is a seven-node state machine that processes each customer review. When a review is received, it goes through the following steps:</p><ol><li><strong>Validate:</strong> The system first checks for a valid user ID.</li><li><strong>Fetch:</strong> The user’s review is retrieved from a database.</li><li><strong>Prepare:</strong> The review is cleaned up and preprocessed to ensure it’s ready for analysis.</li><li><strong>Summarise:</strong> Using an LLM like GPT-4o-mini from Azure OpenAI, the review is analyzed for sentiment. The output is a JSON object that includes both a sentiment classification (positive, negative, etc.) and a brief explanation.</li><li><strong>Raise_Alert:</strong> If the sentiment is negative, the system can be configured to raise an alert, such as sending an email or logging a notification, to ensure the issue is addressed promptly.</li><li><strong>Generate_Response:</strong> Finally, the system uses an LLM to craft a personalized, user-friendly response based on the summary.</li></ol><p>This multi-step process shows how complex tasks can be broken down and automated using a structured approach like Langgraph.</p><h4>Technologies and Setup</h4><p>The project is built on the following key technologies, with a focus on ease of setup:</p><ul><li><strong>Azure Functions:</strong> The entire solution is built as a serverless application, meaning it can scale automatically and only incurs costs when it’s actively running.</li><li><strong>Langgraph:</strong> This library from LangChain is used to create the state machine that defines the project’s workflow, allowing for complex, multi-step operations.</li><li><strong>Azure OpenAI:</strong> Large Language Models from Azure OpenAI, such as GPT-4o-mini, are the power behind the review analysis and response generation.</li><li><strong>Python and </strong><strong>uv:</strong> The project is written in Python, and its dependencies are managed by pyproject.toml. The uv package manager is used for fast and efficient environment setup.</li><li><strong>.env Configuration:</strong> The project uses a .env file to handle environment variables for secure and flexible configuration, particularly for sensitive information like API keys for Azure OpenAI. This makes it easy to set up the project on different systems without hardcoding credentials.</li></ul><pre>AZURE_OPENAI_API_KEY=&lt;azure_openai_api_key&gt;<br>AZURE_OPENAI_API_TYPE=azure<br>AZURE_OPENAI_ENDPOINT= https://openai.openai.azure.com/openai/deployments/&lt;deployment_name&gt;/chat/completions?api-version=&lt;api_version&gt;<br>OPENAI_API_VERSION=&lt;api_version&gt;<br>OPENAI_DEPLOYMENT_NAME=&lt;deployment_name&gt;</pre><p>This project is a solid starting point for anyone interested in building a scalable, AI-driven solution for customer feedback analysis. You can learn more about the project, including how to set it up and run it, by visiting the <a href="https://github.com/Nagh-DE/AI_AzureFunction_Langgraph">AI_AzureFunction_Langgraph GitHub Page</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e62ac31e70e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LangGraph: Weaving Smarter AI Applications]]></title>
            <link>https://medium.com/@17nagh/langgraph-weaving-smarter-ai-applications-5ecd8892300b?source=rss-df190c4c23fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ecd8892300b</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[langgraph]]></category>
            <category><![CDATA[langchain]]></category>
            <category><![CDATA[openai]]></category>
            <dc:creator><![CDATA[Nagh]]></dc:creator>
            <pubDate>Fri, 11 Jul 2025 17:49:02 GMT</pubDate>
            <atom:updated>2025-07-11T17:50:45.203Z</atom:updated>
            <content:encoded><![CDATA[<p>· <a href="#1e3f">Introduction</a><br>· <a href="#2de2">Why Langgraph?</a><br>· <a href="#b0d2">Main blocks of Langgraph</a><br> ∘ <a href="#e1ae">1. The Brain’s Memory: State</a><br> ∘ <a href="#955e">2. The Action Heroes: Nodes</a><br> ∘ <a href="#d8ea">3. The Decision-Makers: Edges</a><br> ∘ <a href="#ee95">4. The Game Changer: Cycles (Loops)</a><br>· <a href="#3882">Debugging and Logging</a><br> ∘ <a href="#44d3">Unified Ecosystem</a><br> ∘ <a href="#6a2d">How to Enable Logging</a><br>· <a href="#83b3">Useful Links</a><br>· <a href="#b852">Coming Up:</a><br> ∘ <a href="#f572">Tech Stack</a></p><h3>Introduction</h3><p>The advent of Large Language Models (LLMs) has undeniably revolutionized how we approach countless tasks. From coding assistance and content generation to complex scheduling, applications powered by models like GPT-4, Claude, DeepSeek-R1, and Gemini 2.5 Flash are rapidly becoming indispensable tools in our daily lives.</p><p>While powerful, directly leveraging these public-facing applications with sensitive enterprise data presents significant security and privacy concerns. This critical need for secure, custom solutions has spurred the rise of <strong>Enterprise LLM Applications</strong>.</p><h3>Why Langgraph?</h3><p>Building truly intelligent and robust enterprise-grade AI goes far beyond just integrating an LLM. It requires orchestrating complex, multi-step workflows, managing dynamic state, and enabling sophisticated decision-making that can’t be handled by simple, linear chains of prompts. <strong>This is exactly where LangGraph shines</strong> — offering a powerful framework to design, manage, and execute these advanced, stateful LLM applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Nmkcu3W9O4g4YRZq.png" /></figure><h3>Main blocks of Langgraph</h3><h4>1. The Brain’s Memory: State</h4><p>The <strong>state</strong> in LangGraph is the shared memory or context that flows between nodes. Think of it as a dynamic dictionary that holds inputs, intermediate results, and outputs. Nodes read from and write to the state, making it central to coordinating agent behavior.</p><h4>2. The Action Heroes: Nodes</h4><p><strong>Nodes</strong> are the core computational units — each node performs a task. This can be calling a language model, executing a tool, querying a database, or making decisions.</p><p>Each node:</p><ul><li>Accepts part of the current state.</li><li>Processes it (e.g., by calling an LLM or API).</li><li>Returns an updated portion of the state.</li></ul><h4>3. The Decision-Makers: Edges</h4><p><strong>Edges</strong> define the <strong>flow</strong> between nodes. They decide <strong>what happens next</strong> based on the updated state. LangGraph supports <strong>conditional edges</strong>, meaning the next node can depend on a value or decision in the state.</p><p>Types of edges:</p><ul><li><strong>Static</strong>: Always go to the next fixed node.</li><li><strong>Dynamic</strong>: Use logic to determine the next node based on the state (e.g., if booking is confirmed, go to payment; else, go back to flight_search).</li></ul><h4>4. The Game Changer: Cycles (Loops)</h4><p>LangGraph allows you to <strong>loop between nodes</strong> by design — this makes it ideal for agent systems that need to <strong>reason, retry, or gather more information</strong> iteratively.</p><p>Why loops are useful:</p><ul><li>Let an agent ask clarifying questions until it has enough information.</li><li>Retry a tool or API call if the result is invalid.</li><li>Iterate between planner and executor nodes in a ReAct or CoT agent setup.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/0*KGSLNTTc5duD7Cbc.jpeg" /></figure><h3>Debugging and Logging</h3><p>One of the biggest challenges in building agentic workflows is understanding what’s going on under the hood, especially when you introduce loops, conditionals, and multi-step state transitions.</p><p>Thankfully, the LangChain–LangGraph–LangSmith ecosystem is tightly integrated to make this seamless.</p><h4>Unified Ecosystem</h4><p>LangGraph is built on top of LangChain and works natively with <strong>LangSmith</strong>, an observability and tracing platform. With just a few lines of setup, you can visualize every:</p><ul><li>Node executed</li><li>State transition</li><li>LLM/tool call</li><li>Error or retry</li></ul><h4>How to Enable Logging</h4><p>Add your LangSmith credentials to your environment:</p><pre>LANGCHAIN_TRACING_V2=&quot;true&quot;<br>LANGCHAIN_API_KEY=&quot;your-langsmith-api-key&quot;<br>LANGCHAIN_ENDPOINT=&quot;https://api.smith.langchain.com&quot;</pre><p>Once set, your LangGraph execution traces will be automatically pushed to LangSmith. You can inspect each run through a clean UI, trace issues, and optimize behavior.</p><h3>Useful Links</h3><ul><li><a href="https://python.langchain.com/docs/introduction/">Langchain</a></li><li><a href="https://langchain-ai.github.io/langgraph/concepts/why-langgraph/">Langgraph</a></li><li><a href="https://docs.smith.langchain.com/">Langsmith</a></li></ul><h3>Coming Up:</h3><p><strong>LLM-powered Azure Function</strong> using <strong>LangChain</strong> and <strong>Azure OpenAI GPT-4o</strong> that automatically:</p><ol><li><strong>Tracks user reviews</strong> from a feedback source (e.g., API, SharePoint, or DB).</li><li><strong>Analyzes sentiment</strong> using a prompt chain.</li><li><strong>Routes negative reviews</strong> to the concerned team by raising a request (email, Teams webhook, etc.).</li><li><strong>Generates a polite, empathetic response</strong> using GPT-4o and sends it back to the user via preferred channel (email, app notification, etc.).</li></ol><h4>Tech Stack</h4><ul><li><strong>Azure Function</strong> (Python)</li><li><strong>LangChain</strong> for prompt flow &amp; response orchestration</li><li><strong>Azure OpenAI GPT-4o</strong> for natural language generation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*jOz2tIqQCFfI5C9YAOQGMQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ecd8892300b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering LLM Evaluation: A Guide to Assessing LLM Applications using GISKARD]]></title>
            <link>https://medium.com/@17nagh/mastering-llm-evaluation-a-guide-to-assessing-llm-applications-using-giskard-232c813796fd?source=rss-df190c4c23fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/232c813796fd</guid>
            <category><![CDATA[red-teaming]]></category>
            <category><![CDATA[giskard]]></category>
            <category><![CDATA[evaluation]]></category>
            <category><![CDATA[azureopenai]]></category>
            <category><![CDATA[llm-evaluation]]></category>
            <dc:creator><![CDATA[Nagh]]></dc:creator>
            <pubDate>Sat, 15 Mar 2025 18:13:25 GMT</pubDate>
            <atom:updated>2025-03-15T18:13:25.684Z</atom:updated>
            <content:encoded><![CDATA[<p>· <a href="#24fe">Red Teaming</a><br>· <a href="#260f">Giskard</a><br> ∘ <a href="#7de8">Key Features of Giskard</a><br>· <a href="#66d9">Steps to Follow for LLM Evaluation</a><br>· <a href="#1b5b">Evaluation</a><br> ∘ <a href="#e063">Step 1: Define the LLM Model</a><br> ∘ <a href="#542e">Step 2: Define the Attack Type</a><br> ∘ <a href="#99f6">Step 3: Define the Giskard Model</a><br> ∘ <a href="#290b">Step 4: Generate the Giskard Dataset</a><br> ∘ <a href="#1790">Step 5: Run the Scan</a><br>· <a href="#d0a3">Resources</a></p><h3>Red Teaming</h3><p><strong>“LLM evaluation often starts by thinking like a hacker — essentially, you try to pentest an LLM-based application.</strong> This approach, known as <strong>red teaming</strong>, involves simulating adversarial scenarios to uncover vulnerabilities, biases, or weaknesses in the model. By intentionally trying to ‘break’ the system, you can identify areas for improvement and ensure the application is robust and secure in real-world use cases.”</p><p>On the other hand, <strong>Blue Teaming</strong> focuses on defense. It involves monitoring, detecting, and responding to threats or vulnerabilities identified during red teaming or other evaluations. While red teaming is about finding weaknesses, blue teaming is about fixing and protecting against them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BQep_HQzJWX-G2M8" /></figure><h3>Giskard</h3><p><strong>Giskard</strong> is an open-source Python library designed to evaluate and test machine learning models, including Large Language Models (LLMs), for vulnerabilities and risks. It provides a comprehensive framework to identify issues like <strong>hallucination</strong>, <strong>bias</strong>, <strong>harmful content generation</strong>, and <strong>prompt injection</strong> in LLM-based applications. Giskard is particularly useful for developers and data scientists who want to ensure their models are robust, ethical, and safe for deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eVhy20optDRMl8MN.png" /></figure><h4>Key Features of Giskard</h4><ol><li>Vulnerability Scanning:</li><li>Customizable Evaluation:</li><li>Integration with LLM Frameworks:</li><li>Automated Reporting:</li><li>Open-Source and Extensible:</li></ol><h3>Steps to Follow for LLM Evaluation</h3><ol><li><strong>Define the Vulnerabilities</strong>: Identify the specific vulnerabilities you want to evaluate, such as hallucination, bias, or harmful content generation.</li><li><strong>Choose the Tool</strong>: Select the tool you’ll use for evaluation — in this case, <strong>Giskard</strong>.</li><li><strong>Ensure Your LLM Application is Running</strong>: Make sure your LLM application is live and capable of generating responses to user queries.</li><li><strong>Run the Scan</strong>: Execute the scan using Giskard to identify and analyze vulnerabilities in your application.</li></ol><h3>Evaluation</h3><p>Let’s say your LLM application is hosted on an Azure Function App (https://dummy-function.azurewebsites.net/api/), and you want to test it for vulnerabilities like <strong>hallucination</strong>, <strong>bias</strong>, or <strong>harmful content generation</strong>. During my research, I explored tools like <strong>PyRIT</strong> and <strong>Giskard</strong>, and found Giskard to be particularly effective for this purpose. Here’s how I used Giskard to evaluate my LLM application</p><h4>Step 1: Define the LLM Model</h4><p>Start by defining the LLM model you’re evaluating. In my case, I used the <strong>Azure OpenAI GPT-4 model</strong>. This is the model that will be tested for vulnerabilities.</p><h4>Step 2: Define the Attack Type</h4><p>Next, specify the type of vulnerability you want to test. Giskard supports various attack types, such as <strong>jailbreak</strong>, <strong>hallucination</strong>, or <strong>bias</strong>. Choose the one that aligns with your evaluation goals. You can find the full list of supported attack types in the <a href="https://docs.giskard.ai/">Giskard documentation</a>.</p><h4>Step 3: Define the Giskard Model</h4><p>Create a Giskard model using the giskard.Model function. This step involves configuring the model for text generation and providing details like the model name, description, and input features. Here’s an example:</p><pre>giskard.Model(<br>    model=&lt;your_model_function&gt;,<br>    model_type=&quot;text_generation&quot;,<br>    name=&quot;Name of Your Model&quot;,<br>    description=&quot;Description of Your Application&quot;,<br>    feature_names=[&quot;question&quot;],  # Default: all dataset columns except the target<br>)</pre><h4>Step 4: Generate the Giskard Dataset</h4><p>Prepare a dataset containing user questions or prompts that will be used to test the model. For example:</p><pre>user_questions = [&quot;list of user questions&quot;]<br>giskard_dataset = giskard.Dataset(<br>    pd.DataFrame({&quot;question&quot;: user_questions}), <br>    target=None<br>)</pre><h4>Step 5: Run the Scan</h4><p>Once the model and dataset are ready, run the scan using the giskard.scan function. Specify the attack type to focus the evaluation on specific vulnerabilities:</p><pre>report = giskard.scan(giskard_model, giskard_dataset, only=&lt;attack_type&gt;)</pre><h3>Resources:</h3><ul><li>Deep Learning Course: <a href="https://learn.deeplearning.ai/courses/red-teaming-llm-applications/">https://learn.deeplearning.ai/courses/red-teaming-llm-applications/</a></li><li>Giskard: <a href="https://docs.giskard.ai/en/stable/knowledge/llm_vulnerabilities/index.html">https://docs.giskard.ai/en/stable/knowledge/llm_vulnerabilities/index.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=232c813796fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Graph Database — GenAI]]></title>
            <link>https://medium.com/@17nagh/graph-database-genai-980c71ff3384?source=rss-df190c4c23fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/980c71ff3384</guid>
            <category><![CDATA[graphrag]]></category>
            <category><![CDATA[neo4j]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[retrieval-augmented]]></category>
            <dc:creator><![CDATA[Nagh]]></dc:creator>
            <pubDate>Sun, 01 Sep 2024 15:14:22 GMT</pubDate>
            <atom:updated>2024-09-01T15:14:22.880Z</atom:updated>
            <content:encoded><![CDATA[<h3>Graph Database — GenAI</h3><p>Let’s understand what Graph DB is in the field of Generative AI.</p><h3>Topics Covered:</h3><p>· <a href="#2651">What is Graph DB?</a><br>· <a href="#622b">How is it different from Vector Databases?</a><br> ∘ <a href="#6bef">Relationship Mapping</a><br> ∘ <a href="#2c22">Flexibility</a><br> ∘ <a href="#6bba">Performance</a><br>· <a href="#64a1">What are Nodes, Edges, and Labels?</a><br> ∘ <a href="#82d5">Nodes</a><br> ∘ <a href="#1aa9">Edges</a><br> ∘ <a href="#a5a6">Labels</a><br>· <a href="#aab4">What is Neo4j?</a><br>· <a href="#ab69">What is Cypher Query Language?</a><br> ∘ <a href="#1e6f">To create a node:</a><br> ∘ <a href="#a053">To create an edge/ relation between nodes:</a><br>· <a href="#4d9e">Challenges of GraphDB?</a><br> ∘ <a href="#c771">Cost</a><br> ∘ <a href="#5b57">Performance Concerns</a><br> ∘ <a href="#a677">Data Migration and Integration</a><br> ∘ <a href="#3697">Scalability Issues</a><br>· <a href="#e65d">Next Steps</a></p><h3><em>What is Graph DB?</em></h3><p>Graph databases excel at managing and representing intricate relationships within data. Unlike traditional relational databases that structure data into tables, graph databases utilize <em>nodes, edges, </em>and <em>properties</em> to form flexible and dynamic data models. This architecture is especially beneficial for GenAI applications, where the connections between data points are just as crucial as the data points themselves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*oErF2rqjG7Kg2PVm.png" /></figure><h3><em>How is it different from Vector Databases?</em></h3><p>When comparing graph databases to traditional vector databases, several advantages become apparent. For example, in the case of the context of retrieval-augmented generation (RAG) systems:</p><h4>Relationship Mapping</h4><p>Graph databases excel at managing and querying relationships, significantly improving the accuracy and relevance of generated content in RAG systems. They allow for intuitive and direct queries about how different entities are related. This capability leads to more nuanced and accurate recommendations in applications like recommendation systems.</p><h4>Flexibility</h4><p>Graph databases can easily adapt to changes in data structures, making them ideal for rapidly evolving GenAI applications. They seamlessly incorporate new data and relationships, allowing developers to modify and expand data models without significant downtime. This adaptability is crucial in dynamic environments like social media analysis or fraud detection.</p><h4>Performance</h4><p>Graph databases often outperform vector databases for queries involving complex relationships. They handle multi-hop queries and deep link analysis more efficiently, making them suitable for applications requiring complex relationship analysis. Additionally, they manage large volumes of connected data more efficiently, reducing processing and analysis time.</p><p>Overall, graph databases’ strengths in managing relationships, flexibility in adapting to new data structures, and superior performance in handling complex queries make them a powerful alternative to traditional vector databases in RAG systems and beyond.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b31hiO4ynbDLRrXWEFF4aQ.png" /></figure><h3><em>What are Nodes, Edges, and Labels?</em></h3><p>In the context of graph databases and generative AI, understanding nodes, edges, and labels is crucial for effectively modeling and querying data. Here’s a breakdown:</p><h4>Nodes</h4><ul><li><strong>Definition</strong>: Nodes are the fundamental units in a graph database, representing entities or objects.</li><li><strong>Example in Generative AI</strong>: In a generative AI system, nodes could represent different data points such as words, phrases, or concepts. For instance, in a language model, each node might represent a unique word or phrase.</li></ul><h4>Edges</h4><ul><li><strong>Definition</strong>: Edges are the connections between nodes, representing relationships or interactions.</li><li><strong>Example in Generative AI</strong>: Edges could represent the relationships between words or concepts. For example, in a knowledge graph used by a generative AI model, an edge might indicate that one concept is related to another, such as “cat” is a type of “animal.”</li></ul><h4>Labels</h4><ul><li><strong>Definition</strong>: Labels are used to categorize nodes and edges, providing additional context and meaning.</li><li><strong>Example in Generative AI</strong>: Labels can help classify nodes and edges to enhance the AI’s understanding. For instance, nodes could be labeled as “noun,” “verb,” or “adjective,” while edges could be labeled as “synonym,” “antonym,” or “related to.”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*aPhGkrERNZDNBCif.png" /></figure><h3><em>What is Neo4j?</em></h3><p><a href="https://neo4j.com/">Neo4j </a>is a graph database management system (GDBMS) that stores data in the form of graphs. Unlike traditional relational databases that store data in tables, Neo4j stores data in a graph structure, where nodes represent entities and relationships between nodes are represented as edges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/0*J7edDpBpjrB34hIT.png" /></figure><h3><em>What is Cypher Query Language?</em></h3><p>Cypher is a declarative graph query language that’s used to create, read, update, or delete (CRUD) data in property graphs.</p><p>You can get more details <a href="https://neo4j.com/docs/">here</a></p><h4>To create a <em>node</em>:</h4><pre>CREATE (n:Label {property1: &#39;value1&#39;, property2: &#39;value2&#39;})</pre><h4>To create an <em>edge</em>/ <em>relation </em>between nodes:</h4><pre>MATCH (a:Label1)-[r:RELATIONSHIP_TYPE]-&gt;(b:Label2)</pre><h3><em>Challenges of GraphDB?</em></h3><h4>Cost</h4><p>The initial setup cost for a graph database can be higher due to the need for specialized software, hardware, and training. Ongoing maintenance and support also incur higher operational costs, requiring skilled staff for effective management and optimization.</p><h4>Performance Concerns</h4><p>Graph databases excel at complex relationship queries but may underperform in simple transactional operations compared to relational databases. This necessitates careful consideration of use cases to determine the suitability of a graph database.</p><h4>Data Migration and Integration</h4><p>Migrating data from relational to graph databases is challenging, involving data model transformation and potential application rewrites. Ensuring data consistency and integrating with existing systems require thorough understanding and custom development efforts.</p><h4>Scalability Issues</h4><p>Graph databases can face challenges when scaling horizontally, as managing distributed nodes efficiently is complex. Organizations may need specialized solutions or architectures to achieve desired scalability and performance.</p><h3>Next Steps</h3><p>I’m going to extend this about RAG (longly called <strong>R</strong>etrieval <strong>A</strong>ugmented <strong>G</strong>eneration) using a Graph Database, called <strong>GraphRAG</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=980c71ff3384" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi Travel Plan Crew Agents]]></title>
            <link>https://medium.com/@17nagh/multi-travel-plan-crew-agents-63dca5fba234?source=rss-df190c4c23fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/63dca5fba234</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Nagh]]></dc:creator>
            <pubDate>Thu, 18 Jul 2024 11:23:48 GMT</pubDate>
            <atom:updated>2024-07-18T11:23:48.256Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s discuss about, how we can develop agents framework which solves multiple tasks using crew framework</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wjU6hrUif8Fy-kQg" /></figure><h3>Crew Framework:</h3><p><strong><em>CrewAI: Collaborative Intelligence with Autonomous AI Agents</em></strong></p><p><em>CrewAI</em> is a framework that orchestrates multiple autonomous AI agents to work together seamlessly. Imagine a crew of specialized agents — each with its own skills and tasks — collaborating like a well-coordinated team. Here are the key components of CrewAI:</p><ol><li><strong>Agents</strong>: Think of agents as team members, each with specific skills and roles. They can be researchers, writers, customer support, or any other specialized function. Together, they contribute to achieving the crew’s overall goals.</li><li><strong>Tasks</strong>: In CrewAI, tasks are individual assignments that agents complete. These tasks encapsulate necessary information for execution, including descriptions, assigned agents, and required tools. Flexibility exists for handling various levels of action complexity.</li><li><strong>Tools</strong>: Tools in CrewAI represent skills or functions that agents use to perform actions. These tools range from simple searches to complex interactions. CrewAI integrates tools from its own toolkit as well as LangChain Tools, allowing effective teamwork among agents.</li><li><strong>Process</strong>: Processes in CrewAI orchestrate task execution by agents. Think of them as project management for AI teams. They ensure efficient distribution and execution of tasks according to predefined strategies.</li><li><strong>Crew</strong>: A crew is a collaborative group of agents working together. Each crew defines the strategy for task execution, agent collaboration, and the overall workflow. It’s like having your own AI dream team!</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HVQnWHtN_skh6frd.png" /></figure><p>You can find the documentation and also best part is you can chat with documentation here <a href="https://www.crewai.com/">crew.ai</a></p><h3>Basic Syntax of each component:</h3><p>Agents:</p><pre>Agent(<br>    role=&#39;&#39;,       # high-level idea of the agent<br>    goal=&#39;&#39;,       # what is the job you want to achieve using this agent<br>    backstory=&quot;&quot;,  # prompt of what the agent is capable of<br>    verbose=,<br>    allow_delegation=,<br>    tools=[]<br>    )</pre><p>Tasks:</p><pre>Task(description=&quot;&quot;,     # details of the task<br>      agent=agent,<br>      llm=llm,           # client of your llm<br>      expected_output=&#39;&#39; <br>      )</pre><p>Crew:</p><pre>Crew(agents=[], # list of all agents<br>     tasks = [] # list of all tasks<br>     )</pre><h3>Problem Statement</h3><p>In the fast-paced world of travel management, ensuring seamless coordination and efficient handling of tasks like room bookings, vehicle rentals, and flight/ trains arrangements is crucial. Traditionally, these tasks require significant manual effort, often leading to delays and errors. With the rise of autonomous technology, there’s a pressing need for solutions that can streamline these processes, providing accurate and timely information without human intervention.</p><h3><strong>Solution</strong></h3><p>I’ve developed autonomous agents using the Crew AI framework to tackle these challenges head-on. These agents are designed to handle multiple aspects of travel management, including:</p><ul><li><strong>Room Booking Availability</strong>: The agents check and compile lists of available rooms, ensuring travelers have up-to-date information.</li><li><strong>Self-Driving Car/Bike Rentals</strong>: They provide details on available self-driving cars or bikes, making it easier for travelers to find suitable rental options.</li><li><strong>Flight Details</strong>: The agents gather and present flight information, helping users to make informed travel decisions.</li></ul><p>Checkout the source code here: <a href="https://github.com/Nagh-DE/CrewAI-TravelManagement">github</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63dca5fba234" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamline Your Workflow: Effortlessly Create PDFs from Web Data Using AI]]></title>
            <link>https://medium.com/@17nagh/streamline-your-workflow-effortlessly-create-pdfs-from-web-data-using-ai-1268d36ceb99?source=rss-df190c4c23fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/1268d36ceb99</guid>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[azureopenai]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[pdf]]></category>
            <category><![CDATA[llamaindex]]></category>
            <dc:creator><![CDATA[Nagh]]></dc:creator>
            <pubDate>Mon, 01 Jul 2024 07:39:03 GMT</pubDate>
            <atom:updated>2024-07-01T07:39:03.372Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog dives into building a powerful web data extraction and PDF generation tool using <strong>ReAct </strong>Agents, <strong>LlamaIndex </strong>Framework, and <strong>Azure OpenAI</strong>. We’ll explore how to leverage AI to scrape targeted data from websites and seamlessly convert it into a structured PDF report, automating a tedious manual process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9FFRx15t1azGvKlB.jpg" /></figure><h3>ReAct Agents:</h3><p>ReAct Agents are a framework for building intelligent agents that combine the power of Large Language Models (LLMs) like Azure OpenAI with external tools. This allows them to go beyond just generating text and actually perform actions.</p><p>Here’s how reAct Agents work:</p><ol><li><strong>Reasoning and Planning:</strong> The reAct Agent uses the LLM to analyze the task and generate a reasoning trace, essentially a plan of action.</li><li><strong>Taking Action:</strong> It then leverages tools like LlamaIndex to interact with external sources like websites and extract data.</li><li><strong>Adapting to Changes:</strong> The agent can even handle unexpected situations by updating its plan based on the information it gathers.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/0*0tF9D2hGq6LMNpat.png" /><figcaption>ReAct Agent</figcaption></figure><h3>Llama Index Framework:</h3><p>LlamaIndex is a data framework designed to streamline the process of connecting Large Language Models (LLMs) with your own custom data sources. Here’s a breakdown of its key functionalities:</p><ol><li><strong>Data Ingestion:</strong> It provides a variety of connectors that allow you to ingest data from various sources like databases (SQL), APIs, documents (PDFs), and more.</li><li><strong>Data Indexing:</strong> LlamaIndex structures your data into formats optimized for LLMs. This indexing process makes the data more efficient and easier for the LLM to understand and utilize.</li><li><strong>Querying:</strong> The framework provides tools for crafting queries that interact with your indexed data and the LLM. You can design queries to retrieve specific information, generate different creative text formats based on the data, or even build interactive applications powered by LLMs.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*AH9vdGt5vUZ7U-Gv.png" /></figure><p>The beauty of <a href="https://www.llamaindex.ai/">LlamaIndex</a> lies in its conversational approach. You can directly interact with the framework’s own documents — almost like having a chat with them. This allows you to ask specific questions about features, troubleshoot issues, or even discover hidden functionalities.</p><h3>Creating PDFs from Web Page:</h3><p>Here’s how our workflow tackles this challenge:</p><ol><li><strong>Setting the Ground Rules:</strong> We start with a pdf document containing Google’s content guidelines (stored in a folder named “data”). This document serves as a guide for Azure OpenAI, ensuring it adheres to ethical and responsible AI practices whenever interacting with web content. You can get this document from <a href="https://developers.google.com/search/docs/fundamentals/creating-helpful-content">here</a>. Custom tool called <strong>“guidelines”</strong> helps in creating embeddings and retrieving for Azure OpenAI.</li><li><strong>Extracting the Data:</strong> Our custom-built React Agent takes center stage. It interacts with LlamaIndex, a framework that acts as a bridge between our data and Azure OpenAI. The React Agent utilizes a tool called <strong>“webreader”</strong> to scrape the target website based on the provided URL. This extracted data is then fed into LlamaIndex.</li><li><strong>Shaping the Report:</strong> LlamaIndex plays a crucial role in structuring the extracted data in a way that’s easily understood by Azure OpenAI. Remember, the content guidelines we included earlier come into play here, ensuring responsible AI practices throughout the process.</li><li><strong>Crafting the PDF:</strong> Once Azure OpenAI has processed the data, it’s handed over to the <strong>“report generator”</strong> tool. This tool takes the AI-processed information and transforms it into a clean and well-organized PDF report.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I3GyAmYmrxRa6RBR.jpg" /></figure><p>As an example, I’ve used one of my favourite Azure Service documentation — <a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview?pivots=programming-language-python">Azure Function App</a>, checkout the source code and output PDF file <a href="https://github.com/Nagh-DE/Web2PDF-AzOpenAI">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1268d36ceb99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GPT- 4o — DBM Management with Audio]]></title>
            <link>https://medium.com/@17nagh/gpt-4o-audio-sql-c2427c1f0394?source=rss-df190c4c23fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2427c1f0394</guid>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[dbms]]></category>
            <category><![CDATA[gpt-4o]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[genai]]></category>
            <dc:creator><![CDATA[Nagh]]></dc:creator>
            <pubDate>Sat, 25 May 2024 12:27:32 GMT</pubDate>
            <atom:updated>2024-05-25T12:31:19.105Z</atom:updated>
            <content:encoded><![CDATA[<p>Database management using GPT-4o with audio commands</p><p><strong>Introduction:</strong></p><p>Welcome to the cutting-edge intersection of voice technology and database management. In this blog, we delve into the revolutionary capabilities of GPT-4o, the latest iteration of generative pre-trained transformers that has taken the tech world by storm. With its unparalleled language understanding and generation abilities, GPT-4o is not just a leap but a quantum jump in natural language processing. Here, we explore how this powerful tool is transforming audio inputs into structured SQL queries, streamlining data retrieval.</p><p><strong>Azure GPT-4 Omni Model:</strong></p><p>Microsoft’s Exciting Announcement: Microsoft has just unveiled GPT-4o, the latest and most advanced model from OpenAI. It’s a multimodal AI that can understand and generate content based on text, images, and soon, audio.</p><p>Azure AI Integration: This innovative model is now accessible in preview through Azure AI, offering a new realm of AI experiences.</p><p>Future Prospects: While the preview primarily showcases text and vision capabilities, it hints at upcoming features that will include audio processing, further expanding the model’s versatility.</p><p>Reference: <a href="https://azure.microsoft.com/en-in/updates/new-openai-model-on-azure/">azure.microsoft.com</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9yjRFoVEzueFrAk5" /></figure><p><strong>Usecase:</strong></p><p>In the rapidly evolving world of technology, voice recognition has become a pivotal tool for various applications. One such innovative application is the use of voice commands to handle database operations. This approach involves the conversion of spoken language into text, which is then interpreted by advanced AI models, such as GPT-4o, to generate SQL queries. This method offers a hands-free, efficient, and user-friendly way to interact with databases, making it particularly beneficial for individuals with disabilities or those who need to multitask. By leveraging the capabilities of GPT-4o, the system can understand complex commands and translate them into accurate SQL queries, streamlining database management tasks. This use case not only enhances accessibility but also demonstrates the potential of voice-controlled systems in simplifying data-related workflows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ee2GAladyq-HdJ4RRLfdlg.png" /></figure><p>Source Code :</p><p><a href="https://github.com/Nagh-DE/GPT-4o_Audio_Text">GITHUB</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2427c1f0394" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[1-bit LLMs: A Paradigm Shift in Digital Modeling]]></title>
            <link>https://medium.com/@17nagh/1-bit-llms-a-paradigm-shift-in-digital-modeling-6fd4946ec2ad?source=rss-df190c4c23fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fd4946ec2ad</guid>
            <category><![CDATA[hugging-face]]></category>
            <category><![CDATA[era-of-ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[1-bit-llms]]></category>
            <category><![CDATA[openai]]></category>
            <dc:creator><![CDATA[Nagh]]></dc:creator>
            <pubDate>Sun, 03 Mar 2024 18:04:56 GMT</pubDate>
            <atom:updated>2024-03-03T18:04:56.624Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GqatWyKt2m6eRmC7.png" /></figure><p>The development of Large Language Models (LLMs) has been a major trend in AI research in recent years. These models have shown impressive results in various natural language processing tasks, but they also have drawbacks. One of the main challenges is their large size, which makes them difficult to deploy and costly to run due to high energy consumption.</p><p>After covid the term variant has been in news from so long, now there’s a new variant in world of LLMs, i.e. 1-bit LLM variant which is <strong>BitNet b1.58</strong></p><h3>Approach:</h3><ul><li>A possible way to overcome these difficulties is to apply quantization after training to produce models with reduced bit precision.</li><li>Weight or parameter is ternary, which is either {-1,0,-1}</li></ul><h3>Advantages:</h3><p>While being significantly more cost-effective in terms of <em>latency, memory, throughput, and energy consumption.</em></p><p>example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*atnksAtf6446oSgEvMpPbQ.png" /></figure><p><strong>Quantization Function</strong> —<strong> <em>absmean quantization</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*DhChrXNks77nRxYV8Mj2zw.png" /></figure><h3>Comparision of LLaMa and BitNet</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*rXM-xzHexbIu2KEpGOGRAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*yUmivXqMvihTcOKLJrfStw.png" /></figure><h3>Discussion &amp; Future Work:</h3><p>1. 1-bit Mixture-of-Experts (MoE) LLMs</p><p>2. Native Support for Long Sequences in LLMs</p><p>3. LLMs on Edge and Mobile Devices</p><h3>Research Paper Link:</h3><p><a href="https://huggingface.co/papers/2402.17764">https://huggingface.co/papers/2402.17764</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fd4946ec2ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>