# Grok 发布 Collections API

- 来源：xAI：News（网页）
- 发布时间：2025-12-22 08:00
- AIHOT 链接：https://aihot.virxact.com/items/cmnwsvjeh005eslte7s2wmyzy
- 原文链接：https://x.ai/news/grok-collections-api

## AI 摘要

Grok 推出 Collections API，支持上传 PDF、Excel、代码库等文件构建知识库，提供语义、关键词及混合搜索三种检索方式，帮助开发者零基础设施构建 RAG 应用。首周文件索引与存储免费，检索定价 $2.50/千次。基准测试显示，其在金融（93.0%）、法律（73.9%）、编码（86%）场景的检索准确率均优于 Gemini Pro 3 和 GPT 5.1。

## 正文

Today, we're excited to announce Collections API. With Collections, you can upload and search through entire datasets. From PDFs and Excel sheets to entire codebases, you can upload your files into a knowledge base that supports precise and fast search. This allows developers to build RAG applications without the headache of managing indexing and retrieval infrastructure.

To help you get started, we're making file indexing and storage free for the first week*, with retrieval priced at a flat rate of $2.50 per 1,000 searches. Indexing **Powerful document understanding**: We use OCR and layout-aware parsing to extract text while preserving structure such as the layout of a PDF, hierarchy of an Excel table, or the syntax of code. **Smart file management**: Easily upload, update, and download files. And when a file changes, our system efficiently reindexes it to ensure your collection is never stale. **Broad format support**: Collections supports a wide range of file types. (see full list) Retrieval

Choose the retrieval method that best fits your use case: **Semantic search**: To search using the meaning and intent behind a query. **Keyword search**: For precise term matching. **Hybrid search**: For the highest accuracy, combine keyword and semantic search. We support both a dedicated reranker model and reciprocal rank fusion.

What is our financial forecast for Q1 2026?

Financial_plan_2026.txt

Our company's annual financial projections indicate a robust growth trajectory for the upcoming fiscal year, with expected revenue increases driven by expanded market share in emerging sectors. Analysts predict a 15% rise in Q1 2026, bolstered by strategic investments in technology and supply chain optimization. Key metrics such as EBITDA and net profit margins are forecasted to improve. Benchmark Results

Our Collections API delivers state-of-the-art retrieval performance, matching or outperforming leading models in real-world RAG tasks across finance, legal, and coding domains.

These fields are especially challenging due to their long, dense documents. To avoid hallucinations and deliver reliable answers, models must retrieve the exact passages and reason over them accurately. Accuracy*

(Higher is better)

| Task | xAI Grok 4.1 Fast | Google Gemini Pro 3 | OpenAI GPT 5.1 | | --- | --- | --- | --- | | Finance Tabular and numerical questions | 93.0 | 85.9 | 84.7 | | Legal Complex reasoning over multiple chunks | 73.9 | 74.5 | 71.2 | | Coding Code understanding and large file systems | 86 | 85 | 81 |

*Internal source. Financial Analysis

Extracting tabular and numerical data from files can be challenging with semantic search alone. Hybrid search enables you to accurately retrieve this data from documents such as SEC filings*, allowing the model to precisely reference information.

Retrieval Score

xAI Collections & Grok 4.1

Google File Search & Gemini Pro 3**

OpenAI VS & GPT 5.1

*Based on an internal dataset.

**Gemini does not expose the actual retrieved files so this metric measures the files cited by Gemini rather than the raw retrieved files. We set the default top k for Gemini to be 20 passages. Legal Analysis (LegalBench)

The LegalBench dataset tests retrieval and reasoning over nuanced legal language and complex cross-references, consisting of 128 challenging question-answer pairs drawn from an extensive corpus of authentic commercial contracts across multiple datasets.

Retrieval Score

xAI Collections & Grok 4.1

Google File Search & Gemini Pro 3*

OpenAI VS & GPT 5.1

*Gemini does not expose the actual retrieved files so this metric measures the files cited by Gemini rather than the raw retrieved files. We set the default top k for Gemini to be 20 passages. Codebase (DeepCodeBench)

Code understanding is crucial for applications such as code summarization and generation. We use the DeepCodeBench dataset to comprehensively benchmark for this. It features a diverse set of tasks drawn from real-world open-source repositories, API usage, and complex algorithmic problems. End to End Answer Performance

Accuracy Score

Grok 4.1

Gemini Pro 3

GPT 5.1

*We evaluated the code understanding capability of agentic search on 232 code Q&A datapoints from DeepCodeBench across 8 repositories containing 8,000 files. Data Privacy

We do not use user data stored on Collections for model training purposes, unless the user has given consent. Start Building Creating and Searching Collections

py Using Collections in Chat

py Direct API Usage

sh

*You may be charged after the free trial period. We will follow up with more information.
