<?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 Ramya Kalyanaraman on Medium]]></title>
        <description><![CDATA[Stories by Ramya Kalyanaraman on Medium]]></description>
        <link>https://medium.com/@ramyakalyan?source=rss-8136169b094b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dQOjf78-ImKhUXpXRC6SzA.jpeg</url>
            <title>Stories by Ramya Kalyanaraman on Medium</title>
            <link>https://medium.com/@ramyakalyan?source=rss-8136169b094b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 05:34:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ramyakalyan/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[I Built an LLM-Powered AI Chatbot in 10 Minutes — Here’s How You Can Too!]]></title>
            <link>https://medium.com/@ramyakalyan/i-built-an-llm-powered-ai-chatbot-in-10-minutes-heres-how-you-can-too-ff81257dbe3e?source=rss-8136169b094b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff81257dbe3e</guid>
            <category><![CDATA[llm-agent]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[ai-chat-bot]]></category>
            <category><![CDATA[build-chat-app]]></category>
            <dc:creator><![CDATA[Ramya Kalyanaraman]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 21:52:34 GMT</pubDate>
            <atom:updated>2024-10-18T21:52:34.334Z</atom:updated>
            <content:encoded><![CDATA[<h3>I Built an LLM-Powered AI Chatbot in 10 Minutes — Here’s How You Can Too!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*znTcWt_XTLcJnQ10" /></figure><p><strong>Introduction</strong><br>I recently built my first LLM-powered chatbot using the OpenAI API, and it was a truly rewarding experience! In this blog, I’ll walk you through how I set it up, wrote the code, and made the chatbot interactive.</p><p><strong>Getting Started</strong><br>To begin, I set up Python and installed the OpenAI library:</p><ol><li><strong>Install Python and OpenAI Library</strong>:</li></ol><pre>pip install openai</pre><p><strong>2. Get an API Key</strong>: I signed up on <a href="https://platform.openai.com/">OpenAI’s platform</a> and generated my API key.</p><p><strong>Building the Chatbot</strong><br>The basic idea was to create a chatbot that could hold a conversation with context. Here’s the essential code I used:</p><pre>import openai<br>import os<br><br># Set the API key<br>openai.api_key = os.getenv(&quot;OPENAI_API_KEY&quot;)<br><br>conversation_history = [<br>    {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: &quot;You are a helpful assistant.&quot;}<br>]<br><br>def chat_with_openai(prompt):<br>    conversation_history.append({&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: prompt})<br>    response = openai.ChatCompletion.create(<br>        model=&quot;gpt-3.5-turbo&quot;,<br>        messages=conversation_history<br>    )<br>    answer = response.choices[0].message[&#39;content&#39;].strip()<br>    conversation_history.append({&quot;role&quot;: &quot;assistant&quot;, &quot;content&quot;: answer})<br>    return answer<br><br>print(&quot;Chatbot ready! Type &#39;exit&#39; to end.&quot;)<br>while True:<br>    user_input = input(&quot;You: &quot;)<br>    if user_input.lower() in [&quot;exit&quot;, &quot;quit&quot;]:<br>        print(&quot;Goodbye!&quot;)<br>        break<br>    print(f&quot;Assistant: {chat_with_openai(user_input)}&quot;)</pre><p>For the full code and more details, check out the <a href="https://github.com/ramyakalyan/chat_bot_demo">GitHub repository.</a></p><p>Here’s a quick example of how the chatbot can assist with a simple task, such as providing a recipe for making a cup of tea:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PRwNw_SX7x_odzDd4tIqSw.png" /></figure><ol><li><strong>Conversation Handling</strong>: It stores the conversation history to maintain context, allowing for meaningful replies.</li><li><strong>Chat Loop</strong>: The chatbot runs in a loop, responding to user input until “exit” is typed.</li></ol><p><strong>Enhancements</strong><br>I made a few improvements:</p><ul><li><strong>Conversation Context</strong>: The chatbot remembers previous messages to maintain a natural flow.</li><li><strong>Custom Behavior</strong>: By tweaking the initial system message, I experimented with different chatbot personalities.</li></ul><p><strong>Lessons Learned</strong></p><ul><li><strong>Ease of Integration</strong>: The OpenAI API is straightforward and powerful, making it ideal for quick AI projects.</li><li><strong>Context Matters</strong>: Maintaining conversation history is crucial for coherent responses.</li><li><strong>Error Handling</strong>: Adding basic error checks helps ensure a smooth experience.</li></ul><p><strong>Future Plans</strong><br>I’m planning to:</p><ul><li><strong>Add a GUI</strong>: Develop a user-friendly interface using <strong>Streamlit</strong> to make the chatbot more accessible and visually appealing.</li><li><strong>Prompt System Role Changes</strong>: Experiment with different system roles (e.g., “math tutor” or “travel guide”) for more specialized and flexible interactions.</li></ul><p><strong>Conclusion</strong><br>Building this LLM powered chatbot was a fantastic introduction to AI development. It’s an accessible project for beginners, and I’m excited to keep improving it!</p><p><strong>Call to Action</strong><br>Give it a try and share your experiences. If you’re new to AI, this project is a great way to start!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff81257dbe3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Coding Challenge to Healthcare Insights: Using PostgreSQL for Cardiac Data]]></title>
            <link>https://medium.com/@ramyakalyan/from-coding-challenge-to-healthcare-insights-using-postgresql-for-cardiac-data-40a1fc79896a?source=rss-8136169b094b------2</link>
            <guid isPermaLink="false">https://medium.com/p/40a1fc79896a</guid>
            <dc:creator><![CDATA[Ramya Kalyanaraman]]></dc:creator>
            <pubDate>Wed, 16 Oct 2024 16:45:55 GMT</pubDate>
            <atom:updated>2024-10-16T16:45:55.408Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ch37BYhYi-8jjSJS" /></figure><p>Recently, I participated in my first coding challenge, related to cardiac failure healthcare data. What started as a technical exercise quickly became a deep dive into how PostgreSQL can simplify the complex world of healthcare data.</p><p>My main goals for this challenge were to:</p><p>1. Sharpen my SQL skills.</p><p>2. Learn to analyze healthcare data more effectively.</p><p>3. Solve complex problems while meeting tight timelines and contributing meaningfully to a team.</p><p>By the end of the challenge, I realized how powerful PostgreSQL’s built-in functions are — especially when it comes to <strong>healthcare analytics</strong>.</p><p><strong>Why Range and Statistical Functions Became a Game-Changer: width_bucket() and ntile()</strong></p><p>1. <strong>Range and Bucket Functions</strong>: Functions like width_bucket() and int4range(), used for grouping data into defined ranges.</p><p>To solve the problem of dividing BMI into slabs of 5 and counting the patients in each, width_bucket() and int4range() were super helpful.</p><p>· width_bucket() automatically placed each BMI into the right bucket, saving me from writing a bunch of CASE statements. I just defined the bucket range for buckets, and it took care of the rest.</p><p>· int4range() made the BMI ranges clearer by turning them into readable intervals.</p><p>Together, these two functions made the solution way cleaner, more flexible, and easier to manage than using CASE statements.</p><pre>WITH bmi AS<br>  (SELECT<br>    ROUND(CAST(bmi AS numeric), 2) AS bmi_rounded,<br>    COUNT(bmi) AS bmi_count<br>    FROM public.demography<br>    GROUP BY bmi_rounded<br>    ORDER BY bmi_rounded ASC)<br>    <br>SELECT<br>  WIDTH_BUCKET(bmi_rounded, array[0,18.5,25,30,35]) AS bmi_bucket,<br>  INT4RANGE(CAST(min(bmi_rounded) AS integer),<br>  CAST(max(bmi_rounded) AS integer), &#39;()&#39;) AS starting_ending_range,<br>  COUNT(bmi_count) AS count_bmi<br>FROM bmi<br>GROUP BY bmi_bucket<br>ORDER BY bmi_bucket ASC;</pre><p>And this was my result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*oXY2mvTYMTYKO0l48SzNxA.png" /></figure><p>width_bucket() and int4range() can be super useful in healthcare data for:</p><p>1. <strong>Age Grouping</strong>: Easily group patients by age (e.g. 10-year intervals) for analysis.</p><p>2. <strong>Blood Pressure Categories</strong>: Categorize patients by systolic/diastolic ranges without complex CASE statements.</p><p>3. <strong>Cholesterol Levels</strong>: Group patients by cholesterol risk categories for easier analysis.</p><p>4. <strong>Lab Test Results</strong>: Bucket numeric test results (e.g., glucose levels) into normal/abnormal ranges.</p><p>5. <strong>Weight Categories</strong>: Just like with BMI, group patients by weight ranges for quick insights.</p><p>These functions streamline categorizing continuous data, making analysis quicker and more flexible.</p><p>Another example based on age grouping:</p><pre>SELECT<br>  WIDTH_BUCKET(age, ARRAY[20,30,40,50,60,70,80,90]) AS age_bucket,<br>  INT4RANGE(<br>    MIN(age)::integer,<br>    MAX(age)::integer,<br>    &#39;()&#39;<br>  ) AS starting_ending_range,<br>  COUNT(*) AS age_count<br>FROM public.demography<br>GROUP BY age_bucket<br>ORDER BY age_bucket ASC;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*Wy-ZILme0frpRdEQFhv4Ng.png" /></figure><p>To categorize patients by ejection fraction using NTILE() and examine how their cardiac function classification (NYHA class) is distributed across each group</p><p>1. <strong>Window Functions</strong>: Functions like NTILE(), RANK(), LEAD(), LAG(), ROW_NUMBER(), PERCENT_RANK(), and CUME_DIST(). These functions allow you to perform calculations across a set of rows related to the current row without aggregating the entire dataset.</p><p><strong>NTILE(3)</strong>: This divides patients into three groups based on their <strong>LVEF (Left Ventricular Ejection Fraction)</strong> scores, which measure how well the heart pumps blood. Higher LVEF means better heart function.</p><ul><li><strong>Group 1</strong>: Highest LVEF, best heart function.</li><li><strong>Group 3</strong>: Lowest LVEF, poorest heart function.</li></ul><p><strong>NYHA Classification</strong>: This ranks heart failure based on symptoms:</p><ul><li><strong>Class 1</strong>: No symptoms, normal activities.</li><li><strong>Class 2</strong>: Mild symptoms, slight limitations.</li><li><strong>Class 3</strong>: Noticeable limitations, daily activities are difficult.</li><li><strong>Class 4</strong>: Severe symptoms, even at rest.</li></ul><pre>WITH lvef_categories AS (<br>  SELECT<br>    inpatient_number,<br>    lvef,<br>    nyha_cardiac_function_classification<br>--Use NTILE to divide patients into 3 groups based on LVEF (Low, Medium, High)<br>    NTILE(3) OVER (ORDER BY lvef DESC) AS lvef_group<br>  FROM cardiaccomplications<br>  WHERE lvef IS NOT NULL<br>)<br>SELECT<br>  lvef_group,<br>  nyha_cardiac_function_classification,<br>  COUNT(*) AS patient_count<br>FROM lvef_categories<br>GROUP BY lvef_group, nyha_cardiac_function_classification<br>ORDER BY lvef_group, nyha_cardiac_function_classification;</pre><p>Here is the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*kMenYsWA4jNC9kcIpCYuAw.png" /></figure><p><strong>What I Learned</strong>: Running this query showed me how patients with lower LVEF (Group 3) aligned with more severe heart failure symptoms (NYHA Class 3 or 4). It clearly highlighted the connection between heart function and everyday impact.</p><p><strong>Takeaway</strong>: This analysis helped me see how LVEF ties into real-life symptoms, providing a powerful tool for doctors to make better treatment decisions based on both objective data and patient experience.</p><p>Here are most common use case for <strong>NTILE()</strong> in healthcare is dividing patients into risk groups based on health metrics.</p><p>1. <strong>Patient Grouping:</strong> NTILE() divides patients into groups (e.g., high, medium, low risk) based on clinical data like cholesterol or blood pressure.</p><p>2. <strong>Early Risk Detection:</strong> Identifies high-risk patients for timely intervention.</p><p>3. <strong>Better Resource Use: </strong>Focuses healthcare resources on higher-risk patients.</p><p>4. <strong>Tailored Treatment:</strong> Enables personalized care based on patient risk.</p><p>5. <strong>Prevention:</strong> Flags potential health issues early, helping reduce future costs.</p><p><strong>Final Takeaways</strong></p><p>Participating in this coding challenge gave me a deeper understanding of <strong>PostgreSQL’s capabilities</strong> in handling complex healthcare data</p><p>Whether you’re working with <strong>BMI data</strong>, <strong>cholesterol levels</strong>, or <strong>cardiac health metrics</strong>, these PostgreSQL tools make it easier to draw meaningful conclusions and help healthcare professionals make better decisions.</p><p>In the future, I look forward to applying these techniques to real-world healthcare projects, making data analysis more insightful and actionable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40a1fc79896a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>