KosmoKrator

data

Pinecone Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Pinecone KosmoKrator integration.

Lua Namespace

Agents call this integration through app.integrations.pinecone.*. Use lua_read_doc("integrations.pinecone") inside KosmoKrator to discover the same reference at runtime.

Call Lua from the Headless CLI

Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic Pinecone workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.pinecone.list_indexes({}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("pinecone"))' --json
kosmo integrations:lua --eval 'print(docs.read("pinecone.list_indexes"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local pinecone = app.integrations.pinecone
local result = pinecone.list_indexes({})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.pinecone, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.pinecone.default.* or app.integrations.pinecone.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Pinecone, use the narrower mcp:lua command.

MCP Lua command
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Pinecone Lua Reference

Namespace: pinecone

This integration covers common Pinecone Database control-plane and data-plane operations from the REST API. Pinecone requests use an Api-Key header and the configured X-Pinecone-Api-Version, defaulting to 2026-04.

Control-plane tools use the configured API base URL, usually https://api.pinecone.io. Data-plane tools require the target index host returned by pinecone.get_index.

Indexes

pinecone.list_indexes

List indexes in the project.

local indexes = app.integrations.pinecone.list_indexes({})

pinecone.get_index

Get one index description, including its host.

local index = app.integrations.pinecone.get_index({ name = "docs-example" })

pinecone.create_index

Create a serverless index.

local created = app.integrations.pinecone.create_index({
  name = "docs-example",
  dimension = 1536,
  metric = "cosine",
  cloud = "aws",
  region = "us-east-1"
})

pinecone.configure_index

Patch configurable index settings.

local updated = app.integrations.pinecone.configure_index({
  name = "docs-example",
  config = {
    deletion_protection = "enabled",
    tags = { environment = "test" }
  }
})

pinecone.delete_index

Delete an index after deletion protection is disabled.

app.integrations.pinecone.delete_index({ name = "docs-example" })

Vectors

pinecone.upsert_vectors

Upsert dense vectors into an index host.

local result = app.integrations.pinecone.upsert_vectors({
  index_host = "https://example-index.svc.us-east-1.pinecone.io",
  namespace = "docs",
  vectors = {
    { id = "vec1", values = { 0.1, 0.2 }, metadata = { source = "example" } }
  }
})

pinecone.query_vectors

Search by vector.

local result = app.integrations.pinecone.query_vectors({
  index_host = "https://example-index.svc.us-east-1.pinecone.io",
  namespace = "docs",
  vector = { 0.1, 0.2 },
  top_k = 5,
  include_metadata = true,
  include_values = false
})

pinecone.fetch_vectors

Fetch vectors by ID.

local result = app.integrations.pinecone.fetch_vectors({
  index_host = "https://example-index.svc.us-east-1.pinecone.io",
  namespace = "docs",
  ids = { "vec1", "vec2" }
})

pinecone.update_vector

Update values or metadata by ID, or metadata across records matching a filter.

local result = app.integrations.pinecone.update_vector({
  index_host = "https://example-index.svc.us-east-1.pinecone.io",
  namespace = "docs",
  id = "vec1",
  set_metadata = { status = "reviewed" }
})

pinecone.delete_vectors

Delete by IDs, metadata filter, or delete_all.

app.integrations.pinecone.delete_vectors({
  index_host = "https://example-index.svc.us-east-1.pinecone.io",
  namespace = "docs",
  ids = { "vec1" }
})

pinecone.describe_index_stats

Describe vector counts and namespace stats.

local stats = app.integrations.pinecone.describe_index_stats({
  index_host = "https://example-index.svc.us-east-1.pinecone.io"
})

Collections

pinecone.list_collections

List collections in the project.

local collections = app.integrations.pinecone.list_collections({})

Collections are part of Pinecone’s control-plane API. Prefer index and vector tools for current RAG workflows.

Raw agent markdown
# Pinecone Lua Reference

Namespace: `pinecone`

This integration covers common Pinecone Database control-plane and data-plane operations from the REST API. Pinecone requests use an `Api-Key` header and the configured `X-Pinecone-Api-Version`, defaulting to `2026-04`.

