Skip to content

Beginner-friendly LangChain tutorial with Python,Golang examples for building AI agents, chatbots, and LLM-powered apps.

Notifications You must be signed in to change notification settings

vinodnextcoder/langchain-tutorials

Repository files navigation

Here is a clean, ready-to-copy README.md for your project:

# πŸ€– Simple AI Chatbot using LangChain + OpenRouter (Python)

This is a basic Python project that shows how to use **LangChain** with **OpenRouter** to create a simple AI assistant.  
The AI answers questions in **easy, simple words**, making it perfect for beginners learning AI integration.

---

## βœ… Features

- Uses **LangChain** for AI interaction  
- Uses **OpenRouter API** (free model supported)  
- Takes a question and prints the AI reply in the terminal  
- Beginner-friendly and easy to understand  

---

## πŸ§‘β€πŸ’» Requirements

Make sure you have:

- Python **3.9+** installed  
- An **OpenRouter API Key**

---

## πŸ“¦ Install Required Libraries

Run this command in your terminal:

```bash
pip install langchain langchain-openai python-dotenv

πŸ” Setup Environment Variable

  1. Create a file named .env in your project folder
  2. Add your OpenRouter API key inside it:
OPENROUTER_API_KEY=your_api_key_here

⚠️ Never share your API key publicly.


▢️ How to Run the Project

Run the following command in your terminal:

python createagent.py

You will see the AI response printed in the terminal.


🧠 Example Question Used

user_question = "What is artificial intelligence in simple terms?"

βœ… Example Output

Artificial intelligence is when computers are taught to think and learn like humans to do tasks such as answering questions, recognizing images, or making decisions.

πŸ“ Project Structure

langchain-tutorials/
β”‚
└──.env
└── python_langchian_example/
    β”‚
    β”œβ”€β”€ createagent.py
    └── README.md


🎯 Who Is This For?

  • Beginners learning LangChain
  • Students exploring AI integration
  • Developers testing OpenRouter with Python

πŸ“œ License

This project is free to use for learning and educational purposes.


---

If you want, I can also:
- Add **badges (Python, LangChain, OpenRouter)**  
- Add a **"Troubleshooting" section**
- Add a **"Future Improvements" section**
- Customize it for **GitHub portfolio presentation**

Just tell me βœ…

About

Beginner-friendly LangChain tutorial with Python,Golang examples for building AI agents, chatbots, and LLM-powered apps.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published