Skip to main content
View plugin source · Plugin ID · Plugin API The prefix plugin brings files from a bucket into Quivr so it can read and index them.
The prefix plugin brings files under a bucket prefix into Quivr to be read and indexed.The prefix plugin brings files under a bucket prefix into Quivr to be read and indexed.

What it does

Collect individual files under a prefix in an S3-compatible bucket. The plugin can also join a photo with a separate metadata document that describes it.

Before you start

  • Have a bucket, its signing region and a prefix (the start of an object key, such as feed/).
  • Deposit an instance credential with access_key_id and secret_access_key. Include session_token for temporary credentials. Give it permission to list the prefix and read its objects. The plugin does not read ambient AWS credentials.
  • Choose a collection (a Corpus in the API) and make sure Quivr can read the file formats you want to collect. Use an API key with connectors:read, connectors:write, content:read and search:query for the collection.
  • Set credential_key in your Quivr deployment so it can store the storage credential.
Only this source plugin uses the storage credential to read the bucket. Plugins that read file formats receive temporary Quivr-signed links to the verified files.

Enable it

1

Find the prefix source

Look for object_storage_prefix in GET /v0/connector-kinds. If it is missing, pin the plugin.
2

Create an instance

Follow Collect from a source with kind object_storage_prefix. Set bucket, prefix and region in config. For an S3-compatible provider, set endpoint to its storage origin. Include the storage credential in credential.secret in the same request.

Use it

Collect files as they arrive

Set object_patterns to match the keys you want, such as ["feed/**/*.jpg", "feed/**/*.xml"] for photos and XML. Keep the default key checkpoint mode for large imports or when new keys always sort after old keys. Use timestamp to pick up overwrites and new files that sort earlier. It scans the prefix to order objects by modification time.

Pair a photo with its caption

A sidecar pair joins a media file with a separate document that describes it. For example, a NewsML-G2 XML document can supply a caption and name its JPEG under the same bucket prefix in a remoteContent link.
  1. In sidecars.patterns, match the XML documents. In sidecars.media_patterns, match the JPEGs they may attach. Both files must pass the source’s object filters.
  2. Set sidecars.reference_pattern to capture the JPEG reference from the XML. Use the same record_key_pattern capture for both names and map .xml to application/vnd.iptc.g2.newsitem+xml in media_type_by_extension.
  3. Use the working layout and configuration and enable the NewsML-G2 and image metadata plugins. If the XML can arrive first, set sidecars.wait_seconds to cover the upload gap. For an import where every photo has a sidecar, set sidecars.ingest_lone_media to false.
Search for a word in the caption and open the result to check that it has the image.

Settings

What it produces

Files become records. When a pair is found, the document supplies the description and the image appears on the same record. The pair uses the media file’s record key and takes precedence over a version containing only the image.

Limits and troubleshooting