Prerequisites:
- A Powabase project — grab your Project URL and Service Role (Secret) Key from the Connect modal in the Studio (click the Connect button in your project header, or append ?showConnect=true to any project URL). See the Auth & Connection guide for the full walkthrough.
Authenticate
Set up your base URL and authentication headers. Copy Project URL and Service Role (Secret) Key from the Studio’s Connect modal — every /api/* request needs the service role key in both the apikey and Authorization headers.Endpoint:
Headers: apikey + AuthorizationUpload a document
Upload a file to create a Source. The platform automatically extracts its text content for indexing.Endpoint: Response:
POST /api/sources/uploadCreate a knowledge base and index the document
Create a knowledge base, then add the source to it. Adding a source triggers chunking and vector indexing automatically.Endpoint:
POST /api/knowledge-basesCreate an agent with the knowledge base
Create an agent and link the knowledge base to it. The agent automatically gets a search tool for each linked knowledge base.Endpoint:
POST /api/agentsChat with your agent (streaming)
Send a message and consume the SSE stream. The agent will search the knowledge base, reason about the results, and stream back an answer.Endpoint:
POST /api/agents/{id}/run/streamThe agent will emit tool_call and tool_result events as it searches the knowledge base, followed by chunk events containing the streamed answer.
What’s Next
Agents & Tools
Understand the ReAct loop, tool types, and how agents reason.
Streaming Responses
Deep dive into SSE event handling and multi-turn sessions.
Agents API Reference
Full endpoint documentation for agents.