<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Getting Started with LangChain in Software - General</title>
    <link>https://community.hpe.com/t5/software-general/getting-started-with-langchain/m-p/7252263#M1355</link>
    <description>&lt;P&gt;&lt;FONT size="6"&gt;What is GenAI?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Generative AI&lt;/STRONG&gt; is a subset of the AI domain that specifically deals with&amp;nbsp;creating new, original content. To understand its place, let's quickly map the bigger picture:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AI -&amp;gt; ML -&amp;gt; DL -&amp;gt; GenAI&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;Artificial Intelligence&lt;/STRONG&gt; (AI): The broadest field aiming to make machines think and perform human-like tasks.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Machine Learning&lt;/STRONG&gt; (ML): AI That Learns. A core AI approach where machines learn from data to find patterns and make predictions, rather than being explicitly programmed.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Deep Learning&lt;/STRONG&gt; (DL): ML with Brains. A powerful ML technique using multi-layered neural networks to learn complex patterns, especially from unstructured data like images and sound.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Generative AI&lt;/STRONG&gt; (GenAI): The Creative Spark. Leveraging Deep Learning, GenAI takes it a step further: it generates entirely new text, images, code, or other media.&lt;/P&gt;&lt;P&gt;&lt;FONT size="6"&gt;What is LangChain?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LangChain&lt;/STRONG&gt; is a framework that simplifies the development of LLM-powered applications. LangChain provides built-in classes and methods for existing LLM models, and langchain-community provides for open-source models.&lt;/P&gt;&lt;P&gt;Please refer image below to understand the ideal langchain flow.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="LangChain workflow in web application.png" style="width: 602px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150770iBB12BA683074BDAB/image-size/large?v=v2&amp;amp;px=2000" role="button" title="LangChain workflow in web application.png" alt="LangChain workflow in web application.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Please refer image below to understand langchain workflow when implemented with a web application.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="LangChain workflow in web application 2.png" style="width: 400px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150771iCA05CF0CA470E9D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LangChain workflow in web application 2.png" alt="LangChain workflow in web application 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To experiment with Generative AI, we can have api keys from existing models, or we can run an open-source model locally with the help of Ollama.&lt;/P&gt;&lt;P&gt;&lt;FONT size="6"&gt;Run the LLM model locally with Ollama&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;Refer to&amp;nbsp;&lt;A href="https://ollama.com/search" target="_blank" rel="noopener"&gt;https://ollama.com/search&lt;/A&gt;&lt;/FONT&gt;&lt;FONT size="4"&gt;&amp;nbsp;for all available open-source models.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Download and install Ollama: &lt;A href="https://ollama.com/download/windows" target="_blank" rel="noopener"&gt;Ollama on Windows&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For the Open Source LLM setup, we will use the Gemma:2 b model from Ollama.&lt;/P&gt;&lt;P&gt;Verify Ollama is installed successfully.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;C:\Users\pashubha&amp;gt;ollama -v
ollama version is 0.9.5&lt;/LI-CODE&gt;&lt;P&gt;Pull the model from the repository&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;C:\Users\pashubha&amp;gt;ollama pull gemma:2b
pulling manifest
pulling c1864a5eb193: 100% ▕███████████████████████████████████████████▏ 1.7 GB
pulling 097a36493f71: 100% ▕███████████████████████████████████████████▏ 8.4 KB
pulling manifest
pulling c1864a5eb193: 100% ▕███████████████████████████████████████████▏ 1.7 GB
pulling 097a36493f71: 100% ▕███████████████████████████████████████████▏ 8.4 KB
pulling 109037bec39c: 100% ▕███████████████████████████████████████████▏  136 B
pulling 22a838ceb7fb: 100% ▕███████████████████████████████████████████▏   84 B
pulling 887433b89a90: 100% ▕███████████████████████████████████████████▏  483 B
verifying sha256 digest
writing manifest
success&lt;/LI-CODE&gt;&lt;P&gt;Use the command &lt;STRONG&gt;ollama run gemma:2b&lt;/STRONG&gt; to run the model locally.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="6"&gt;Project Setup for LangChain&lt;/FONT&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;FONT size="4"&gt;Install the required dependencies&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="python"&gt;pip install langchain langchain-openai langchain-community&lt;/LI-CODE&gt;&lt;UL&gt;&lt;LI&gt;Sample code setup&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="python"&gt;3.	import os
4.	from langchain_openai import ChatOpenAI
5.	
6.	OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
7.	llm=ChatOpenAI(model="gpt-4o", api_key=OPENAI_API_KEY)
8.	
9.	question = "What is GenAI?"
10.	response = llm.invoke(question)
11.	print(response.content)​&lt;/LI-CODE&gt;&lt;UL&gt;&lt;LI&gt;Response will be&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="markup"&gt;**GenAI**, short for **Generative Artificial Intelligence**, refers to a type of artificial intelligence that uses machine learning models to create new, original content. This content can range from text, images, music, videos, code, and even 3D designs. Generative AI systems are trained on vast amounts of data and can generate outputs that resemble human-like creativity and decision-making.

