Building My First Very Basic AI Chatbot with LangGraph. Added React Frontend And FastAPI Backend

Building My First Very Basic AI Chatbot with LangGraph. Added React Frontend And FastAPI Backend

I just finished building my very first AI chatbot, and I’m super excited to share it with you all. It took me a while to figure everything out, but seeing it work in the end was totally worth it!

🚀 You can try it here: My Chatbot

What I Actually Built

So basically, I created a chatbot that you can talk to just like ChatGPT. It has a nice chat interface where you type messages and the AI responds back.

Here’s what it looks like:

  • Clean chat bubbles (blue for you, gray for AI)
  • Real-time responses
  • Works on both desktop and mobile
  • Shows when the AI is “thinking”

The Tools I Used

I’m still learning, so I tried to pick tools that wouldn’t be too overwhelming:

For the backend:

  • Python with FastAPI (for the server)
  • LangGraph (to organize the AI workflow)
  • Groq API (this gives me access to the LLaMA-3 AI model)

For the frontend:

  • React (for the website)
  • Some CSS styling to make it look good

For hosting:

  • Render (for the backend server)
  • Vercel (for the website)

How It Actually Works

It’s pretty simple when you break it down:

  1. You type a message on the website
  2. The website sends it to my server
  3. My server asks the AI model for a response
  4. The AI sends back an answer
  5. My server sends it back to the website
  6. You see the response!

The whole thing happens in just a couple of seconds.

Features

I added a limit so people can’t spam my chatbot (15 messages per minute). I learned this from the Claude AI to add this.😅

If something goes wrong, instead of the app crashing, it shows a nice “Sorry, something went wrong” message. Much better than a blank screen!

When the AI is thinking, it shows “AI is thinking…” so you know it’s working and not just frozen.

The chat automatically scrolls down when new messages come in, just like WhatsApp or any other chat app.

At first, the chat looked great on my laptop but terrible on my phone. After making it responsive, it now works perfectly everywhere!

I spent extra time making the UI look clean and modern. The chat bubbles, colors, and animations make it feel like a real app, not just a coding exercise.

Response times are quick, and I haven’t had any crashes since deploying. The error handling I added really helps keep things stable.

It’s not just running on my computer — it’s live on the internet and anyone can try it. That feels pretty amazing!

After Deploying

Since I deployed it:

  • Response time: Usually 2–3 seconds
  • Uptime: Haven’t had any major outages
  • Mobile friendly: Works on phones and tablets

What’s Next?

I have some ideas for making it even better:

  1. Remember conversations — Right now it forgets everything after each message
  2. Multiple AI models — Maybe let users choose between different AI personalities
  3. File uploads — Let people upload documents and ask questions about them
  4. Better design — Always room for improvement!
  5. User accounts — So people can save their chat history

The Code

If you’re curious about how I built it, everything is open source:

Feel free to check it out, copy it, or suggest improvements!

What I Learned

Building this project taught me so much:

  • APIs aren’t that scary — Once you understand the basics, they’re just ways for different parts of your app to talk to each other
  • Error handling is super important — Users will do things you never expected, so always plan for things to go wrong
  • UI/UX matters a lot — A good-looking app feels more trustworthy and professional
  • Testing is crucial — I found so many bugs just by using the app myself on different devices
  • Deployment is an art — Getting everything working locally is one thing, making it work on the internet is another!

Try It Yourself!

I’d love for you to try my chatbot and let me know what you think:

🔗 Chat with my AI here

Ask it anything — about coding, general questions, or just have a casual conversation. It’s pretty smart!

Final Thoughts

This was my first real full-stack project with AI, and I’m really happy with how it turned out. Sure, it’s not as fancy as ChatGPT, but it’s mine and it works!

If you’re thinking about building something similar, just start! I learned way more by actually building than I ever did from just reading tutorials.

Thanks for reading, and I hope you enjoy chatting with my AI! 🤖

P.S. If you find any bugs or have suggestions, feel free to reach out. I’m always looking to improve!

Thanks for reading!
— Ranjan

Leave a Comment

Your email address will not be published. Required fields are marked *