A fun interactive LangGraph-powered Joke Bot that generates, critiques, and saves developer-themed jokes with embeddings stored in Pinecone.
It supports multiple joke categories, languages, and persistence so you can browse previously saved jokes.
- Generate short, developer-themed jokes (Dad Developer, Chuck Norris Developer, or General).
- Human-in-the-loop approval: approve or reject jokes before saving.
- Multilingual joke generation (supports
cs, de, en, es, eu, fr, gl, hu, it, lt, pl, ru, sv). - Joke embeddings created using VoyageAI (
voyage-3.5). - Persistent joke storage using:
- Pinecone (vector search for duplicate detection).
- JSON catalog (local browsing).
- Interactive CLI menu:
- [n] Generate new joke
- [c] Change category
- [l] Change language
- [r] Reset joke history
- [b] Browse saved jokes
- [q] Quit
│── bot/
│── config/ # Config files for prompts & settings
│── .env # Environment variables
│── errors.md # Debugging logs
│── graph.mmd # Graph visualization (Mermaid)
│── jokes_catalog.json # Saved jokes catalog
│── llm.py # LLM setup (Groq API)
│── main.py # Entry point (build & run graph)
│── paths.py # File path helpers
│── persistence.py # Pinecone + JSON persistence
│── requirements.txt # Python dependencies
│── utils.py # Config utilities
class JokeState(BaseModel):
jokes: Annotated[List[Joke], add] = []
jokes_choice: Literal["n", "c", "l", "r", "q"] = "n"
joke_embeddings: List[List[float]] = []
category: str = "general"
language: str = "en"
latest_jokes: str = ""
approved_status: bool = False
retry_count: int = 0
quit: bool = Falsegit clone https://github.com/EbenTheGreat/wittyAI.gitexport PINECONE_API_KEY="your-key"
export VOYAGE_API_KEY="your-key"pip install -r requirements.txt
Create a .env file in the project root:
VOYAGE_API_KEY=your_voyage_api_key
GROQ_API_KEY=your_groq_api_key
PINECONE_API_KEY=your_pinecone_api_key
PINECONE_INDEX_NAME=jokes-index
PINECONE_ENVIRONMENT=us-east-1
python main.pyThe joke bot workflow is built with LangGraph. You can export the graph as a Mermaid diagram:
graph = build_joke_graph()
with open("graph.mmd", "w") as f:
f.write(graph.get_graph().draw_mermaid())Then preview the diagram with Mermaid Live Editor .
Approved jokes are saved in: Pinecone: for embeddings + duplicate detection.
jokes_catalog.json: for local browsing.
Example entry:
{
"id": "8c7fb7b4-814c-4e56-aa9f-17a04310545b",
"text": "Why do developers name their functions with unnecessary abbreviations? Because they're trying to branch out but end up forking their own sanity.",
"category": "general",
"timestamp": "2025-10-04T13:33:52.076282"
}-
Add automated LLM critic alongside human critic.
-
Build a web frontend with Streamlit or FastAPI.
-
Add more categories (AI, DevOps, Security).
-
Implement joke search powered by Pinecone.