OKF4net.Agents 0.2.0

dotnet add package OKF4net.Agents --version 0.2.0
                    
NuGet\Install-Package OKF4net.Agents -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OKF4net.Agents" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OKF4net.Agents" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="OKF4net.Agents" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OKF4net.Agents --version 0.2.0
                    
#r "nuget: OKF4net.Agents, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OKF4net.Agents@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OKF4net.Agents&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=OKF4net.Agents&version=0.2.0
                    
Install as a Cake Tool

OKF4net.Agents

Microsoft Agent Framework function tools for Open Knowledge Format (OKF) v0.1 knowledge bundles. This package exposes the operations of the OKF4net library — reading, browsing, searching, writing, indexing and validating OKF bundles — as AIFunction tools that AI agents can call.

It depends on Microsoft.Agents.AI (this is the integration layer; the underlying OKF4net core library remains dependency-free).

Quick start

using Microsoft.Agents.AI;
using Microsoft.Extensions.AI;
using OKF4net.Agents;

var tools = new OkfBundleTools("./my_bundle");

AIAgent agent = chatClient.AsAIAgent(
    instructions: "You manage an OKF knowledge bundle.",
    tools: tools.GetTools());

var response = await agent.RunAsync("Summarize the concepts in this bundle.");

The nine tools

okf_read_concept, okf_browse, okf_graph, okf_search, okf_write_concept, okf_append_log, okf_regenerate_indexes, okf_validate_bundle, okf_changes_since.

All tools return agent-friendly markdown/plain text and never throw for expected errors (unknown ids, invalid paths, malformed input) — the agent receives an explanatory message instead. Write tools validate documents (producer-grade OKF rules) before touching disk, serialize their writes, and rely on the Agent Framework's tool-approval mechanism for gating. Bundle content is treated as untrusted and is never injected as a system message.

OkfContextProvider (an AIContextProvider, registered via ChatClientAgentOptions.AIContextProviders) layers on top of the same OkfBundleTools instance to automatically inject budget-bounded bundle context into each invocation (as a message, never as system instructions). Memory capture into deterministic, per-day memory concepts is off by default (MemoryCaptureMode.Disabled) — no LLM call, no extra tool round-trip — and only happens once a caller explicitly opts in via OkfContextProviderOptions.MemoryCapture = MemoryCaptureMode.Enabled, which writes captured exchanges into the same bundle the agent reads from. Note: the token budget is a soft chars/4 estimate (can be exceeded slightly), its <okf-context> fences are readability markers rather than a security boundary, and same-day memory capture is safe across concurrent sessions within one processOkfBundleTools shares its write lock across every instance pointed at the same canonicalized bundle path via a process-wide registry — but not across separate processes sharing a bundle path, and the reparse-point guard write tools rely on is a best-effort check-then-write, not a guarantee against a concurrent local actor substituting a path component mid-write (see the project README's concurrency caveats for the full scope).

See the project README for the full documentation, and NOTICE/LICENSE.Apache-2.0 for the attribution chain of the underlying OKF implementation.

Licensed LGPL-3.0-or-later.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 0 7/27/2026