<?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"><channel><title><![CDATA[Building an Agentic AI Insurance Operations Assistant with LangChain, MCP, Ollama, RAG, and FastAPI]]></title><description><![CDATA[Building an Agentic AI Insurance Operations Assistant with LangChain, MCP, Ollama, RAG, and FastAPI]]></description><link>https://agenticaiinsuranceoperationsassistan.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>Building an Agentic AI Insurance Operations Assistant with LangChain, MCP, Ollama, RAG, and FastAPI</title><link>https://agenticaiinsuranceoperationsassistan.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 14:58:20 GMT</lastBuildDate><atom:link href="https://agenticaiinsuranceoperationsassistan.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Building an Agentic AI Insurance Operations Assistant with LangChain, MCP, Ollama, RAG, and FastAPI]]></title><description><![CDATA[Introduction
AI applications are moving beyond simple question-and-answer chatbots.
Modern AI systems can use tools, access external data, retrieve information from knowledge bases, and perform specif]]></description><link>https://agenticaiinsuranceoperationsassistan.hashnode.dev/building-an-agentic-ai-insurance-operations-assistant-with-langchain-mcp-ollama-rag-and-fastapi</link><guid isPermaLink="true">https://agenticaiinsuranceoperationsassistan.hashnode.dev/building-an-agentic-ai-insurance-operations-assistant-with-langchain-mcp-ollama-rag-and-fastapi</guid><dc:creator><![CDATA[Shiva priya PSP]]></dc:creator><pubDate>Sun, 27 Sep 2026 22:37:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ab997ddd566a88884cc2b7e/2caf4197-ba0c-459a-8436-cfecee4f67b9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction</h2>
<p>AI applications are moving beyond simple question-and-answer chatbots.</p>
<p>Modern AI systems can use tools, access external data, retrieve information from knowledge bases, and perform specific tasks based on a user's request.</p>
<p>As part of my hands-on AI learning journey, I built an <strong>Agentic Insurance Operations Assistant</strong> that demonstrates this approach in a real-world insurance use case.</p>
<p>The application allows users to ask questions about insurance claims, high-priority claims, insurance policies, and claim analytics.</p>
<p>Instead of hardcoding responses, the AI agent determines which tool should be used and retrieves the required information from the appropriate data source.</p>
<hr />
<h2>What Problem Does It Solve?</h2>
<p>Insurance operations involve working with different types of information:</p>
<ul>
<li><p>Claim details</p>
</li>
<li><p>Claim status</p>
</li>
<li><p>Claim priority</p>
</li>
<li><p>Insurance policies</p>
</li>
<li><p>Claim processing rules</p>
</li>
<li><p>Operational statistics</p>
</li>
</ul>
<p>A traditional application might require users to navigate multiple screens or APIs to retrieve this information.</p>
<p>The goal of this project was to create a single AI-powered interface where an insurance operations user can simply ask a question.</p>
<p>For example:</p>
<blockquote>
<p>"What is the status of claim 1001?"</p>
</blockquote>
<p>or:</p>
<blockquote>
<p>"Show me all high-priority claims."</p>
</blockquote>
<p>or:</p>
<blockquote>
<p>"What happens when a claim is rejected?"</p>
</blockquote>
<p>The system determines how to handle the request and retrieves the relevant information.</p>
<hr />
<h2>Project Architecture</h2>
<p>The overall architecture is:</p>
<pre><code class="language-text">                    User
                      |
                      v
              React Frontend
                      |
                      | HTTP
                      v
              FastAPI Backend
                      |
                      v
                LangChain Agent
                 /           \
                /             \
               v               v
        Ollama / Llama 3.2    MCP Server
                               |
                 +-------------+-------------+
                 |             |             |
                 v             v             v
          Claim Lookup    High Priority   Analytics
                 |
                 v
             PostgreSQL

                       MCP
                        |
                        v
                 Policy Search
                        |
                        v
                  RAG + FAISS
