Learnitweb

Category: Machine learning

  • Vector Stores, Retrievers, and RAG in LangChain

    Large Language Models do not “know” your data. If you want a model to answer questions based on external knowledge—documents, PDFs, websites, or internal data—you need a mechanism to retrieve relevant information and feed it to the model at inference time. This is where vector stores and retrievers come into play. 1. What Is a…

  • Managing Conversation History in LangChain Chatbots

    In the previous tutorials, we built a chatbot that could remember conversational context using message history, session IDs, and prompt templates. At that stage, the chatbot worked correctly, but there was an important problem left unsolved. As conversations grow longer, the list of messages sent to the language model grows without bound. Every language model…

  • Using Prompt Templates with Chat History in LangChain Chatbots

    In the previous tutorial, we learned how to build a chatbot that can remember conversational context using message history and session IDs. At that stage, we were directly passing lists of messages—human messages, AI messages, and system messages—into the language model. While that approach works, it is not how real-world chatbot systems are typically designed.…

  • How Chat History Is Maintained in a LangChain Chatbot

    When building a chatbot with LangChain, it is easy to assume that the language model itself remembers previous conversations. In reality, this is not true. A language model is stateless; it does not retain any information between calls. What makes a chatbot appear conversational is the careful handling of chat history at the application level.…

  • Exposing LangChain (LCEL) Applications as REST APIs using LangServe

    1. What Is LangServe? LangServe is an official tool from the LangChain ecosystem that lets you expose LangChain chains and runnables as REST APIs with almost no extra code. In simple terms: LangServe turns your LangChain logic into a production-ready API. 2. Why LangServe Exists? When you build an LLM app using LangChain, you usually…

  • Getting started with Open source models using Groq API

    1. What is Groq? Groq is a company that builds specialized AI hardware and software designed specifically for ultra-fast inference of Large Language Models (LLMs). Unlike traditional AI hardware vendors that focus on training, Groq is laser-focused on inference — the phase where trained models generate responses for real users. Groq’s key innovation is the…

  • Getting started with Open source models using Groq API

    1. What Is Groq? Groq is an AI infrastructure company focused entirely on high-performance inference for large language models (LLMs). Groq does not train models. Instead, it: In simple terms, Groq makes LLMs run extremely fast in production. 2. Models Available on Groq Groq hosts popular open-source LLMs, including: 3. Groq API: How Developers Use…

  • What is LCEL (LangChain Expression Language)?

    1. What is LCEL (LangChain Expression Language)? LCEL (LangChain Expression Language) is a declarative way of defining how different LangChain components are connected and how data flows between them. Instead of focusing on how to call functions step by step, LCEL focuses on what the pipeline looks like. In simple terms, LCEL allows you to…

  • Tracking LangChain App with LangSmith

    LangSmith allows you to: LangSmith works even with Ollama and local LLMs. It does not require OpenAI. 1. What LangSmith Tracks in Your App Once enabled, LangSmith automatically captures: You do not need to change your chain logic. 2. Create a LangSmith Account After login, you’ll see: 3. Get Your LangSmith API Key 4. Enable…

  • Simple GenAI App Using Ollama

    This tutorial shows how to build a local Generative AI web application using: 1. Prerequisites Before starting, make sure you have: Download the model once using: Once downloaded, it will be reused automatically. 2. requirements.txt (Complete) Create a file named requirements.txt with the following content: Install dependencies: 3. .env file These properties help you to…