-
Notifications
You must be signed in to change notification settings - Fork 0
12 Samples samples
LAP-CHRIS\chris edited this page May 19, 2026
·
1 revision
The Community repository includes sample projects to demonstrate common patterns and use cases.
The simplest possible Krnl-AI workflow:
dotnet tool install -g KrnlAI.Cli
krnlai chat --localTry this conversation:
> Remember that this project uses local-first memory.
> What do you remember about this project?
The first prompt writes memory through the embedded kernel. The second prompt retrieves it through the local runtime.
Source: samples/hello-agent/
Demonstrates the pattern for creating custom community tools:
public sealed record TodoInput(string Title);
public sealed class TodoTool
{
public Task<string> ExecuteAsync(TodoInput input, CancellationToken cancellationToken)
{
ArgumentException.ThrowIfNullOrWhiteSpace(input.Title);
return Task.FromResult($"Created todo: {input.Title}");
}
}- Define the tool input schema
- Validate the request before execution
- Run safety checks for actions with side effects
- Return structured output to the agent
Source: samples/custom-tool/
The Python SDK includes several example scripts:
from krnlai import CognitiveAgent
agent = CognitiveAgent()
result = await agent.run("Hello, world!")
print(result.output)A multi-turn customer support agent with memory persistence.
An agent that searches semantic memory and provides research summaries.
Two agents communicating through shared memory.
Connecting the Python SDK to the C# enterprise backend.
Initialize reusable templates via the CLI:
krnlai new agent my-agent # Basic cognitive agent
krnlai new tool my-tool # Custom tool
krnlai new policy my-policy # Policy template
krnlai new cognitive-cycle # Custom cognitive cycleKrnl-AI Community — MIT License