Control-plane tools use the configured API base URL, usually `https://api.pinecone.io`. Data-plane tools require the target index host returned by `pinecone.get_index`.

## Indexes

### `pinecone.list_indexes`

List indexes in the project.

```lua
local indexes = app.integrations.pinecone.list_indexes({})
```

### `pinecone.get_index`

Get one index description, including its host.

```lua
local index = app.integrations.pinecone.get_index({ name = "docs-example" })
```

### `pinecone.create_index`

Create a serverless index.

```lua
local created = app.integrations.pinecone.create_index({
  name = "docs-example",
  dimension = 1536,
  metric = "cosine",
  cloud = "aws",
  region = "us-east-1"
})
```

### `pinecone.configure_index`

Patch configurable index settings.

```lua
local updated = app.integrations.pinecone.configure_index({
  name = "docs-example",
  config = {
    deletion_protection = "enabled",
    tags = { environment = "test" }
  }
})
```

### `pinecone.delete_index`

Delete an index after deletion protection is disabled.

```lua
app.integrations.pinecone.delete_index({ name = "docs-example" })
```

## Vectors

### `pinecone.upsert_vectors`

Upsert dense vectors into an index host.

```lua
local result = app.integrations.pinecone.upsert_vectors({
  index_host = "https://example-index.svc.us-east-1.pinecone.io",
  namespace = "docs",
  vectors = {
    { id = "vec1", values = { 0.1, 0.2 }, metadata = { source = "example" } }
  }
})
```

### `pinecone.query_vectors`

Search by vector.

```lua
local result = app.integrations.pinecone.query_vectors({
  index_host = "https://example-index.svc.us-east-1.pinecone.io",
  namespace = "docs",
  vector = { 0.1, 0.2 },
  top_k = 5,
  include_metadata = true,
  include_values = false
})
```

### `pinecone.fetch_vectors`

Fetch vectors by ID.

```lua
local result = app.integrations.pinecone.fetch_vectors({
  index_host = "https://example-index.svc.us-east-1.pinecone.io",
  namespace = "docs",
  ids = { "vec1", "vec2" }
})
```

### `pinecone.update_vector`

Update values or metadata by ID, or metadata across records matching a filter.

```lua
local result = app.integrations.pinecone.update_vector({
  index_host = "https://example-index.svc.us-east-1.pinecone.io",
  namespace = "docs",
  id = "vec1",
  set_metadata = { status = "reviewed" }
})
```

### `pinecone.delete_vectors`

Delete by IDs, metadata filter, or `delete_all`.

```lua
app.integrations.pinecone.delete_vectors({
  index_host = "https://example-index.svc.us-east-1.pinecone.io",
  namespace = "docs",
  ids = { "vec1" }
})
```

### `pinecone.describe_index_stats`

Describe vector counts and namespace stats.

```lua
local stats = app.integrations.pinecone.describe_index_stats({
  index_host = "https://example-index.svc.us-east-1.pinecone.io"
})
```

## Collections

### `pinecone.list_collections`

List collections in the project.

```lua
local collections = app.integrations.pinecone.list_collections({})
```

Collections are part of Pinecone's control-plane API. Prefer index and vector tools for current RAG workflows.
Metadata-derived Lua example
local result = app.integrations.pinecone.list_indexes({})
print(result)

Functions

list_indexes Read

List all vector indexes in your Pinecone project. Returns index names, dimensions, metrics, and status.

Lua path
app.integrations.pinecone.list_indexes
Full name
pinecone.pinecone_list_indexes
ParameterTypeRequiredDescription
No parameters.
get_index Read

Get detailed information about a specific Pinecone vector index, including its dimension, metric, host URL, and status.

Lua path
app.integrations.pinecone.get_index
Full name
pinecone.pinecone_get_index
ParameterTypeRequiredDescription
name string yes The name of the index to retrieve.
create_index Write

Create a new serverless vector index in Pinecone. Specify the index name, vector dimension, and similarity metric (cosine, euclidean, or dotproduct).