</code></pre>
<p>The system is containerized using Docker, while Ollama provides local LLM inference.</p>
<h1>Building an Agentic AI Insurance Operations Assistant with LangChain, MCP, Ollama, RAG, and FastAPI</h1>
<h2>Introduction</h2>
<p>AI applications are moving beyond simple question-and-answer chatbots.</p>
<p>Modern AI systems can use tools, access external data, retrieve information from knowledge bases, and perform specific tasks based on a user's request.</p>
<p>As part of my hands-on AI learning journey, I built an <strong>Agentic Insurance Operations Assistant</strong> that demonstrates this approach in a real-world insurance use case.</p>
<p>The application allows users to ask questions about insurance claims, high-priority claims, insurance policies, and claim analytics.</p>
<p>Instead of hardcoding responses, the AI agent determines which tool should be used and retrieves the required information from the appropriate data source.</p>
<hr />
<h2>What Problem Does It Solve?</h2>
<p>Insurance operations involve working with different types of information:</p>
<ul>
<li><p>Claim details</p>
</li>
<li><p>Claim status</p>
</li>
<li><p>Claim priority</p>
</li>
<li><p>Insurance policies</p>
</li>
<li><p>Claim processing rules</p>
</li>
<li><p>Operational statistics</p>
</li>
</ul>
<p>A traditional application might require users to navigate multiple screens or APIs to retrieve this information.</p>
<p>The goal of this project was to create a single AI-powered interface where an insurance operations user can simply ask a question.</p>
<p>For example:</p>
<blockquote>
<p>"What is the status of claim 1001?"</p>
</blockquote>
<p>or:</p>
<blockquote>
<p>"Show me all high-priority claims."</p>
</blockquote>
<p>or:</p>
<blockquote>
<p>"What happens when a claim is rejected?"</p>
</blockquote>
<p>The system determines how to handle the request and retrieves the relevant information.</p>
<hr />
<h2>Project Architecture</h2>
<p>The overall architecture is:</p>
<pre><code class="language-text">                    User
                      |
                      v
              React Frontend
                      |
                      | HTTP
                      v
              FastAPI Backend
                      |
                      v
                LangChain Agent
                 /           \
                /             \
               v               v
        Ollama / Llama 3.2    MCP Server
                               |
                 +-------------+-------------+
                 |             |             |
                 v             v             v
          Claim Lookup    High Priority   Analytics
                 |
                 v
             PostgreSQL

                       MCP
                        |
                        v
                 Policy Search
                        |
                        v
                  RAG + FAISS
</code></pre>
<p>The system is containerized using Docker, while Ollama provides local LLM inference.</p>
<hr />
<h2>Technology Stack</h2>
<h3>Backend</h3>
<ul>
<li><p>Python</p>
</li>
<li><p>FastAPI</p>
</li>
<li><p>SQLAlchemy</p>
</li>
<li><p>PostgreSQL</p>
</li>
</ul>
<h3>AI</h3>
<ul>
<li><p>LangChain</p>
</li>
<li><p>Ollama</p>
</li>
<li><p>Llama 3.2</p>
</li>
<li><p>Agent-based tool calling</p>
</li>
</ul>
<h3>Agent Tool Layer</h3>
<ul>
<li><p>Model Context Protocol (MCP)</p>
</li>
<li><p>Four MCP tools</p>
</li>
</ul>
<h3>RAG</h3>
<ul>
<li><p>Sentence Transformers</p>
</li>
<li><p>FAISS</p>
</li>
<li><p>Insurance policy documents</p>
</li>
</ul>
<h3>Frontend</h3>
<ul>
<li><p>React</p>
</li>
<li><p>Vite</p>
</li>
</ul>
<h3>Infrastructure</h3>
<ul>
<li><p>Docker</p>
</li>
<li><p>Docker Desktop</p>
</li>
</ul>
<hr />
<h2>How the AI Agent Works</h2>
<p>The most important part of this project is the AI agent.</p>
<p>The user does not need to tell the application which tool to use.</p>
<p>Instead, the agent receives the question and determines which available tool is relevant.</p>
<p>For example:</p>
<h3>Question 1</h3>
<blockquote>
<p>"What is the status of claim 1001?"</p>
</blockquote>
<p>The agent identifies this as a claim lookup request and uses the claim lookup tool.</p>
<p>The tool retrieves the claim from PostgreSQL and returns information such as:</p>
<pre><code class="language-text">Claim ID: 1001
Claim Type: Auto Accident
Status: PENDING
Priority: HIGH
Estimated Damage: $45,000
</code></pre>
<p>The agent then converts the tool result into a natural-language response.</p>
<hr />
<h2>MCP Tool Architecture</h2>
<p>This project uses <strong>Model Context Protocol (MCP)</strong> to provide the agent with structured tools.</p>
<p>I implemented four tools.</p>
<h3>1. Claim Lookup</h3>
<p>This tool retrieves information about a specific claim.</p>
<p>Example:</p>
<blockquote>
<p>"What is the status of claim 1001?"</p>
</blockquote>
<p>The tool queries the PostgreSQL claims database.</p>
<hr />
<h3>2. High-Priority Claims</h3>
<p>This tool retrieves claims marked as high priority.</p>
<p>Example:</p>
<blockquote>
<p>"Show me all high-priority claims."</p>
</blockquote>
<p>The system returned claims such as:</p>
<pre><code class="language-text">Claim 1001
Type: Auto Accident
Status: PENDING
Priority: HIGH
Estimated Damage: $45,000

