Documentation
API Reference
Playground

Overview

Getting startedModelsDeployment Options

Integrations

Hermes AgentClaude CodeCodex

Studio

Upstage Studio

Capabilities

Generate
Parse
Extract
Embed
File Search

Deployment Options

Guides

Rate limitsContributor modeCounting tokensMCP serverRegional endpointsBeta services

Resources

CookbookPricingStatusChangelogError codesFAQ

Terms and Policies

Terms of UsePrivacy PolicyService level agreement

File Search

File Search is currently in Beta. Features and API specifications may change without prior notice. During the beta period, please avoid uploading sensitive or confidential data. When the service officially launches, data from users who have not agreed to the terms of service may be deleted. See all beta services.

File Search enables you to search across your documents using natural language queries. Upload files, build a vector store, and retrieve relevant information β€” or get AI-generated answers grounded in your documents using the Responses API.

For AI Coding Assistants

Paste this URL into your agent's context for File Search code generation.

https://console.upstage.ai/docs/capabilities/search/file-search.md

Concepts

Vector Stores

A vector store is a container that holds your indexed documents. When you upload a file to a vector store, the system automatically parses, chunks, and embeds the content so it can be searched.

Each vector store is isolated β€” files in one vector store are not searchable from another. Vector stores are scoped per user (identified by API key). You can only access vector stores that you created, and other users cannot see or search your data.

File Indexing

When you add a file to a vector store, the system processes it through an asynchronous pipeline:

  1. Parse β€” Extract text content from the file (supports images, PDFs, Microsoft Office documents, and more).
  2. Chunk β€” Split the extracted text into optimized segments.
  3. Embed β€” Generate vector embeddings for each chunk.
  4. Store β€” Save the embeddings for search.

File processing is asynchronous. After adding a file, its status starts as in_progress and transitions to completed when indexing finishes, or failed if an error occurs.

Search

Search takes a natural language query, embeds it, and finds the most relevant document chunks in the vector store. Results include the matched text, relevance score, and source file information.

Responses (RAG)

The Responses API combines search with an LLM. It retrieves relevant document chunks, then generates an AI answer grounded in the retrieved context. This is also known as Retrieval-Augmented Generation (RAG).

Quick Start

This guide walks you through creating a vector store, uploading a file, and performing your first search.

Prerequisites

  • An Upstage API key (obtain from Upstage Console)
  • A file uploaded via the Files API β€” you'll need the returned file_id to add it to a vector store

Create a Vector Store

curl -X POST https://api.upstage.ai/v2/vector_stores \
  -H "Authorization: Bearer $UPSTAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-knowledge-base"
  }'

Response:

{
  "id": "vs_abc123def456",
  "object": "vector_store",
  "created_at": 1711644800,
  "name": "my-knowledge-base",
  "usage_bytes": 0,
  "file_counts": {
    "in_progress": 0,
    "completed": 0,
    "failed": 0,
    "cancelled": 0,
    "total": 0
  },
  "status": "completed",
  "last_active_at": 1711644800,
  "expires_after": null,
  "expires_at": null,
  "metadata": {}
}

Add a File

To add a file to a vector store, you need a file_id from the Upstage Files API. First upload your file, then add it to the vector store.

curl -X POST https://api.upstage.ai/v2/vector_stores/vs_abc123def456/files \
  -H "Authorization: Bearer $UPSTAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "file_xyz789"
  }'

Response:

{
  "id": "file_xyz789",
  "object": "vector_store.file",
  "created_at": 1711644900,
  "vector_store_id": "vs_abc123def456",
  "status": "in_progress",
  "last_error": null,
  "usage_bytes": 0,
  "chunking_strategy": {"type": "auto"},
  "attributes": null
}

Wait for Indexing

File indexing is asynchronous. Poll the file status until it becomes completed.

# Poll until status is "completed" or "failed"
curl -s https://api.upstage.ai/v2/vector_stores/vs_abc123def456/files/file_xyz789 \
  -H "Authorization: Bearer $UPSTAGE_API_KEY" \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['status'])"

Search

curl -X POST https://api.upstage.ai/v2/vector_stores/vs_abc123def456/search \
  -H "Authorization: Bearer $UPSTAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What is the main topic of the document?",
    "max_num_results": 5
  }'

Get an AI-Generated Answer (RAG)

