IndexThinking.SDK
0.16.0
dotnet add package IndexThinking.SDK --version 0.16.0
NuGet\Install-Package IndexThinking.SDK -Version 0.16.0
<PackageReference Include="IndexThinking.SDK" Version="0.16.0" />
<PackageVersion Include="IndexThinking.SDK" Version="0.16.0" />
<PackageReference Include="IndexThinking.SDK" />
paket add IndexThinking.SDK --version 0.16.0
#r "nuget: IndexThinking.SDK, 0.16.0"
#:package IndexThinking.SDK@0.16.0
#addin nuget:?package=IndexThinking.SDK&version=0.16.0
#tool nuget:?package=IndexThinking.SDK&version=0.16.0
IndexThinking
Working Memory Manager for Reasoning-capable LLMs
What It Does
IndexThinking handles the repetitive-but-hard parts of LLM integration:
- Truncation Recovery - Auto-continue when responses hit token limits
- Reasoning Extraction - Unified API for provider-specific thinking formats
- Context Tracking - Session-aware conversation with sliding window
- Token Management - Budget tracking and complexity estimation
- Content Recovery - Repair truncated JSON/code blocks
Scope
IndexThinking manages a single LLM turn, not multi-step workflows.
| IndexThinking | Agent Orchestrators |
|---|---|
| Single turn optimization | Multi-step coordination |
| Building block | Workflow controller |
| Used BY orchestrators | Uses IndexThinking |
Quick Start
dotnet add package IndexThinking
// Register services
services.AddIndexThinkingAgents();
services.AddIndexThinkingContext();
// Wrap any IChatClient
var client = new ChatClientBuilder(innerClient)
.UseIndexThinking()
.Build(serviceProvider);
// Use normally
var response = await client.GetResponseAsync(messages);
// Access metadata
var thinking = response.GetThinkingContent();
var metrics = response.GetTurnMetrics();
Session-Aware Chat
// Context is automatically tracked and injected
var response = await client.ChatAsync("session-123", "Do that again");
Streaming with Thinking Orchestration
Streaming uses a Collect-and-Yield pattern: chunks are yielded to the caller immediately while buffered internally. After the stream completes, the buffered response is processed through the full orchestration pipeline (reasoning parsing, budget tracking, context tracking).
await foreach (var update in client.GetStreamingResponseAsync(messages))
{
// Real-time chunks arrive here
Console.Write(update.Text);
// The final update contains orchestration metadata
if (update.AdditionalProperties?.ContainsKey(ThinkingChatClient.TurnResultKey) == true)
{
var result = update.AdditionalProperties[ThinkingChatClient.TurnResultKey] as TurnResult;
Console.WriteLine($"\nTokens: {result?.Metrics.TotalTokens}");
}
}
Supported Providers
| Provider | Reasoning Format | Truncation Handling | Requires Activation |
|---|---|---|---|
| OpenAI | reasoning field |
length, content_filter |
No (automatic) |
| Anthropic | thinking blocks |
max_tokens, refusal |
No (automatic) |
| Google Gemini | thoughtSignature |
MAX_TOKENS, SAFETY |
No (automatic) |
| DeepSeek/Qwen | <think> tags |
OpenAI-compatible | Yes (EnableReasoning) |
| vLLM/GPUStack | Configurable tags | length |
Yes (EnableReasoning) |
Enabling Reasoning for DeepSeek/vLLM/Qwen
Some providers require explicit reasoning activation:
var options = new ThinkingChatClientOptions
{
EnableReasoning = true // Adds include_reasoning: true to requests
};
var client = new ChatClientBuilder(innerClient)
.UseIndexThinking(options)
.Build(serviceProvider);
Documentation
License
MIT License - See LICENSE for details.
| Product | Versions 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. |
-
net10.0
- IndexThinking (>= 0.16.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.