Claim 1003
Type: Theft
Status: PENDING
Priority: HIGH
Estimated Damage: $32,000
</code></pre>
<hr />
<h3>3. Insurance Policy Search</h3>
<p>The third tool handles insurance policy questions.</p>
<p>For example:</p>
<blockquote>
<p>"What happens when a claim is rejected?"</p>
</blockquote>
<p>Instead of asking the LLM to generate an answer from memory, the agent uses the policy-search tool.</p>
<p>The relevant policy information is retrieved through the project's RAG pipeline and provided to the agent.</p>
<p>This helps keep policy-related responses grounded in the available policy information.</p>
<hr />
<h3>4. Claim Analytics</h3>
<p>The fourth tool provides claim-related analytics.</p>
<p>For example:</p>
<blockquote>
<p>"Give me claim statistics and analytics."</p>
</blockquote>
<p>The agent uses the analytics tool to retrieve the available statistics rather than generating numbers itself.</p>
<hr />
<h1>Retrieval-Augmented Generation (RAG)</h1>
<p>The project also includes a policy knowledge component using Retrieval-Augmented Generation.</p>
<p>The basic workflow is:</p>
<pre><code class="language-text">Insurance Policy Documents
          |
          v
       Chunking
          |
          v
     Embeddings
          |
          v
     FAISS Vector Store
          |
          v
       User Query
          |
          v
   Similarity Search
          |
          v
 Relevant Policy Context
          |
          v
       AI Agent
          |
          v
       Response
