agentleFS
indykiteindykite/skills/indykite-capture-upsert-relationships/SKILL.md

indykite-capture-upsert-relationships

Skill4 starsChanged 10 days agoApache-2.0View on GitHub

Build the request-body JSON for the IndyKite Capture API batch relationship upsert (`POST /capture/v1/relationships`) - a `relationships` array (1-250 per request), each entry connecting a `source` node to a `target` node (by `external_id` + `type`) with a relationship `type` and optional typed `properties`; on composite IKGs (data residency) the `location` of the source and target nodes chooses the constituent. Use when the user wants to connect existing entities in the IndyKite Knowledge Graph (IKG) - "link millicent OWNS kitt", "wire these contracts to their vehicles", "prepare a relationships payload for the Capture API". Produces a ready-to-send JSON file; sending it is optional. Not for creating the nodes themselves (indykite-capture-upsert-nodes), removing relationships (indykite-capture-delete-relationships), or CIQ policy-mediated writes (indykite-ciq-create-relationship).

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not activate this skill to:

    line 28
  2. Very specific:

    write through a CIQ policy + Knowledge Query - use indykite-ciq-create-relationship.

    line 32
  3. Distinctive:

    If sent, the relationships exist in the IKG between the referenced nodes, traversable by CIQ queries and KBAC policy conditions.

    line 84

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

IndyKite Capture - upsert relationships

The Capture API is the direct ingestion surface of the IndyKite Knowledge Graph (IKG). This skill builds the request body for the batch relationship upsert endpoint - connecting nodes that already exist (or are being ingested alongside, see indykite-capture-upsert-nodes):

POST <API_URL>/capture/v1/relationships

Each entry names a source node, a target node (each by external_id + type), and the relationship type - e.g. Person(millicent) -[OWNS]-> Car(kitt). The JSON file is the deliverable, ready to be POSTed by any application.

The MCP server does not currently expose Capture endpoints; the JSON bodies this skill produces are for direct REST use and remain valid if Capture tools are added later.

When to use

Activate this skill when the user wants to:

  • connect two entities in the IKG with a typed relationship (OWNS, ACCEPTED, COVERS, HAS, …);
  • attach properties to a relationship (e.g. a status or a timestamp);
  • build the relationship structure that indykite-authzen-* policy conditions or indykite-ciq-* queries traverse.

Do not activate this skill to:

  • create the nodes being connected - use indykite-capture-upsert-nodes;
  • remove relationships or their properties - use indykite-capture-delete-relationships / indykite-capture-delete-relationship-properties;
  • write through a CIQ policy + Knowledge Query - use indykite-ciq-create-relationship; the Capture API writes directly, with no policy involved.

Prerequisites

  • An IndyKite project with an AppAgent whose credentials are configured for the calling application (Credentials guide).
  • The endpoint nodes: each source/target is referenced by (type, external_id) - ingest them first (or in the same session) with indykite-capture-upsert-nodes.

Steps

1. Model the relationships

For each connection decide:

FieldRequiredMeaning
sourceyes{ "external_id": …, "type": … } of the outgoing node.
targetyes{ "external_id": …, "type": … } of the incoming node.
typeyesRelationship type, max 128 chars, UPPER_SNAKE_CASE: capital letters, words joined by single underscores (CAN_DRIVE); by convention an uppercase verb. A lowercase letter or a digit (Owns, OWNS_2) is refused with 400.
propertiesnoArray of { "type": …, "value": … } (type is the property name: 2-128 chars, letters, digits and underscores, not starting with a digit; value a string / integer / float / boolean or arrays of those); external_value (a resolver name string) is accepted instead of value. No metadata on relationship properties.

2. Assemble the request body

One JSON object: { "relationships": [ … ] }, 1-250 entries per request. On a composite IKG (data residency), give the source and target nodes their location - the same ones they were upserted with - and the platform picks the database: one location on both, that location's; different locations, the global one; none, the default one (Data Residency guide). Do not send use_global_db, the former data-residency setting: true is refused with 400. On a regular IKG nothing changes.

A ready example: assets/relationships-vehicle-rental.json.

{
  "relationships": [
    {
      "source": { "external_id": "millicent", "type": "Person" },
      "target": { "external_id": "kitt", "type": "Car" },
      "type": "OWNS",
      "properties": [ { "type": "status", "value": "active" } ]
    }
  ]
}

3. Send it (optional)

The endpoint authenticates the calling application (its AppAgent credentials). Which credential goes in which request header is covered by the Credentials guide.

A runnable shell helper builds the authenticated request: scripts/capture.sh — run with --print to preview the curl (host-pinned; token redacted).

4. Read the results

A 200 returns one result per relationship, in order: { "results": [ { "id": "gid:…" } ] }. On a composite IKG (data residency), a request in which any node carries a location is answered instead with the GIDs grouped by location - { "east": [ "gid:…" ], "global": [ "gid:…" ] } - so read the result by location, not by position in the request. Field shapes and error semantics: references/capture-reference.md.

Outcome

  • A valid { "relationships": [ … ] } JSON file exists, each entry naming source, target, and type.
  • If sent, the relationships exist in the IKG between the referenced nodes, traversable by CIQ queries and KBAC policy conditions.

Files in this skill

  • references/capture-reference.md - full field reference (relationship, node reference, properties, composite-IKG routing), batch limits, and error semantics.
  • assets/relationships-vehicle-rental.json - ready request body: OWNS (with a property) and CAN_DRIVE relationships.
  • scripts/capture.sh - Bash helper that POSTs a body file to /capture/v1/relationships (host-pinned; --print to preview).

Agent-specific notes

This skill uses generic markdown instructions and works across all agents listed in the README. The agent needs to be able to write a JSON file; sending it additionally requires HTTP access (curl or any HTTP client).

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.