# Audit RAG chunks before Pinecone

**Use case:** 

Validate RAG chunk structure, provenance, duplicate content, and overlap before uploading embeddings to a Pinecone index.

## Input

```json
{
  "records": [
    {
      "chunkId": "pinecone-guide-0",
      "documentId": "pinecone-guide",
      "sourceUrl": "https://example.com/pinecone-guide",
      "chunkIndex": 0,
      "title": "Pinecone ingestion guide",
      "headingPath": [
        "Prepare records"
      ],
      "chunkText": "Validate chunk identifiers, document provenance, source URLs, and retrieval context before uploading vectors to Pinecone. A pre-ingestion quality gate prevents malformed records from entering the production index."
    },
    {
      "chunkId": "pinecone-guide-1",
      "documentId": "pinecone-guide",
      "sourceUrl": "https://example.com/pinecone-guide",
      "chunkIndex": 1,
      "title": "Pinecone ingestion guide",
      "headingPath": [
        "Verify quality"
      ],
      "chunkText": "Validate chunk identifiers, document provenance, source URLs, and retrieval context before uploading vectors to Pinecone. A pre-ingestion quality gate prevents malformed records from entering the production index."
    },
    {
      "chunkId": "pinecone-guide-3",
      "documentId": "pinecone-guide",
      "sourceUrl": "https://example.com/pinecone-guide",
      "chunkIndex": 3,
      "title": "Pinecone ingestion guide",
      "headingPath": [
        "Index records"
      ],
      "chunkText": "Upload only records that pass the structural checks, then run representative retrieval queries against the new Pinecone namespace before promoting it to production."
    }
  ],
  "maxItems": 1000,
  "fieldMapping": {},
  "minTokens": 10,
  "maxTokens": 2000,
  "nearDuplicateSimilarity": 0.95,
  "maxAdjacentOverlapRatio": 0.35,
  "enableHeuristicWarnings": true,
  "maxFindings": 5000,
  "includeMarkdownReport": true,
  "failRunOnError": false
}
```

## Output

```json
{
  "gateStatus": {
    "label": "Gate",
    "format": "string"
  },
  "automationAction": {
    "label": "Action",
    "format": "string"
  },
  "sourceType": {
    "label": "Source type",
    "format": "string"
  },
  "sourceId": {
    "label": "Source ID",
    "format": "string"
  },
  "itemsAudited": {
    "label": "Audited",
    "format": "integer"
  },
  "findingCount": {
    "label": "Findings",
    "format": "integer"
  },
  "errorCount": {
    "label": "Errors",
    "format": "integer"
  },
  "warningCount": {
    "label": "Warnings",
    "format": "integer"
  },
  "exactDuplicateRate": {
    "label": "Exact duplicate rate",
    "format": "number"
  },
  "nearDuplicateRate": {
    "label": "Near duplicate rate",
    "format": "number"
  },
  "estimatedEmbeddingWasteTokens": {
    "label": "Estimated wasted tokens",
    "format": "integer"
  },
  "truncated": {
    "label": "Truncated",
    "format": "boolean"
  },
  "finishedAt": {
    "label": "Finished",
    "format": "string"
  }
}
```

## About this Actor

This example demonstrates how to use [RAG Dataset Linter](https://apify.com/sebastian-actors/rag-dataset-linter) with a specific input configuration. Visit the [Actor detail page](https://apify.com/sebastian-actors/rag-dataset-linter) to learn more, explore other use cases, and run it yourself.