xAI has introduced a new feature allowing users to attach files to chat messages, enabling intelligent document search within conversations. This functionality, available with Grok 4.6, transforms user requests into an agentic workflow, according to xAI documentation.
Files can be attached using either a public URL or an uploaded file ID. Public URLs allow direct referencing of publicly accessible files without an upload step. For private or sensitive documents, files can be uploaded via the Files API and then referenced by their assigned ID.
Key Points
- Users can attach files to chat messages for document search capabilities.
- The system automatically enables document search when files are attached, initiating an agentic workflow.
- Files can be referenced via a public URL using the
file_urlparameter. - Alternatively, files can be uploaded via the Files API and referenced by a
file_idfor non-public documents. - This feature is available with Grok 4.6.
- Deferred Chat Completions, which allow retrieving responses within 24 hours, are available via REST requests or the xAI SDK.
- The legacy Chat Completions endpoint is deprecated, with new capabilities delivered via the Responses API.
Context
According to xAI documentation, the integration of file attachments enhances the model's ability to process and respond to queries based on provided documents. This mechanism allows the model to search through the attached content for relevant information. The documentation also notes that Deferred Chat Completions are designed for long-running inference requests, providing a response_id to retrieve results later. These deferred results are available for 24 hours and can be requested once. The rate limit for deferred completions matches the standard chat completions rate limit.
Why It Matters
This capability offers builders a direct method to integrate external documents into conversational AI workflows, potentially improving the accuracy and relevance of model responses by grounding them in specific provided content. The option for deferred completions also addresses challenges with long-running requests, providing flexibility for asynchronous processing.
What To Do
- Review the xAI documentation on "Chat with Files" to understand the implementation details for both public URLs and uploaded file IDs.
- Explore the Files API for managing private or sensitive documents that require prior upload.
- Consider using Deferred Chat Completions for applications involving long-running inference requests, noting the 24-hour retrieval window.
- Note the deprecation of the legacy Chat Completions endpoint and plan migration to the Responses API for new capabilities.