</code></pre>
<p>This allows the system to search the insurance policy knowledge base when a user asks a policy-related question.</p>
<p>The purpose is to reduce the need for the language model to rely only on its pretrained knowledge.</p>
<hr />
<h1>PostgreSQL Claim Database</h1>
<p>Claim information is stored in PostgreSQL.</p>
<p>The project currently contains sample claims that include information such as:</p>
<ul>
<li><p>Claim ID</p>
</li>
<li><p>Claim type</p>
</li>
<li><p>Status</p>
</li>
<li><p>Priority</p>
</li>
<li><p>Estimated damage</p>
</li>
</ul>
<p>For example:</p>
<pre><code class="language-text">Claim ID: 1001
Claim Type: Auto Accident
Status: PENDING
Priority: HIGH
Estimated Damage: $45,000
</code></pre>
<p>The MCP claim tools interact with this database to retrieve the required information.</p>
<hr />
<h1>React Frontend</h1>
<p>I built a React frontend to provide a simple interface for interacting with the AI agent.</p>
<p>The interface allows users to:</p>
<ul>
<li><p>Enter natural-language questions</p>
</li>
<li><p>Submit questions to the AI agent</p>
</li>
<li><p>View the generated response</p>
</li>
<li><p>Use predefined example questions</p>
</li>
</ul>
<p>Example quick actions include:</p>
<ul>
<li><p>Claim 1001 Status</p>
</li>
<li><p>High-Priority Claims</p>
</li>
<li><p>Rejected Claims Policy</p>
</li>
<li><p>Claim Analytics</p>
</li>
</ul>
<p>The frontend communicates with the FastAPI backend through HTTP requests.</p>
<hr />
<h1>FastAPI Backend</h1>
<p>FastAPI acts as the backend API layer.</p>
<p>The main AI endpoint is:</p>
<pre><code class="language-text">POST /agent
</code></pre>
<p>The frontend sends a question to this endpoint.</p>
<p>The backend passes the question to the AI agent, which determines whether one of the available MCP tools should be used.</p>
<p>The resulting answer is then returned to the React application.</p>
<hr />
<h1>Ollama and Local LLM Inference</h1>
<p>One of the interesting decisions in this project was using <strong>Ollama with Llama 3.2</strong> for local LLM inference.</p>
<p>Instead of depending on a hosted LLM API for the agent workflow, the project uses a locally running model.</p>
<p>This provided hands-on experience with:</p>
<ul>
<li><p>Local LLM inference</p>
</li>
<li><p>Agent tool calling</p>
</li>
<li><p>Connecting a containerized application to a host-based LLM</p>
</li>
<li><p>Building an AI application without requiring every inference request to go through a cloud API</p>
</li>
</ul>
<hr />
<h1>Docker Containerization</h1>
<p>The FastAPI application was containerized using Docker.</p>
<p>The Dockerized architecture communicates with:</p>
<ul>
<li><p>PostgreSQL</p>
</li>
<li><p>Ollama running locally</p>
</li>
<li><p>MCP tools</p>
</li>
<li><p>React frontend</p>
</li>
</ul>
<p>One challenge was networking between the Docker container and services running on the host machine.</p>
<p>The application was configured to use:</p>
<pre><code class="language-text">host.docker.internal
</code></pre>
<p>for communication with host-based services.</p>
<p>This was an important practical lesson because networking behavior inside a Docker container is different from running the application directly on Windows.</p>
<hr />
<h1>Testing the Application</h1>
<p>I tested the application using four main scenarios.</p>
<h3>Test 1 — Claim Lookup</h3>
<p>Question:</p>
<blockquote>
<p>"What is the status of claim 1001?"</p>
</blockquote>
<p>Result:</p>
<blockquote>
<p>The status of claim 1001 is PENDING.</p>
</blockquote>
<h3>Test 2 — High-Priority Claims</h3>
<p>Question:</p>
<blockquote>
<p>"Show me all high-priority claims."</p>
</blockquote>
<p>The agent retrieved the high-priority claims through the MCP tool.</p>
<h3>Test 3 — Policy Question</h3>
<p>Question:</p>
<blockquote>
<p>"What happens when a claim is rejected?"</p>
</blockquote>
<p>The agent used the policy-search/RAG workflow to retrieve relevant policy information.</p>
<h3>Test 4 — Analytics</h3>
<p>Question:</p>
<blockquote>
<p>"Give me claim statistics and analytics."</p>
</blockquote>
<p>The agent used the analytics tool and returned the available claim statistics.</p>
<p>All four workflows were successfully tested through the React frontend.</p>
<hr />
<h1>What I Learned</h1>
<p>This project helped me understand several concepts beyond simply calling an LLM API.</p>
<h3>1. Agents need tools</h3>
<p>An LLM by itself does not automatically know the current state of an application's database.</p>
<p>Giving the agent structured tools allows it to interact with external systems.</p>
<h3>2. MCP provides a structured tool layer</h3>
<p>MCP helped me separate the AI reasoning layer from the operations that actually retrieve information.</p>
<h3>3. RAG is useful for domain-specific knowledge</h3>
<p>For insurance policy questions, retrieving relevant policy information before generating the response provides a more controlled approach than relying only on the model's general knowledge.</p>
<h3>4. Local LLMs are practical for development</h3>
<p>Ollama made it possible to experiment with an LLM locally and understand the architecture without making every development request dependent on a hosted model.</p>
<h3>5. Docker introduces real deployment considerations</h3>
<p>Containerizing the backend exposed practical issues around networking, dependencies, database connectivity, and communication between containerized and host-based services.</p>
<hr />
<h1>Challenges I Encountered</h1>
<p>One of the biggest challenges was connecting all the components together.</p>
<p>The final system involved:</p>
<pre><code class="language-text">React
  ↓
FastAPI
  ↓
LangChain Agent
  ↓
Ollama
  ↓
MCP
  ↓