### Key Features of GenAI:
1. **Content Generation:** GenAI models can create new, high-quality content from scratch or based on specific inputs, such as a prompt or sample data. 
2. **Personalization:** It tailors content to individuals' preferences based on prior behavior, feedback, or context.
3. **Creativity and Innovation:** These models can offer unique ideas and assist in creative processes like writing, designing, or brainstorming.       
4. **Understanding Context:** GenAI systems are capable of understanding and responding to nuanced prompts, making the interactions feel natural and human-like.
​&lt;/LI-CODE&gt;&lt;P&gt;Note: Response may vary from LLM to LLM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&lt;EM&gt;&lt;STRONG&gt;Shubham Patil&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&lt;EM&gt;&lt;STRONG&gt;Hewlett Packard Enterprise (PS-GCC)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jul 2025 06:10:37 GMT</pubDate>
    <dc:creator>Shubham_Patil</dc:creator>
    <dc:date>2025-07-08T06:10:37Z</dc:date>
    <item>
      <title>Getting Started with LangChain</title>
      <link>https://community.hpe.com/t5/software-general/getting-started-with-langchain/m-p/7252263#M1355</link>
      <description>&lt;P&gt;&lt;FONT size="6"&gt;What is GenAI?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Generative AI&lt;/STRONG&gt; is a subset of the AI domain that specifically deals with&amp;nbsp;creating new, original content. To understand its place, let's quickly map the bigger picture:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AI -&amp;gt; ML -&amp;gt; DL -&amp;gt; GenAI&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;Artificial Intelligence&lt;/STRONG&gt; (AI): The broadest field aiming to make machines think and perform human-like tasks.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Machine Learning&lt;/STRONG&gt; (ML): AI That Learns. A core AI approach where machines learn from data to find patterns and make predictions, rather than being explicitly programmed.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Deep Learning&lt;/STRONG&gt; (DL): ML with Brains. A powerful ML technique using multi-layered neural networks to learn complex patterns, especially from unstructured data like images and sound.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Generative AI&lt;/STRONG&gt; (GenAI): The Creative Spark. Leveraging Deep Learning, GenAI takes it a step further: it generates entirely new text, images, code, or other media.&lt;/P&gt;&lt;P&gt;&lt;FONT size="6"&gt;What is LangChain?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LangChain&lt;/STRONG&gt; is a framework that simplifies the development of LLM-powered applications. LangChain provides built-in classes and methods for existing LLM models, and langchain-community provides for open-source models.&lt;/P&gt;&lt;P&gt;Please refer image below to understand the ideal langchain flow.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="LangChain workflow in web application.png" style="width: 602px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150770iBB12BA683074BDAB/image-size/large?v=v2&amp;amp;px=2000" role="button" title="LangChain workflow in web application.png" alt="LangChain workflow in web application.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Please refer image below to understand langchain workflow when implemented with a web application.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="LangChain workflow in web application 2.png" style="width: 400px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150771iCA05CF0CA470E9D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LangChain workflow in web application 2.png" alt="LangChain workflow in web application 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To experiment with Generative AI, we can have api keys from existing models, or we can run an open-source model locally with the help of Ollama.&lt;/P&gt;&lt;P&gt;&lt;FONT size="6"&gt;Run the LLM model locally with Ollama&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;Refer to&amp;nbsp;&lt;A href="https://ollama.com/search" target="_blank" rel="noopener"&gt;https://ollama.com/search&lt;/A&gt;&lt;/FONT&gt;&lt;FONT size="4"&gt;&amp;nbsp;for all available open-source models.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Download and install Ollama: &lt;A href="https://ollama.com/download/windows" target="_blank" rel="noopener"&gt;Ollama on Windows&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For the Open Source LLM setup, we will use the Gemma:2 b model from Ollama.&lt;/P&gt;&lt;P&gt;Verify Ollama is installed successfully.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;C:\Users\pashubha&amp;gt;ollama -v
