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.

One Comment