PostgreSQL / RAG
</code></pre>
<p>I encountered issues with:</p>
<ul>
<li><p>Docker networking</p>
</li>
<li><p>PostgreSQL connectivity from the container</p>
</li>
<li><p>CORS between React and FastAPI</p>
</li>
<li><p>Local Ollama connectivity</p>
</li>
<li><p>Python dependencies inside Docker</p>
</li>
<li><p>CPU-only PyTorch dependencies for reducing Docker image size</p>
</li>
</ul>
<p>Solving these issues helped me understand how the individual technologies work together in a real application.</p>
<hr />
<h1>Project Outcome</h1>
<p>The final application provides a single AI interface for several insurance operations.</p>
<p>It can:</p>
<p>✅ Retrieve individual claim information</p>
<p>✅ Identify high-priority claims</p>
<p>✅ Search insurance policy information using RAG</p>
<p>✅ Provide claim analytics</p>
<p>✅ Use MCP tools through an AI agent</p>
<p>✅ Run LLM inference locally with Ollama</p>
<p>✅ Communicate through a React frontend</p>
<p>✅ Run the backend inside Docker</p>
<hr />
<h1>Future Improvements</h1>
<p>There are several areas I would like to explore next:</p>
<ul>
<li><p>Improve agent response latency</p>
</li>
<li><p>Add authentication and authorization</p>
</li>
<li><p>Add more insurance operations tools</p>
</li>
<li><p>Add richer analytics dashboards</p>
</li>
<li><p>Improve RAG evaluation</p>
</li>
<li><p>Add automated testing</p>
</li>
<li><p>Add monitoring and logging</p>
</li>
<li><p>Deploy the application to Azure</p>
</li>
<li><p>Add production-grade model and tool evaluation</p>
</li>
</ul>
<hr />
<h1>Conclusion</h1>
<p>Building this project gave me hands-on experience moving from traditional AI applications toward <strong>agentic AI systems</strong>.</p>
<p>The main lesson was that an effective AI application is not just about the language model.</p>
<p>The surrounding architecture matters:</p>
<p><strong>LLM + tools + data + retrieval + APIs + database + infrastructure</strong></p>
<p>Combining these components allowed me to build an insurance operations assistant that can interact with real application data and domain-specific knowledge.</p>
<p>This project was a valuable step in my journey toward building practical AI applications with Python and modern AI technologies.</p>
<hr />
<h2>GitHub</h2>
<p>The complete project source code is available here:</p>
<p><a href="https://github.com/shiva-priya123/agentic-insurance-assistant%5C_4solutions-">https://github.com/shiva-priya123/agentic-insurance-assistant\_4solutions-</a></p>
<hr />
<h2>Technologies Used</h2>
<p><code>Python</code> <code>FastAPI</code> <code>React</code> <code>LangChain</code> <code>MCP</code> <code>Ollama</code> <code>Llama 3.2</code> <code>RAG</code> <code>FAISS</code> <code>PostgreSQL</code> <code>SQLAlchemy</code> <code>Docker</code> <code>Vite</code></p>
<p>#AI #AgenticAI #GenerativeAI #Python #FastAPI #LangChain #MCP #RAG #Ollama #PostgreSQL #Docker #React #ArtificialIntelligence</p>
<hr />
<h2>Technology Stack</h2>
<h3>Backend</h3>
<ul>
<li><p>Python</p>
</li>
<li><p>FastAPI</p>
</li>
<li><p>SQLAlchemy</p>
</li>
<li><p>PostgreSQL</p>
</li>
</ul>
<h3>AI</h3>
<ul>
<li><p>LangChain</p>
</li>
<li><p>Ollama</p>
</li>
<li><p>Llama 3.2</p>
</li>
<li><p>Agent-based tool calling</p>
</li>
</ul>
<h3>Agent Tool Layer</h3>
<ul>
<li><p>Model Context Protocol (MCP)</p>
</li>
<li><p>Four MCP tools</p>
</li>
</ul>
<h3>RAG</h3>
<ul>
<li><p>Sentence Transformers</p>
</li>
<li><p>FAISS</p>
</li>
<li><p>Insurance policy documents</p>
</li>
</ul>
<h3>Frontend</h3>
<ul>
<li><p>React</p>
</li>
<li><p>Vite</p>
</li>
</ul>
<h3>Infrastructure</h3>
<ul>
<li><p>Docker</p>
</li>
<li><p>Docker Desktop</p>
</li>
</ul>
<hr />
<h2>How the AI Agent Works</h2>
<p>The most important part of this project is the AI agent.</p>
<p>The user does not need to tell the application which tool to use.</p>
<p>Instead, the agent receives the question and determines which available tool is relevant.</p>
<p>For example:</p>
<h3>Question 1</h3>
<blockquote>
<p>"What is the status of claim 1001?"</p>
</blockquote>
<p>The agent identifies this as a claim lookup request and uses the claim lookup tool.</p>
<p>The tool retrieves the claim from PostgreSQL and returns information such as:</p>
<pre><code class="language-text">Claim ID: 1001
Claim Type: Auto Accident
Status: PENDING
Priority: HIGH
Estimated Damage: $45,000
</code></pre>
<p>The agent then converts the tool result into a natural-language response.</p>
<hr />
<h2>MCP Tool Architecture</h2>
<p>This project uses <strong>Model Context Protocol (MCP)</strong> to provide the agent with structured tools.</p>
<p>I implemented four tools.</p>
<h3>1. Claim Lookup</h3>
<p>This tool retrieves information about a specific claim.</p>
<p>Example:</p>
<blockquote>
<p>"What is the status of claim 1001?"</p>
</blockquote>
<p>The tool queries the PostgreSQL claims database.</p>
<hr />
<h3>2. High-Priority Claims</h3>
<p>This tool retrieves claims marked as high priority.</p>
<p>Example:</p>
<blockquote>
<p>"Show me all high-priority claims."</p>
</blockquote>
<p>The system returned claims such as:</p>
<pre><code class="language-text">Claim 1001
Type: Auto Accident
Status: PENDING
Priority: HIGH
Estimated Damage: $45,000