ollama version is 0.9.5&lt;/LI-CODE&gt;&lt;P&gt;Pull the model from the repository&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;C:\Users\pashubha&amp;gt;ollama pull gemma:2b
pulling manifest
pulling c1864a5eb193: 100% ▕███████████████████████████████████████████▏ 1.7 GB
pulling 097a36493f71: 100% ▕███████████████████████████████████████████▏ 8.4 KB
pulling manifest
pulling c1864a5eb193: 100% ▕███████████████████████████████████████████▏ 1.7 GB
pulling 097a36493f71: 100% ▕███████████████████████████████████████████▏ 8.4 KB
pulling 109037bec39c: 100% ▕███████████████████████████████████████████▏  136 B
pulling 22a838ceb7fb: 100% ▕███████████████████████████████████████████▏   84 B
pulling 887433b89a90: 100% ▕███████████████████████████████████████████▏  483 B
verifying sha256 digest
writing manifest
success&lt;/LI-CODE&gt;&lt;P&gt;Use the command &lt;STRONG&gt;ollama run gemma:2b&lt;/STRONG&gt; to run the model locally.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="6"&gt;Project Setup for LangChain&lt;/FONT&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;FONT size="4"&gt;Install the required dependencies&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="python"&gt;pip install langchain langchain-openai langchain-community&lt;/LI-CODE&gt;&lt;UL&gt;&lt;LI&gt;Sample code setup&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="python"&gt;3.	import os
4.	from langchain_openai import ChatOpenAI
5.	
6.	OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
7.	llm=ChatOpenAI(model="gpt-4o", api_key=OPENAI_API_KEY)
8.	
9.	question = "What is GenAI?"
10.	response = llm.invoke(question)
11.	print(response.content)​&lt;/LI-CODE&gt;&lt;UL&gt;&lt;LI&gt;Response will be&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="markup"&gt;**GenAI**, short for **Generative Artificial Intelligence**, refers to a type of artificial intelligence that uses machine learning models to create new, original content. This content can range from text, images, music, videos, code, and even 3D designs. Generative AI systems are trained on vast amounts of data and can generate outputs that resemble human-like creativity and decision-making.

### Key Features of GenAI:
1. **Content Generation:** GenAI models can create new, high-quality content from scratch or based on specific inputs, such as a prompt or sample data. 
2. **Personalization:** It tailors content to individuals' preferences based on prior behavior, feedback, or context.
3. **Creativity and Innovation:** These models can offer unique ideas and assist in creative processes like writing, designing, or brainstorming.       
4. **Understanding Context:** GenAI systems are capable of understanding and responding to nuanced prompts, making the interactions feel natural and human-like.
​&lt;/LI-CODE&gt;&lt;P&gt;Note: Response may vary from LLM to LLM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&lt;EM&gt;&lt;STRONG&gt;Shubham Patil&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&lt;EM&gt;&lt;STRONG&gt;Hewlett Packard Enterprise (PS-GCC)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 06:10:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-general/getting-started-with-langchain/m-p/7252263#M1355</guid>
      <dc:creator>Shubham_Patil</dc:creator>
      <dc:date>2025-07-08T06:10:37Z</dc:date>
    </item>
  </channel>
</rss>

