C# version of the Meal Planner Chatbot demo shown in the CodeMash presentation.
It uses the .NET version of LangChain to integrate with the OpenAI API and uses Postgres as the Vector Store to do RAG (retrieval augmented generation).
There are some differences from the Python version.
- There's no 'CSV Loader' in the LangChain .NET. Instead, I created a loader that is specific to loading the recipes CSV file. I did not try to generalize this to load any CSV file.
- This doesn't use the memory feature (aka chat history).
Ref: https://github.com/ai-ml-workshops/meal-planner-chatbot
Prereqs:
- Visual Studio 2022 and .NET 8
- OpenAI API Key
- Install Postgres w/ the PGVector extension. (I'd suggest running it in a Docker container).
Refer to https://github.com/ai-ml-workshops/SystemPrereqs/blob/main/2025-CodeMash.md for setting those things up.
Steps:
- Clone this repo
- Stick your OpenAI API key in an environment variable named OPENAI_API_KEY
- Stick your Postgres connection string in an environment variable named PGVECTOR_CONNECTION_STRING
Example: "Host=localhost:5440;Username=postgres;Password=yourpassword;Database=meal_planner"
- Build. This will load the two dependencies - LangChain and CsvHelper
- Run
- Ask: "3 meals with chicken". If everything is working, it will output the recipes.