NAME

MCP::Server::KnowledgeStore::Store - Postgres store for memories, skills, specs, agents, and projects

VERSION

version 0.001

SYNOPSIS

use MCP::Server::KnowledgeStore::Store;

my $store = MCP::Server::KnowledgeStore::Store->new(
  pg => 'postgresql://mcp_ks@localhost/mcp_ks'
);
$store->migrate;

my $memory = $store->save(
  memory => 'deployment-notes',
  "---\ndescription: Deployment notes\n---\n\nUse the release pipeline.\n",
  author => 'release-agent'
);

my $hits = $store->search(memory => 'release pipeline');

DESCRIPTION

This is the PostgreSQL persistence layer used by MCP::Server::KnowledgeStore. Memories, skills, and specs are revisioned. Agent definitions and projects have their own records, and entries can be associated with projects.

Constructing a store configures its migrations without running them. Call "migrate" explicitly when the application is responsible for schema management.

METHODS

migrate

Runs pending wdms_mcp migrations and returns the store.

db

Returns a Mojo::Pg::Database connection.

save / get / list / list_recent / history

Create revisions and read revisioned memories, skills, and specs. The first argument is the entry kind: memory, skill, or spec.

my $hits = $store->search($kind, $query, $project, $limit);

Selects candidates with PostgreSQL full-text search and ranks them with TF-IDF corpus vectors.

tag / untag

Associate a memory or skill with a project. A spec's single project is set when the spec is saved.

archive / restore / purge

Manage the lifecycle of revisioned entries. Archiving is reversible. Purging permanently removes the entry and its revision history.

list_projects / get_project / create_project / update_project / delete_project

Manage project records.

list_agents / get_agent / save_agent / delete_agent / tag_agent / untag_agent

Manage agent definitions and their project associations.

create_token / list_tokens / verify_token / revoke_token

Manage the named bearer tokens accepted by the MCP application.

AUTHOR

Wesley Schwengle <waterkip@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2026 by Wesley Schwengle.

This is free software, licensed under:

The (three-clause) BSD License