NLWebNet 0.1.0-alpha.5
dotnet add package NLWebNet --version 0.1.0-alpha.5
NuGet\Install-Package NLWebNet -Version 0.1.0-alpha.5
<PackageReference Include="NLWebNet" Version="0.1.0-alpha.5" />
<PackageVersion Include="NLWebNet" Version="0.1.0-alpha.5" />
<PackageReference Include="NLWebNet" />
paket add NLWebNet --version 0.1.0-alpha.5
#r "nuget: NLWebNet, 0.1.0-alpha.5"
#:package NLWebNet@0.1.0-alpha.5
#addin nuget:?package=NLWebNet&version=0.1.0-alpha.5&prerelease
#tool nuget:?package=NLWebNet&version=0.1.0-alpha.5&prerelease
NLWebNet
A .NET implementation of the NLWeb protocol for building natural language web interfaces. This project provides both a reusable library and a demo application showcasing the NLWeb standard.
โ ๏ธ PROOF OF CONCEPT - NOT PRODUCTION READY
This is an experimental implementation created for testing and evaluation purposes only. While functional, this library is not intended for production use and should be considered a proof of concept to demonstrate NLWeb protocol capabilities in .NET environments.
Use cases:
- ๐งช Protocol evaluation and experimentation
- ๐ Learning and understanding NLWeb concepts
- ๐ฌ Research and development prototyping
- ๐ฏ Testing integration patterns with AI services
Not recommended for:
- โ Production applications
- โ Critical business systems
- โ Public-facing services
- โ Applications requiring enterprise support
๐ Overview
NLWeb is a protocol for creating conversational interfaces to web content and data. It enables natural language querying with three main modes:
- List: Returns ranked search results
- Summarize: Provides AI-generated summaries with supporting results
- Generate: Full RAG (Retrieval-Augmented Generation) responses
This implementation follows the official NLWeb specification and includes Model Context Protocol (MCP) support for enhanced AI integration.
๐๏ธ Repository Structure
NLWebNet/
โโโ src/NLWebNet/ # ๐ฆ Core library (published NuGet package)
โ โโโ Models/ # Request/response data models
โ โโโ Services/ # Business logic interfaces and implementations
โ โโโ Endpoints/ # Minimal API endpoints (/ask, /mcp)
โ โโโ MCP/ # Model Context Protocol integration
โ โโโ Extensions/ # DI and middleware extensions
โ โโโ Middleware/ # Request processing middleware
โโโ samples/ # ๐ฏ Sample applications and usage examples
โ โโโ Demo/ # ๐ฎ .NET 9 Blazor Web App demo application
โ โโโ AspireHost/ # ๐๏ธ .NET Aspire orchestration host
โโโ doc/ # ๏ฟฝ Documentation and setup guides
โ โโโ demo-setup-guide.md # ๐ง Complete AI integration setup guide
โ โโโ manual-testing-guide.md # ๐งช API testing instructions
โ โโโ todo.md # ๐ Implementation status and roadmap
โโโ tests/ # ๐งช Unit and integration tests
โ โโโ NLWebNet.Tests/ # ๐ MSTest test project (39 tests)
โโโ helm/ # โ๏ธ Helm charts for Kubernetes
โโโ k8s/ # โ๏ธ Kubernetes manifests
โโโ deploy/ # ๐ Azure deployment templates
โโโ scripts/ # ๏ฟฝ๏ธ Build and deployment scripts
๐ NLWeb Protocol Flow
sequenceDiagram
participant Client
participant NLWebNet
participant DataBackend
participant LLM as AI Service
Client->>NLWebNet: POST /ask
Note over Client,NLWebNet: query, mode, site, streaming, etc.
NLWebNet->>NLWebNet: Generate query_id (if not provided)
NLWebNet->>NLWebNet: Process/decontextualize query
alt mode = "list"
NLWebNet->>DataBackend: Search query
DataBackend-->>NLWebNet: Ranked results
else mode = "summarize"
NLWebNet->>DataBackend: Search query
DataBackend-->>NLWebNet: Ranked results
NLWebNet->>LLM: Generate summary
LLM-->>NLWebNet: Summary text
else mode = "generate"
NLWebNet->>DataBackend: Search query
DataBackend-->>NLWebNet: Context documents
NLWebNet->>LLM: Generate RAG response
LLM-->>NLWebNet: Generated response
end
NLWebNet-->>Client: JSON response with results
Note over Client,NLWebNet: query_id, results[], summary?, etc.
๐ฏ API Endpoints
/ask
- Primary NLWeb Endpoint
Natural language query interface supporting all NLWeb protocol features.
Required Parameters:
query
- Natural language query string
Optional Parameters:
site
- Target site/domain subsetprev
- Comma-separated previous queries for contextdecontextualized_query
- Pre-processed query (skips decontextualization)streaming
- Enable streaming responses (default: true)query_id
- Custom query identifier (auto-generated if not provided)mode
- Query mode:list
(default),summarize
, orgenerate
/mcp
- Model Context Protocol Endpoint
MCP-compatible interface with additional methods:
list_tools
- Available toolslist_prompts
- Available promptscall_tool
- Execute toolsget_prompt
- Retrieve prompt templates
๐๏ธ Architecture Overview
graph TB
subgraph "NLWebNet Library"
API[Minimal APIs<br>/ask, /mcp]
MW[Middleware<br>Pipeline]
EXT[Extensions<br>DI & Config]
SVC[Business Logic<br>Services]
MCP[MCP Integration]
MODELS[Data Models]
end
subgraph "Demo Application"
BLAZOR[.NET 9 Blazor Web App UI]
DEMO[Modern Blazor Components]
end
subgraph "External Services"
AI[AI/LLM Service<br>Azure OpenAI, etc.]
DATA[Data Backend<br>Search Index, DB, etc.]
end
CLIENT[HTTP Clients<br>Web, Mobile, etc.] --> API
BLAZOR --> API
API --> MW
MW --> SVC
SVC --> MCP
SVC --> AI
SVC --> DATA
DEMO --> BLAZOR
classDef library fill:#e1f5fe
classDef demo fill:#f3e5f5
classDef external fill:#fff3e0
class API,MW,SVC,MCP,MODELS library
class BLAZOR,DEMO demo
class AI,DATA external
๐ Quick Start
๐ Note: This library is provided for testing and evaluation purposes only. This is alpha-quality software that may contain bugs or incomplete features. Please review the development status section before integrating into any project.
Using the Library in Your Project
- Add the NLWebNet library to your ASP.NET Core project:
// Program.cs
using NLWebNet;
// Add NLWebNet services
builder.Services.AddNLWebNet(options =>
{
// Configure options
options.DefaultMode = NLWebNet.Models.QueryMode.List;
options.EnableStreaming = true;
});
// Later in the pipeline configuration
app.UseNLWebNet(); // Add NLWebNet middleware (optional)
app.MapNLWebNet(); // Map NLWebNet minimal API endpoints
Prerequisites
- .NET 9.0 SDK
- Visual Studio 2022 or VS Code
Running the Demo
Clone the repository
git clone https://github.com/jongalloway/NLWebNet.git cd NLWebNet
Build the solution
dotnet build
Run the demo application
cd samples/Demo dotnet run
Open your browser
- Demo UI:
http://localhost:5037
- OpenAPI Spec:
http://localhost:5037/openapi/v1.json
- Demo UI:
Test the demo features
- Home Page: Overview and navigation to demo features
- Interactive Demo (
/nlweb
): UI for testing NLWeb queries with enhanced data source visualization- Smart Data Source Management: Automatic routing between RSS feeds (.NET content), Schema.org static data (science fiction), and mock placeholders
- Visual Data Source Indicators: Top-level Bootstrap cards showing which sources are active
- User Guidance Prompts: Contextual examples of what content is available to search
- Query input with natural language questions: Try ".NET 9 features" for RSS data or "space movies" for sci-fi content
- Mode selection: List, Summarize, Generate modes with streaming support
- Color-coded result badges: Each result shows its source (RSS/Schema.org/Mock) with visual indicators
- HTML tag removal: Clean display of RSS feed content
- API testing interface: Direct endpoint testing with request/response inspection
- API Documentation: OpenAPI specification for
/ask
and/mcp
endpoints
๐ง Real AI Integration: The demo uses mock responses by default. For actual AI-powered responses, see the Complete Setup Guide for Azure OpenAI and OpenAI API integration.
Using the Library
โ ๏ธ Alpha software - for evaluation and testing only
Install the NuGet package:
dotnet add package NLWebNet
Or via Package Manager Console:
Install-Package NLWebNet
Configure in your ASP.NET Core application:
// Program.cs
using NLWebNet;
builder.Services.AddNLWebNet(options =>
{
options.DefaultMode = QueryMode.List;
options.EnableStreaming = true;
});
app.MapNLWebNet();
Testing NLWeb Features
The demo application at http://localhost:5037
provides testing of core NLWeb protocol features:
Interactive Demo Pages:
- Home Page (
/
): Project overview and navigation to demo features - NLWeb Demo (
/nlweb
): Interactive query interface with tabbed sections:- Query Tab: Interactive form with all NLWeb parameters (query, mode, site, etc.)
- Streaming Tab: Real-time streaming response demonstration
- API Test Tab: Raw HTTP request/response testing
- API Test (
/api-test
): API testing interface with request configuration - MCP Demo (
/mcp-demo
): Model Context Protocol demonstration with tools and prompts
Query Modes Supported:
- List Mode: Returns ranked search results with relevance scoring
- Summarize Mode: AI-generated summaries with supporting results
- Generate Mode: Full RAG responses with context-aware answers
- Streaming: Real-time response delivery with Server-Sent Events
API Testing:
- Direct HTTP calls to
/ask
endpoint with various parameters - MCP protocol testing via
/mcp
endpoint with tool and prompt support - OpenAPI specification available at
/openapi/v1.json
- Manual testing guides in
/doc/manual-testing-guide.md
Example API Usage:
# List mode query
curl -X GET "http://localhost:5037/ask?query=find+recent+updates&mode=list"
# POST request with full parameters
curl -X POST "http://localhost:5037/ask" \
-H "Content-Type: application/json" \
-d '{"query": "find recent updates", "mode": "list", "site": "docs", "streaming": false}'
# Streaming summarize query
curl -X POST "http://localhost:5037/ask" \
-H "Content-Type: application/json" \
-d '{"query": "what are the main features?", "mode": "summarize", "streaming": true}'
# MCP tool listing
curl -X POST "http://localhost:5037/mcp" \
-H "Content-Type: application/json" \ -d '{"method": "list_tools"}'
๐ง Real AI Integration
The demo application works with mock responses by default, but can be configured for real AI-powered responses using Azure OpenAI or OpenAI API.
Quick Setup
Choose Your AI Provider: Azure OpenAI (recommended) or OpenAI API
Install Provider Package:
cd samples/Demo dotnet add package Microsoft.Extensions.AI.AzureAIInference # For Azure OpenAI # OR dotnet add package Microsoft.Extensions.AI.OpenAI # For OpenAI API
Configure API Keys: Update
samples/Demo/appsettings.json
or use user secretsAdd Service Registration: Update
Program.cs
with AI service registration
Complete Setup Guide
๐ Complete AI Integration Guide - Step-by-step instructions for:
- Azure OpenAI and OpenAI API configuration
- Enhanced data source features and testing scenarios
- Security best practices for API key management
- Service registration and dependency injection
- Troubleshooting common setup issues
- Configuration options
- Production deployment considerations
The guide includes examples, FAQ, troubleshooting, and detailed documentation of the enhanced data source visualization features.
โ๏ธ Configuration
NLWebNet uses standard ASP.NET Core configuration patterns for managing settings and external service credentials.
Non-Secret Configuration (appsettings.json)
Configure basic NLWebNet settings in your appsettings.json
:
{
"NLWebNet": {
"DefaultMode": "List",
"EnableStreaming": true,
"DefaultTimeoutSeconds": 30,
"MaxResultsPerQuery": 50
},
"Logging": {
"LogLevel": {
"Default": "Information",
"NLWebNet": "Debug"
}
}
}
Secret Configuration (User Secrets)
For sensitive data like API keys, use ASP.NET Core User Secrets in development:
Initialize user secrets for your project:
dotnet user-secrets init
Set AI service credentials (example for Azure OpenAI):
dotnet user-secrets set "AzureOpenAI:ApiKey" "your-api-key-here" dotnet user-secrets set "AzureOpenAI:Endpoint" "https://your-resource.openai.azure.com/" dotnet user-secrets set "AzureOpenAI:DeploymentName" "gpt-4"
Set data backend credentials (example for Azure Search):
dotnet user-secrets set "AzureSearch:ApiKey" "your-search-api-key" dotnet user-secrets set "AzureSearch:ServiceName" "your-search-service" dotnet user-secrets set "AzureSearch:IndexName" "your-index-name"
Production Configuration
For production deployments, use:
- Azure Key Vault - For secrets in Azure environments
- Environment Variables - For containerized deployments
- Configuration Providers - Custom providers for other cloud platforms
Example environment variables for production:
NLWebNet__DefaultMode=List
NLWebNet__EnableStreaming=true
AzureOpenAI__ApiKey=your-production-api-key
AzureSearch__ApiKey=your-production-search-key
Configuration in Code
Access configuration in your application:
// Program.cs
using NLWebNet;
builder.Services.AddNLWebNet(options =>
{
// Bind from configuration
builder.Configuration.GetSection("NLWebNet").Bind(options);
});
// Configure AI services
builder.Services.Configure<AzureOpenAIOptions>(
builder.Configuration.GetSection("AzureOpenAI"));
// Configure data backend
builder.Services.Configure<AzureSearchOptions>(
builder.Configuration.GetSection("AzureSearch"));
๐ Deployment
NLWebNet supports multiple deployment options for different environments:
๐ณ Docker Deployment
# Quick start with Docker Compose
git clone https://github.com/jongalloway/NLWebNet.git
cd NLWebNet
cd deployment/docker && docker-compose up --build
โ๏ธ Azure Cloud Deployment
# Deploy to Azure Container Apps
./deployment/scripts/deploy/deploy-azure.sh -g myResourceGroup -t container-apps
# Deploy to Azure App Service
./deployment/scripts/deploy/deploy-azure.sh -g myResourceGroup -t app-service
โ๏ธ Kubernetes Deployment
# Deploy to any Kubernetes cluster
kubectl apply -f deployment/kubernetes/manifests/
๐ฆ Container Registry
Pre-built images available soon. For now, build locally:
./deployment/scripts/deploy/build-docker.sh -t latest
๐ Complete Deployment Guide - Comprehensive instructions for all deployment scenarios.
๐ ๏ธ Development Status
This is an alpha implementation of the NLWeb protocol, provided as an experimental package for testing and evaluation purposes.
โ ๏ธ ALPHA SOFTWARE - EXPERIMENTAL RELEASE
โ Current Implementation Status:
- Core Library: Basic NLWeb protocol implementation with Minimal API endpoints
- Data Models: Essential request/response models with validation and JSON serialization
- Business Logic: Service layer with Microsoft.Extensions.AI integration
- MCP Integration: Basic Model Context Protocol support with tools and prompts
- Demo Application: .NET 9 Blazor Web App with interactive components for testing
- AI Integration: Setup guides for Azure OpenAI and OpenAI API (experimental)
- Testing: Unit tests and manual testing guides (basic coverage)
- Configuration: CORS, AI services, and multi-environment support
- Documentation: API documentation and setup guides (evolving)
- CI/CD: Basic automated build, test, and validation pipeline
- NuGet Package: Alpha prerelease at nuget.org/packages/NLWebNet
๐ฏ Suitable For:
- Protocol evaluation and experimentation
- Learning NLWeb concepts and implementation patterns
- Research and development prototyping
- Testing integration patterns with AI services
- Exploring .NET AI abstractions and Model Context Protocol
โ ๏ธ Alpha Release Limitations:
- Experimental software - may contain bugs or incomplete features
- API surface may change in future releases without notice
- Not recommended for production use - suitable for evaluation and experimentation only
- Limited support - community-driven development with no guarantees
- Performance and reliability not yet optimized for production workloads
- Feature completeness varies - some advanced NLWeb features may be basic implementations
๐ค Contributing
This project follows the NLWeb specification. Contributions are welcome!
- Review the implementation plan
- Check open issues
- Submit pull requests with tests
๐ Related Resources
- NLWeb Official Repository - Specification and reference implementation
- Complete Demo Setup Guide - Step-by-step AI integration instructions
- Model Context Protocol - MCP documentation
- Microsoft.Extensions.AI - .NET AI abstractions
- Manual Testing Guide - API testing with curl examples
๐ License
This project is licensed under the MIT License.
๐ท๏ธ Version
Basic NLWeb protocol implementation with AI integration support for testing and evaluation purposes.
Key Features (Alpha Quality):
- โ Basic NLWeb protocol implementation (/ask, /mcp endpoints)
- โ AI integration support (Azure OpenAI, OpenAI API) - experimental
- โ .NET 9 Blazor demo application for testing
- โ Model Context Protocol (MCP) support - basic implementation
- โ Streaming responses with Server-Sent Events
- โ Documentation and setup guides (evolving)
- โ Alpha NuGet package with working extension methods
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- Microsoft.AspNetCore.OpenApi (>= 9.0.6)
- Microsoft.Extensions.AI (>= 9.6.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 9.0.6)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Options (>= 9.0.6)
- Microsoft.Extensions.ServiceDiscovery (>= 9.3.1)
- ModelContextProtocol (>= 0.3.0-preview.1)
- OpenTelemetry (>= 1.12.0)
- OpenTelemetry.Exporter.Console (>= 1.12.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.12.0)
- OpenTelemetry.Exporter.Prometheus.AspNetCore (>= 1.7.0-rc.1)
- OpenTelemetry.Extensions.Hosting (>= 1.12.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.12.0)
- OpenTelemetry.Instrumentation.Http (>= 1.12.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.12.0)
- System.Diagnostics.DiagnosticSource (>= 9.0.6)
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.1.0-alpha.5 | 112 | 6/24/2025 |
0.1.0-alpha.4 | 82 | 6/21/2025 |
0.1.0-alpha.3 | 40 | 6/21/2025 |
0.1.0-alpha.2 | 56 | 6/20/2025 |
0.1.0-alpha.1 | 52 | 6/20/2025 |
Alpha release 0.1.0-alpha.3: Enhanced NuGet package metadata with copyright notice, repository type, and improved package title for better Package Manager display. Complete NLWeb protocol implementation with Minimal API endpoints (/ask, /mcp), Model Context Protocol integration, streaming support, and comprehensive testing. This is a proof-of-concept prerelease for testing and evaluation purposes only - not recommended for production use.