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
<PackageReference Include="Standard.Agents.Data.Knowledge.Postgres" Version="0.1.0" />
<PackageVersion Include="Standard.Agents.Data.Knowledge.Postgres" Version="0.1.0" />
<PackageReference Include="Standard.Agents.Data.Knowledge.Postgres" />
paket add Standard.Agents.Data.Knowledge.Postgres --version 0.1.0
#r "nuget: Standard.Agents.Data.Knowledge.Postgres, 0.1.0"
#:package Standard.Agents.Data.Knowledge.Postgres@0.1.0
#addin nuget:?package=Standard.Agents.Data.Knowledge.Postgres&version=0.1.0
#tool nuget:?package=Standard.Agents.Data.Knowledge.Postgres&version=0.1.0

Standard.Agents.Data.Knowledge.Postgres
A PostgreSQL knowledge source for The Standard AI Agent Framework.
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 coreStandard.Agentspackage through the sameIKnowledgeBrokerseam, 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 | 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
- Npgsql (>= 8.0.5)
- Standard.Agents (>= 0.8.0)
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 |