Claim 1003
Type: Theft
Status: PENDING
Priority: HIGH
Estimated Damage: $32,000
</code></pre>
<hr />
<h3>3. Insurance Policy Search</h3>
<p>The third tool handles insurance policy questions.</p>
<p>For example:</p>
<blockquote>
<p>"What happens when a claim is rejected?"</p>
</blockquote>
<p>Instead of asking the LLM to generate an answer from memory, the agent uses the policy-search tool.</p>
<p>The relevant policy information is retrieved through the project's RAG pipeline and provided to the agent.</p>
<p>This helps keep policy-related responses grounded in the available policy information.</p>
<hr />
<h3>4. Claim Analytics</h3>
<p>The fourth tool provides claim-related analytics.</p>
<p>For example:</p>
<blockquote>
<p>"Give me claim statistics and analytics."</p>
</blockquote>
<p>The agent uses the analytics tool to retrieve the available statistics rather than generating numbers itself.</p>
<hr />
<h1>Retrieval-Augmented Generation (RAG)</h1>
<p>The project also includes a policy knowledge component using Retrieval-Augmented Generation.</p>
<p>The basic workflow is:</p>
<pre><code class="language-text">Insurance Policy Documents
          |
          v
       Chunking
          |
          v
     Embeddings
          |
          v
     FAISS Vector Store
          |
          v
       User Query
          |
          v
   Similarity Search
          |
          v
 Relevant Policy Context
          |
          v
       AI Agent
          |
          v
       Response
