Skip to content

Dominionai/langchain-groq-restaurant-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

68 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฝ๏ธ LangChain Groq Restaurant Agent

AI that names your restaurant, builds your menu, and thinks for itself

Python LangChain Groq Streamlit License Status


๐Ÿง  What Is This?

This project combines two things - a working AI web app and a deep dive into LangChain agents.

Pick a cuisine. The AI names your restaurant, then builds a full menu for it powered by LLaMA 3.3 70B running on Groq, chained together using LangChain LCEL pipelines.

Beyond the app, langchain_groq.ipynb goes further building an autonomous agent that can search the web, look up Wikipedia, solve maths, and hold a conversation with memory.


๐Ÿš€ The App โ€” Restaurant Name Generator

Select a cuisine โ†’ get a restaurant name โ†’ get a full menu. Instantly.

Cuisine Generated Name (example) Menu Style
๐Ÿ‡ณ๐Ÿ‡ฌ Nigerian Naija Royale Jollof, Egusi, Suya Platter
๐Ÿ‡ฎ๐Ÿ‡น Italian La Bella Cucina Pasta, Risotto, Tiramisu
๐Ÿ‡ฒ๐Ÿ‡ฝ Mexican Casa del Sol Tacos, Guac, Churros
๐Ÿ‡ธ๐Ÿ‡ฆ Arabic Al Majlis Shawarma, Hummus, Baklava
๐Ÿ‡บ๐Ÿ‡ธ American The Liberty Grill Burgers, Ribs, Cheesecake

How it works under the hood:

User picks cuisine
      โ†“
Chain 1 โ†’ "Suggest a fancy restaurant name for {cuisine} food"
      โ†“
Chain 2 โ†’ "Suggest menu items for {restaurant_name}"
      โ†“
Streamlit displays results

Two prompts. Two chains. One clean output. That's LCEL sequential chaining.


๐Ÿค– The Agent โ€” langchain_groq.ipynb

A standalone LangChain agent built from scratch that can:

  • ๐Ÿ” Search the web via Google (Serper API)
  • ๐Ÿ“– Look up Wikipedia for factual answers
  • ๐Ÿงฎ Solve calculations with a built-in calculator tool
  • ๐Ÿง  Remember conversations using buffer and window memory

The agent doesn't just answer, it thinks:

Question โ†’ Thought โ†’ Action โ†’ Observation โ†’ Final Answer

This is the ReAct reasoning pattern that powers modern AI assistants.


๐Ÿ› ๏ธ Tech Stack

Tool Purpose
๐Ÿฆœ LangChain Chains, agents, memory, prompt templates
โšก Groq Blazing fast LLM inference
๐Ÿค– LLaMA 3.3 70B The brain behind every response
๐Ÿ–ฅ๏ธ Streamlit Web interface
๐Ÿ Python 3.10 Core language

๐Ÿ“ Project Structure

langchain-groq-restaurant-agent/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ RestaurantNameGenerator/
โ”‚   โ”œโ”€โ”€ main.py               # Streamlit UI
โ”‚   โ”œโ”€โ”€ langchain_helper.py   # LCEL chain logic
โ”‚   โ””โ”€โ”€ secret_key.py         # Your API keys go here
โ”‚
โ”œโ”€โ”€ ๐Ÿ““ langchain_groq.ipynb   # Agent + memory implementation
โ”œโ”€โ”€ ๐Ÿ“„ requirement.txt
โ”œโ”€โ”€ ๐Ÿ“„ secret_key.py          # Root-level keys for the notebook
โ””โ”€โ”€ ๐Ÿ“„ README.md

What was removed in this project because of streamlit hosting

1. In main.py

  • Removed - import langchain.py

2. In langchain.py

  • Removed - from langchain_groq import ChatGroq
  • Converted CORRECT_PASSWORD = "your password" # Hardcoded in code to CORRECT_PASSWORD = st.secrets["APP_PASSWORD"] # Instead of hardcoded

โš™๏ธ Setup & Run

1. Clone the repo

git clone https://github.com/Dominionai/langchain-groq-restaurant-agent.git
cd langchain-groq-restaurant-agent

2. Create a virtual environment

python -m venv ai_env

# Windows
ai_env\Scripts\activate

# Mac / Linux
source ai_env/bin/activate

3. Install dependencies

pip install -r requirement.txt

4. Add your API keys & password

Fill in secret_key.py:

groq_api_key = ""       # โ†’ console.groq.com (free)
serper_api_key = ""     # โ†’ serper.dev (free tier)
APP_PASSWORD = ""       # โ†’ add your password

5. Run the app

cd RestaurantNameGenerator
streamlit run main.py

๐Ÿ’ก Core Concepts Implemented

Concept Where
PromptTemplate + LCEL pipe | operator langchain_helper.py
Sequential chaining (output โ†’ next input) langchain_helper.py
StrOutputParser langchain_helper.py
Tool-calling agent (Search, Wikipedia, Calculator) langchain_groq.ipynb
ReAct reasoning loop langchain_groq.ipynb
ConversationBufferMemory langchain_groq.ipynb
ConversationBufferWindowMemory langchain_groq.ipynb

๐Ÿ”ฎ Coming Next

  • Deploy to Streamlit Cloud (live demo link)
  • Add custom cuisine input by the user
  • RAG project - chat with your own documents
  • Multi-agent system with LangGraph

๐Ÿ‘ค Author

Egwuatu Chibuike Dominion AI Engineer | Nnamdi Azikiwe University

Email


โญ If this was useful or interesting, a star means a lot โ€” thank you!

About

AI-powered restaurant name & menu generator using LangChain LCEL chains + Groq LLaMA 3.3 70B. Features a Streamlit web app and a tool-calling agent with web search, Wikipedia, and conversation memory.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors