Artificial Intelligence

My First LLM powered AI assistant with LangChain & OpenAI: A Hands-On Micro Project

With the rapid evolution of Generative AI, building intelligent AI agents has become more accessible than ever. Recently, I developed a simple LLM powered AI assistant using OpenAI’s GPT-4o-mini and LangChain, powered by a minimal Streamlit interface. While the idea is simple, the approach demonstrates how we as developers—especially those coming from traditional enterprise backgrounds—can quickly adopt modern AI tools to build interactive assistants.

What This AI Assistant Does

It’s a lightweight, interactive web-based assistant:

  • Accepts a question as user input
  • Sends it to OpenAI’s GPT-4o-mini model
  • Displays the response via a Streamlit-based web UI

It’s a simple use-case, yet forms the core pattern for many enterprise AI applications—receive input, analyze context, return structured response.

The Tech Stack

  • LangChain: Provides a clean abstraction over LLMs and prompt chaining
  • OpenAI GPT-4o-mini: A powerful and cost-efficient LLM from OpenAI
  • Streamlit: Quickly turns Python scripts into shareable web apps
  • Python: The glue that ties everything together

The Code

You can find the complete code in the GitHub repository.

How to run the code

After activating the virtual environment, I run the following command to launch the Streamlit web app:

streamlit run <name of python file>

What do I get on running the command

A Streamlit-generated page opens up with a heading and a text input box. The text is for user input. To test it, I have asked the following question.

Prompt:Write 5 sentences on the importance of AI in education
Response from the LLM:

AI plays a transformative role in education by personalizing learning experiences for students, catering to their individual needs and learning paces. It enhances the efficiency of administrative tasks, allowing educators to focus more on teaching and less on paperwork. Through adaptive learning platforms, AI can provide real-time feedback, helping students to identify their strengths and weaknesses more effectively. Additionally, AI can facilitate access to educational resources and support for learners in remote and underserved areas, bridging educational gaps. Overall, the integration of AI in education fosters greater engagement and improves learning outcomes for students.

Considering this is a basic program with a simple prompt and limited context, I find the answer quite satisfactory.

Key Concepts Demonstrated

  • Prompt Engineering: We’re using a static but parameterized prompt template to guide the assistant’s behavior.
  • LangChain LLM Wrapper: Abstracts the complexity of directly interacting with OpenAI APIs.
  • Streamlit UI: Turns the code into a usable app in seconds—perfect for quick demos or prototyping AI tools.

Why This Matters

As enterprises race to adopt AI-first strategies, professionals with hands-on knowledge of agentic design, LLM integration, and prompt orchestration are in high demand. This small, yet impactful project demonstrates:

  • Practical knowledge of GenAI tooling
  • Understanding of agentic interaction patterns
  • Ability to design and deploy real-time AI solutions

This gives me the confidence to build a basic LLM powered AI assistant, similar in spirit to ChatGPT. Currently, it doesn’t retain context across questions, so follow-up queries aren’t understood.

Just for Fun

Just for fun, I asked it a few quirky Harry Potter questions. My daughter loved the answers—it made the experiment even more enjoyable!

What’s Next?

This is just the beginning. I am planning to create a new version and :

  • Integrate memory using LangChain’s memory modules
  • Connect external tools and APIs to make it a truly agentic system

Soon I will come up with my next project which will showcase the power of using memory. This will help the assistant retain context across interactions and support more natural, multi-turn conversations. I also plan to explore tool integrations to make the agent truly autonomous and task-oriented. The journey has just begun, and I’m excited to keep learning, experimenting, and sharing what I build with the community.

Sourav Kumar Chatterjee

I’m Sourav Kumar Chatterjee, an AI Project Manager with nearly 21 years of experience in enterprise software development and delivery, backed by a strong technical foundation in Java and Spring Boot–based microservices. Over the years, I’ve worked with global organizations such as Tata Consultancy Services and IBM, progressing from hands-on engineering roles to leading large, cross-functional teams. My current focus is driving Generative AI–led transformation programs, where I combine project management discipline with deep technical understanding. I’m presently working as a Technical Project Manager on an AI transformation initiative that leverages Generative AI and LLM-based solutions to modernize and accelerate enterprise application development, with a strong emphasis on delivery speed, accuracy, and scalability. This blog is a reflection of my learning and hands-on experience in Generative AI, Agentic AI, LLM-powered systems, and their real-world application in enterprise environments. My goal is to make complex AI concepts accessible and actionable for students, engineers, and professionals transitioning into AI-driven roles.

Recent Posts

Why Retrieval-Augmented Generation (RAG) is so important: Core Concepts Explained

Large Language Models (LLMs) have changed how we interact with software. They can write code,…

2 months ago

Deep Learning for Beginners: Unleashing the Future of AI

Introduction: Artificial Intelligence is transforming our world, and at the heart of this revolution lies…

5 months ago

Introduction to Artificial Intelligence

Introduction Imagine a world where computers can not only follow the rules but also learn…

8 months ago

LangChain vs AutoGen: Selecting the Right AI Framework for Building Agentic Systems

The evolution of Large Language Models (LLMs) has brought us to an exciting new frontier—agentic…

8 months ago

What is Machine Learning – Are ML and AI same

Introduction Welcome, learning enthusiasts! Today, we embark on a journey to unravel the captivating world…

8 months ago

What is Generative AI and how does it work?

Generative AI is a subset of Artificial Intelligence (AI) which is capable of creating new…

8 months ago