</code></pre>
<p>This allows the system to search the insurance policy knowledge base when a user asks a policy-related question.</p>
<p>The purpose is to reduce the need for the language model to rely only on its pretrained knowledge.</p>
<hr />
<h1>PostgreSQL Claim Database</h1>
<p>Claim information is stored in PostgreSQL.</p>
<p>The project currently contains sample claims that include information such as:</p>
<ul>
<li><p>Claim ID</p>
</li>
<li><p>Claim type</p>
</li>
<li><p>Status</p>
</li>
<li><p>Priority</p>
</li>
<li><p>Estimated damage</p>
</li>
</ul>
<p>For example:</p>
<pre><code class="language-text">Claim ID: 1001
Claim Type: Auto Accident
Status: PENDING
Priority: HIGH
Estimated Damage: $45,000
</code></pre>
<p>The MCP claim tools interact with this database to retrieve the required information.</p>
<hr />
<h1>React Frontend</h1>
<p>I built a React frontend to provide a simple interface for interacting with the AI agent.</p>
<p>The interface allows users to:</p>
<ul>
<li><p>Enter natural-language questions</p>
</li>
<li><p>Submit questions to the AI agent</p>
</li>
<li><p>View the generated response</p>
</li>
<li><p>Use predefined example questions</p>
</li>
</ul>
<p>Example quick actions include:</p>
<ul>
<li><p>Claim 1001 Status</p>
</li>
<li><p>High-Priority Claims</p>
</li>
<li><p>Rejected Claims Policy</p>
</li>
<li><p>Claim Analytics</p>
</li>
</ul>
<p>The frontend communicates with the FastAPI backend through HTTP requests.</p>
<hr />
<h1>FastAPI Backend</h1>
<p>FastAPI acts as the backend API layer.</p>
<p>The main AI endpoint is:</p>
<pre><code class="language-text">POST /agent
</code></pre>
<p>The frontend sends a question to this endpoint.</p>
<p>The backend passes the question to the AI agent, which determines whether one of the available MCP tools should be used.</p>
<p>The resulting answer is then returned to the React application.</p>
<hr />
<h1>Ollama and Local LLM Inference</h1>
<p>One of the interesting decisions in this project was using <strong>Ollama with Llama 3.2</strong> for local LLM inference.</p>
<p>Instead of depending on a hosted LLM API for the agent workflow, the project uses a locally running model.</p>
<p>This provided hands-on experience with:</p>
<ul>
<li><p>Local LLM inference</p>
</li>
<li><p>Agent tool calling</p>
</li>
<li><p>Connecting a containerized application to a host-based LLM</p>
</li>
<li><p>Building an AI application without requiring every inference request to go through a cloud API</p>
</li>
</ul>
<hr />
<h1>Docker Containerization</h1>
<p>The FastAPI application was containerized using Docker.</p>
<p>The Dockerized architecture communicates with:</p>
<ul>
<li><p>PostgreSQL</p>
</li>
<li><p>Ollama running locally</p>
</li>
<li><p>MCP tools</p>
</li>
<li><p>React frontend</p>
</li>
</ul>
<p>One challenge was networking between the Docker container and services running on the host machine.</p>
<p>The application was configured to use:</p>
<pre><code class="language-text">host.docker.internal
</code></pre>
<p>for communication with host-based services.</p>
<p>This was an important practical lesson because networking behavior inside a Docker container is different from running the application directly on Windows.</p>
<hr />
<h1>Testing the Application</h1>
<p>I tested the application using four main scenarios.</p>
<h3>Test 1 — Claim Lookup</h3>
<p>Question:</p>
<blockquote>
<p>"What is the status of claim 1001?"</p>
</blockquote>
<p>Result:</p>
<blockquote>
<p>The status of claim 1001 is PENDING.</p>
</blockquote>
<h3>Test 2 — High-Priority Claims</h3>
<p>Question:</p>
<blockquote>
<p>"Show me all high-priority claims."</p>
</blockquote>
<p>The agent retrieved the high-priority claims through the MCP tool.</p>
<h3>Test 3 — Policy Question</h3>
<p>Question:</p>
<blockquote>
<p>"What happens when a claim is rejected?"</p>
</blockquote>
<p>The agent used the policy-search/RAG workflow to retrieve relevant policy information.</p>
<h3>Test 4 — Analytics</h3>
<p>Question:</p>
<blockquote>
<p>"Give me claim statistics and analytics."</p>
</blockquote>
<p>The agent used the analytics tool and returned the available claim statistics.</p>
<p>All four workflows were successfully tested through the React frontend.</p>
<hr />
<h1>What I Learned</h1>
<p>This project helped me understand several concepts beyond simply calling an LLM API.</p>
<h3>1. Agents need tools</h3>
<p>An LLM by itself does not automatically know the current state of an application's database.</p>
<p>Giving the agent structured tools allows it to interact with external systems.</p>
<h3>2. MCP provides a structured tool layer</h3>
<p>MCP helped me separate the AI reasoning layer from the operations that actually retrieve information.</p>
<h3>3. RAG is useful for domain-specific knowledge</h3>
<p>For insurance policy questions, retrieving relevant policy information before generating the response provides a more controlled approach than relying only on the model's general knowledge.</p>
<h3>4. Local LLMs are practical for development</h3>
<p>Ollama made it possible to experiment with an LLM locally and understand the architecture without making every development request dependent on a hosted model.</p>
<h3>5. Docker introduces real deployment considerations</h3>
<p>Containerizing the backend exposed practical issues around networking, dependencies, database connectivity, and communication between containerized and host-based services.</p>
<hr />
<h1>Challenges I Encountered</h1>
<p>One of the biggest challenges was connecting all the components together.</p>
<p>The final system involved:</p>
<pre><code class="language-text">React
  ↓
