Get Started with SmartRAG
Install and configure SmartRAG in your .NET application in just a few minutes
Installation
SmartRAG is available as a NuGet package. Choose your preferred installation method:
.NET CLI
Package Manager
Package Reference
dotnet add package SmartRAG
Install-Package SmartRAG
<PackageReference Include="SmartRAG" Version="1.1.0" />
Basic Configuration
Configure SmartRAG in your Program.cs
or Startup.cs
:
// Program.cs
using SmartRAG;
var builder = WebApplication.CreateBuilder(args);
// Add SmartRAG services
builder.Services.AddSmartRAG(options =>
{
options.AIProvider = AIProvider.Anthropic;
options.StorageProvider = StorageProvider.Qdrant;
options.ApiKey = "your-api-key";
});
var app = builder.Build();
Quick Example
Here's a simple example to get you started:
// Inject the document service
public class DocumentController : ControllerBase
{
private readonly IDocumentService _documentService;
public DocumentController(IDocumentService documentService)
{
_documentService = documentService;
}
[HttpPost("upload")]
public async Task<IActionResult> UploadDocument(IFormFile file)
{
var document = await _documentService.UploadDocumentAsync(file);
return Ok(document);
}
[HttpPost("search")]
public async Task<IActionResult> Search([FromBody] string query)
{
var results = await _documentService.SearchAsync(query);
return Ok(results);
}
}
Need Help?
If you encounter any issues or need assistance: