Standard.Agents.Data.Knowledge.Postgres 0.1.0

dotnet add package Standard.Agents.Data.Knowledge.Postgres --version 0.1.0
                    
NuGet\Install-Package Standard.Agents.Data.Knowledge.Postgres -Version 0.1.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="Standard.Agents.Data.Knowledge.Postgres" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Standard.Agents.Data.Knowledge.Postgres" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Standard.Agents.Data.Knowledge.Postgres" />
                    
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 Standard.Agents.Data.Knowledge.Postgres --version 0.1.0
                    
#r "nuget: Standard.Agents.Data.Knowledge.Postgres, 0.1.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 Standard.Agents.Data.Knowledge.Postgres@0.1.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=Standard.Agents.Data.Knowledge.Postgres&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Standard.Agents.Data.Knowledge.Postgres&version=0.1.0
                    
Install as a Cake Tool

The Standard for Agents

Standard.Agents.Data.Knowledge.Postgres

A PostgreSQL knowledge source for The Standard AI Agent Framework.

Nuget Nuget Core: Standard.Agents License: TSSL


Part of The Standard for Agents. In Agent = Orchestration(Data, Decision, Direction), this package extends the Data nature — it moves knowledge from local files into a PostgreSQL table with real full-text search. It is an optional adapter: it plugs into the core Standard.Agents package through the same IKnowledgeBroker seam, so nothing else about your agent changes.

The core Standard.Agents package ships file-based knowledge and is deliberately dependency-free. This package brings Npgsql so you can ground an agent on a Postgres table instead — and get tokenized full-text search (tsvector) rather than the file default's substring match, for free.

Install

dotnet add package Standard.Agents                          # the core framework
dotnet add package Standard.Agents.Data.Knowledge.Postgres  # this knowledge source

Use

using Standard.Agents;
using Standard.Agents.Data.Knowledge.Postgres;

var agent = new StandardAgent(apiUrl, apiKey, "LLooMA2.0")
    .UseKnowledgePostgres("Host=localhost;Database=agent;Username=app;Password=…");

string answer = await agent.ProcessPromptAsync("What is our refund window?");

That's the only change from file knowledge — one line. Everything else (skills, tools, guardians, memory, streaming) is the core, unchanged. Under the hood the agent calls SelectKnowledgeAsync each turn with the prompt; this broker runs a ranked full-text query and returns the top matches, which are seeded into the agent's observations.

Options

.UseKnowledgePostgres(
    connectionString,
    table: "knowledge_documents",   // optionally schema-qualified, e.g. "kb.documents"
    contentColumn: "content",       // the text column searched and returned
    maxResults: 3,                  // documents injected per turn
    textSearchConfig: "english")    // Postgres text-search configuration

Or construct the broker directly and pass it to the core's .UseKnowledge(...):

.UseKnowledge(new PostgresKnowledgeBroker(connectionString, table: "kb.documents"))

The table

This broker reads an existing table — populating it (your documents, chunked however you like) is your ETL, kept out of the agent. The minimum is one text column:

CREATE TABLE knowledge_documents (
    id      bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    content text NOT NULL
);

-- recommended: a GIN index so full-text search stays fast at scale
CREATE INDEX knowledge_documents_fts
    ON knowledge_documents
    USING GIN (to_tsvector('english', content));

The query the broker runs is, in effect:

SELECT content FROM knowledge_documents
WHERE to_tsvector('english', content) @@ plainto_tsquery('english', $prompt)
ORDER BY ts_rank(to_tsvector('english', content), plainto_tsquery('english', $prompt)) DESC
LIMIT $maxResults;

The prompt is always a bound parameter; the table and column names are your configuration, resolved once at construction.

Where this fits

Core framework Standard.Agents · repo
This package the Data nature — knowledge, backed by PostgreSQL full-text search
Getting started The core how-to
The theory The Tri-Nature of an Agent · SPEC

License

Licensed under the The Standard Software License (TSSL) v1.1 — the same license as Standard.Agents. Npgsql is PostgreSQL-licensed and consumed as a NuGet dependency.

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.1.0 168 7/18/2026