curl -X POST https://api.upstage.ai/v2/responses \
  -H "Authorization: Bearer $UPSTAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "solar-pro4",
    "input": "Summarize the key points of my document.",
    "tools": [
      {
        "type": "file_search",
        "vector_store_ids": ["vs_abc123def456"]
      }
    ]
  }'

Supported File Types

ExtensionFormat
.pdfPDF documents
.docxMicrosoft Word
.pptxMicrosoft PowerPoint
.xlsxMicrosoft Excel
.hwp, .hwpxHangul Word Processor
.mdMarkdown
.txtPlain text
.jpeg, .jpgJPEG images
.pngPNG images
.bmpBMP images
.tiff, .tifTIFF images
.heicHEIC images

All file types are processed using document parsing to extract text content before indexing.


Error Handling

All errors follow a consistent format:

{
  "error": {
    "message": "Description of the error.",
    "type": "error_type",
    "code": null
  }
}

Common Errors

HTTP StatusTypeCause
400invalid_request_errorUnsupported file type, missing required fields, or service limit exceeded (code: "max_limit_exceeded").
401β€”Missing or invalid API key in the Authorization header.
404β€”Vector store or file not found.
422invalid_request_errorInvalid chunking_strategy (only auto is supported), invalid metadata or attributes (exceeds limits).

File Batches

File batches allow you to add multiple files to a vector store in a single request. This is useful when you need to index many files at once.

curl -X POST https://api.upstage.ai/v2/vector_stores/vs_abc123def456/file_batches \
  -H "Authorization: Bearer $UPSTAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_ids": ["file_001", "file_002", "file_003"]
  }'

You can check the batch status and list the files in a batch:

# Check batch status
batch = client.vector_stores.file_batches.retrieve(
    vector_store_id=vector_store.id,
    batch_id=batch.id,
)
print(batch.file_counts)

# List files in a batch
files = client.vector_stores.file_batches.list_files(
    vector_store_id=vector_store.id,
    batch_id=batch.id,
)
for f in files:
    print(f.id, f.status)

To cancel an in-progress batch:

batch = client.vector_stores.file_batches.cancel(
    vector_store_id=vector_store.id,
    batch_id=batch.id,
)

Batch Status and Completion

A batch's status field reflects whether the batch was cancelled, not whether indexing finished. It can be either of:

  • in_progress β€” set on creation. Remains in_progress even after every file in the batch reaches a terminal state.
  • cancelled β€” set when POST .../cancel is called on an in_progress batch. Already-cancelled batches return as-is (no-op).

To detect when batch indexing is done, poll file_counts rather than status. A batch is functionally complete when file_counts.in_progress reaches 0:

import time

while True:
    batch = client.vector_stores.file_batches.retrieve(
        vector_store_id=vector_store.id,
        batch_id=batch.id,
    )
    counts = batch.file_counts
    if counts.in_progress == 0:
        break
    time.sleep(2)

# Inspect terminal counts
if counts.failed > 0:
    # Some files failed indexing β€” list files with filter=failed to inspect last_error
    failed_files = client.vector_stores.file_batches.list_files(
        vector_store_id=vector_store.id,
        batch_id=batch.id,
        filter="failed",
    )

Per-file failures do not change the batch status. They are aggregated into file_counts.failed.


Limitations and Constraints

Service Limits

ResourceLimit
Vector stores per user50
Files per vector store500
Files per batch50

These limits are enforced at creation time. Exceeding a limit returns a 400 error with code: "max_limit_exceeded".

Data Constraints

ConstraintValue
Metadata keys per object16
Metadata key length64 characters
Metadata value length512 characters
Attributes keys per file16
Attribute key length64 characters
Attribute string value length512 characters
max_num_results range1-20 (default: 5)
expires_after.days range1-365
Pagination limit range1-100 (default: 20)
Chunking strategyOnly auto is supported

Embed

Convert text into Solar Embedding vectors for search, classification, and clustering, using separate passage and query models and batches of up to 100 texts.

AI Agent Tools

Subscribe to the Upstage Document Intelligence AI Agent on AWS Marketplace β€” Document Parse and Information Extract in one serverless agent β€” with account setup steps and pricing.

On this page

File SearchConceptsVector StoresFile IndexingSearchResponses (RAG)Quick StartPrerequisitesCreate a Vector StoreAdd a FileWait for IndexingSearchGet an AI-Generated Answer (RAG)Supported File TypesError HandlingCommon ErrorsFile BatchesBatch Status and CompletionLimitations and ConstraintsService LimitsData Constraints