Skip to content

kesimeg/langchain-examples

Repository files navigation

langchain-examples

This repository contains a set of Jupyter notebooks exploring different approaches to question generation and question answering using large language models (LLMs), retrieval-augmented generation (RAG), and tool-using agents. These are simple (yet fun!) examples with the aim to provide simple code examples.

📁 Notebooks Overview

1. question_generation_with_gemini.ipynb

Goal: Automatically generate multiple-choice questions from textual input.

  • Uses Gemini model for generating questions.
  • Generates questions based on Pokémon descriptions.

2. question_answering_with_RAG.ipynb

Goal: Evaluate question answering performance using RAG vs. a base LLM.

  • Uses Qwen2.5-7B model via vLLM (locally hosted).

  • Compares performance in two scenarios:

    1. Vanilla LLM (no retrieval)
    2. RAG-enabled (retrieval-augmented generation)
  • Demonstrates how adding retrieval improves question answering accuracy

3. question_answering_agent.ipynb

Goal: Create and compare different agent strategies for question answering.

  • Also uses Qwen2.5-7B via vLLM.

  • Evaluates three different setups:

    1. Vanilla LLM
    2. DuckDuckGo Search Agent (uses internet search to retrieve answers)
    3. Custom Tool Agent (queries the Pokémon API as a tool)
  • Showcases how external tools and APIs can extend LLM capabilities.

Requirements:

  • Gemini API needs API key
  • Qwen model, DuckduckGo and Pokémon API are all public and doesn't require any key or registration

About

Example langchain usage notebooks

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors