This project is a Semantic Kernel Demo built using Microsoft Semantic Kernel, Ollama, and MongoDB Atlas. It integrates semantic search, LLM-based chat completion, and memory storage to provide personalized movie recommendations based on embedded movie descriptions.
- Semantic search using OpenAI embeddings via Ollama
- Chat-based recommendation system using Llama3-Groq
- Memory storage for movie embeddings using VolatileMemoryStore
- Integration with MongoDB Atlas for retrieving and storing movie data
- Custom plugins for embedding text and searching information
- Microsoft Semantic Kernel
- Ollama (Ollama API client for embeddings)
- MongoDB Atlas
- .NET 9
- C#
- Install .NET 9
- Setup a MongoDB Atlas account and get the connection string
- Get Ollama API endpoint details
- Clone the repository:
git clone https://github.com/your-username/your-repo.git cd your-repo - Open the project in Visual Studio or your preferred IDE.
- Update the following environment variables or constants in
Program.cs:- OllamaEndpoint: Your Ollama API endpoint
- MongoDBAtlasConnectionString: Your MongoDB Atlas connection string
- CollectionName: MongoDB collection storing movie data
- Restore dependencies:
dotnet restore
- Build the project:
dotnet build
To start the application, run:
dotnet run- The system will retrieve movie data from MongoDB Atlas.
- It will embed movie descriptions using the Ollama embedding model.
- Users can enter queries in the console to receive movie recommendations.
- Provides semantic search for movies.
- Searches by genre, name, and type.
- Uses Semantic Kernel's
ISemanticTextMemory.
User > Recommend me a sci-fi movie with time travel.
Assistant > You might like "Interstellar". Plot: ...