Skip to main content

Tools API

The Tools Library provides agentic capabilities for your AI applications. Add web search, document retrieval (RAG), and conversation memory with a single API.

Available Tools

Search the web in real-time with AI-optimized results.

Endpoint

Request

Response

Pricing

Documents / RAG

Upload documents and query them with semantic search. Use documents as context in chat requests for Q&A, structured extraction, and more.

Upload Document

Upload a file directly or send base64-encoded content. Perf will automatically chunk the document, generate embeddings, and make it available for search and chat context. Send the file directly using multipart/form-data:
Python:
Node.js:
You can include optional fields as form fields alongside the file:

JSON Upload (Base64)

Alternatively, send base64-encoded content in a JSON body:

Parameters

File upload (multipart/form-data): JSON upload (application/json):

Response

Save the id from the response — you’ll need it to reference this document in /v1/chat requests. Document Status:
  • processing - Being chunked and embedded
  • ready - Available for search
  • failed - Processing failed (check error_message)

Use with Chat API

Once a document is ready, pass its id as document_id in a /v1/chat request to use it as context:
You can also combine document_id with schema_id for structured data extraction. See Document Context in Chat API for full details.

Query Documents

Response:

List Documents

Delete Document

Document Limits by Tier

Memory / Context

Persist conversation context across sessions. The AI remembers previous interactions without you managing conversation history.

Using Memory with Chat

Add session_id to your chat requests to enable memory:
Now in a subsequent request:
The AI will remember: “Your name is Sarah, as you mentioned earlier.”

Memory Management

List Sessions:
Get Session:
Clear Session:
Delete Session:

Memory Limits by Tier

Auto-Summarization

When a session approaches its token limit, Perf automatically:
  1. Summarizes older messages
  2. Preserves recent messages intact
  3. Continues conversation with summary + recent context
This ensures conversations can continue indefinitely within your tier limits.

Combining Tools

Tools work together seamlessly. For example, search the web, store relevant information in documents, and use memory to maintain context:

Pricing Summary

Plan Availability