FastAPI
  ↓
LangChain Agent
  ↓
Ollama
  ↓
MCP
  ↓
PostgreSQL / RAG
</code></pre>
<p>I encountered issues with:</p>
<ul>
<li><p>Docker networking</p>
</li>
<li><p>PostgreSQL connectivity from the container</p>
</li>
<li><p>CORS between React and FastAPI</p>
</li>
<li><p>Local Ollama connectivity</p>
</li>
<li><p>Python dependencies inside Docker</p>
</li>
<li><p>CPU-only PyTorch dependencies for reducing Docker image size</p>
</li>
</ul>
<p>Solving these issues helped me understand how the individual technologies work together in a real application.</p>
<hr />
<h1>Project Outcome</h1>
<p>The final application provides a single AI interface for several insurance operations.</p>
<p>It can:</p>
<p>✅ Retrieve individual claim information</p>
<p>✅ Identify high-priority claims</p>
<p>✅ Search insurance policy information using RAG</p>
<p>✅ Provide claim analytics</p>
<p>✅ Use MCP tools through an AI agent</p>
<p>✅ Run LLM inference locally with Ollama</p>
<p>✅ Communicate through a React frontend</p>
<p>✅ Run the backend inside Docker</p>
<hr />
<h1>Future Improvements</h1>
<p>There are several areas I would like to explore next:</p>
<ul>
<li><p>Improve agent response latency</p>
</li>
<li><p>Add authentication and authorization</p>
</li>
<li><p>Add more insurance operations tools</p>
</li>
<li><p>Add richer analytics dashboards</p>
</li>
<li><p>Improve RAG evaluation</p>
</li>
<li><p>Add automated testing</p>
</li>
<li><p>Add monitoring and logging</p>
</li>
<li><p>Deploy the application to Azure</p>
</li>
<li><p>Add production-grade model and tool evaluation</p>
</li>
</ul>
<hr />
<h1>Conclusion</h1>
<p>Building this project gave me hands-on experience moving from traditional AI applications toward <strong>agentic AI systems</strong>.</p>
<p>The main lesson was that an effective AI application is not just about the language model.</p>
<p>The surrounding architecture matters:</p>
<p><strong>LLM + tools + data + retrieval + APIs + database + infrastructure</strong></p>
<p>Combining these components allowed me to build an insurance operations assistant that can interact with real application data and domain-specific knowledge.</p>
<p>This project was a valuable step in my journey toward building practical AI applications with Python and modern AI technologies.</p>
<hr />
<h2>GitHub</h2>
<p>The complete project source code is available here:</p>
<p><a href="https://github.com/shiva-priya123/agentic-insurance-assistant%5C_4solutions-">https://github.com/shiva-priya123/agentic-insurance-assistant\_4solutions-</a></p>
<hr />
<h2>Technologies Used</h2>
<p><code>Python</code> <code>FastAPI</code> <code>React</code> <code>LangChain</code> <code>MCP</code> <code>Ollama</code> <code>Llama 3.2</code> <code>RAG</code> <code>FAISS</code> <code>PostgreSQL</code> <code>SQLAlchemy</code> <code>Docker</code> <code>Vite</code></p>
<p>#AI #AgenticAI #GenerativeAI #Python #FastAPI #LangChain #MCP #RAG #Ollama #PostgreSQL #Docker #React #ArtificialIntelligence</p>
]]></content:encoded></item></channel></rss>