PGVector Store Tool icon

PGVector Store Tool

AI Agent tool for knowledge base operations

Lookup (Get by ID)

AI-generated

Summary

Retrieve a specific entry from the PGVector knowledge base by its unique identifier.

Inputs

  • collection (required) — Name of the knowledge base collection (partition value). Scopes the lookup to the correct partition.
  • id (required) — The unique identifier of the entry to retrieve. Provided by the AI.
  • idFormatHint — Example ID format to help the AI understand what IDs look like (e.g., 'doc-123', 'meeting-2024-01-15'). Included in the tool description when configured.
  • includeMetadata — Include metadata tags in the response. When enabled, the response includes a 'Tags: ...' section with the entry's metadata.
  • includeTimestamps — Include created/updated timestamps in the response. When enabled, the response includes 'Created:' and 'Updated:' lines if present.

Output shape

Formatted string. If the entry is found: 'Entry ID: {id}' + ('Content:' + content if content exists) + ('Tags: ' + JSON.stringify(metadata) if includeMetadata and metadata present) + ('Created: ' + createdAt if includeTimestamps and createdAt present) + ('Updated: ' + updatedAt if includeTimestamps and updatedAt present). If no entry found: 'No entry found with ID '{id}'. On error: 'Lookup failed: {error}'.

The underlying query uses the provided collection and maps the id to externalId in the database lookup. The AI must supply the id parameter as it is required. Optional parameters control additional content in the output string.

Examples

Example 1: Successful lookup with metadata and timestamps

includeMetadata=true, includeTimestamps=true, id='doc-123' found in collection 'knowledge' with metadata {'category':'meeting'} and createdAt/updatedAt present

Discussion