Lua path
app.integrations.pinecone.create_index
Full name
pinecone.pinecone_create_index
ParameterTypeRequiredDescription
name string yes The name for the new index. Must be unique within the project.
dimension integer yes The dimension size of the vectors to be stored (e.g., 1536 for OpenAI text-embedding-ada-002, 3072 for text-embedding-3-large).
metric string no The similarity metric to use: "cosine" (default), "euclidean", or "dotproduct".
cloud string no Serverless cloud provider. Defaults to aws.
region string no Serverless cloud region. Defaults to us-east-1.
configure_index Write

Configure an existing Pinecone index, such as deletion protection, tags, or supported scaling settings.

Lua path
app.integrations.pinecone.configure_index
Full name
pinecone.pinecone_configure_index
ParameterTypeRequiredDescription
name string yes The index name.
config object yes PATCH body for the index configuration.
delete_index Write

Delete a Pinecone index by name. Deletion protection must be disabled on the index first.

Lua path
app.integrations.pinecone.delete_index
Full name
pinecone.pinecone_delete_index
ParameterTypeRequiredDescription
name string yes The index name to delete.
upsert_vectors Write

Upsert vectors into a Pinecone index using an index host URL.

Lua path
app.integrations.pinecone.upsert_vectors
Full name
pinecone.pinecone_upsert_vectors
ParameterTypeRequiredDescription
index_host string yes The index host URL, such as "https://example.svc.us-east-1.pinecone.io".
vectors array yes Vector records with id, values, and optional metadata.
namespace string no Optional namespace where vectors are upserted.
query_vectors Read

Search for similar vectors in a Pinecone index using a query embedding.

Lua path
app.integrations.pinecone.query_vectors
Full name
pinecone.pinecone_query_vectors
ParameterTypeRequiredDescription
index_host string yes The index host URL.
vector array yes Query embedding vector values.
top_k integer no Number of top matches to return (default: 10).
filter object no Optional metadata filter expression.
include_metadata boolean no Whether to include metadata in matches (default: true).
include_values boolean no Whether to include vector values in matches (default: false).
namespace string no Optional namespace to query.
fetch_vectors Read

Fetch vectors by ID from a Pinecone index namespace.

Lua path
app.integrations.pinecone.fetch_vectors
Full name
pinecone.pinecone_fetch_vectors
ParameterTypeRequiredDescription
index_host string yes The index host URL.
ids array yes Vector IDs to fetch.
namespace string no Optional namespace.
update_vector Write

Update vector values, sparse values, metadata, or filtered metadata in a Pinecone namespace.

Lua path
app.integrations.pinecone.update_vector
Full name
pinecone.pinecone_update_vector
ParameterTypeRequiredDescription
index_host string yes The index host URL.
id string no Vector ID for single-record updates.
values array no Replacement vector values.
sparse_values object no Sparse vector values.
set_metadata object no Metadata fields to set.
filter object no Metadata filter for bulk metadata updates.
namespace string no Optional namespace.
dry_run boolean no Return matched count without updating when using a filter.
delete_vectors Write

Delete vectors from a Pinecone namespace by IDs, metadata filter, or delete_all flag.

Lua path
app.integrations.pinecone.delete_vectors
Full name
pinecone.pinecone_delete_vectors
ParameterTypeRequiredDescription
index_host string yes The index host URL.
ids array no Vector IDs to delete.
filter object no Metadata filter selecting vectors to delete.
delete_all boolean no Set true to delete all vectors in the namespace.
namespace string no Optional namespace.
describe_index_stats Read

Describe vector count, dimensions, and namespace statistics for a Pinecone index.

Lua path
app.integrations.pinecone.describe_index_stats
Full name
pinecone.pinecone_describe_index_stats
ParameterTypeRequiredDescription
index_host string yes The index host URL.
filter object no Optional metadata filter.
list_collections Read

List all collections in your Pinecone project. Collections are static snapshots of indexes used for backups or creating new indexes.

Lua path
app.integrations.pinecone.list_collections
Full name
pinecone.pinecone_list_collections
ParameterTypeRequiredDescription
No parameters.