Skip to content
Mike Christensen edited this page Aug 28, 2026 · 6 revisions

Getting started

The quickest introduction uses StaticContext and the sample KPCData.xml. It needs no database and supports the same IKPCContext API used by persistent applications.

Run the maintained sample

The public Samples repository includes a snapshot with 2,707 ingredients, forms and NLP metadata, and 30 recipes:

git clone https://github.com/KitchenPC/Samples.git KitchenPC-Samples
cd KitchenPC-Samples
dotnet run --project Console/Console.csproj

That terminal application parses entries such as 12 bananas, aggregates compatible quantities, and saves the list locally.

Create a small project

dotnet new console --name KitchenPcQuickStart
cd KitchenPcQuickStart
dotnet add package KitchenPC.Core --version 2.0.0

Copy SampleData/KPCData.xml from the Samples repository and add it to the project output:

<ItemGroup>
  <None Include="SampleData/KPCData.xml"
        CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

Initialize a context once, then use the engine:

using KitchenPC.Core;
using KitchenPC.Core.Context;

var dataDirectory = Path.Combine(AppContext.BaseDirectory, "SampleData");
var context = StaticContext.Configure
   .DataDirectory(dataDirectory)
   .Identity(() => AuthIdentity.Anonymous)
   .Create();

context.Initialize();

var parsed = context.ParseIngredientUsage("a dozen eggs");
Console.WriteLine(parsed.Usage);

var results = context.Recipes
   .Search(q => q.Keywords("chocolate"))
   .Results();

foreach (var recipe in results.Briefs)
   Console.WriteLine(recipe.Title);

Check the NLP result type before assuming Usage is populated; see Ingredient parsing and units.

Next steps

The sample snapshot is intentionally small and is not a production ingredient or recipe catalog.

Clone this wiki locally