Knowledge Base

Each agent has its own knowledge base - a collection of indexed documents the agent retrieves from during conversations. Upload text, paste content, or crawl a URL. Floo chunks, embeds (OpenAI text-embedding-3-small, 1536d), and stores in pgvector.

List documents

GET/api/agents/{agent_id}/knowledgeTry it →

Returns every document indexed for the agent.

Response

JSON
{
  "documents": [
    {
      "id": "doc_abc123",
      "name": "Pricing FAQ.pdf",
      "source": "upload",
      "size_bytes": 24576,
      "chunk_count": 18,
      "status": "ready",
      "created_at": "2026-05-15T10: 30: 00Z",
      "ready_at": "2026-05-15T10: 30: 14Z"
    }
  ]
}

Upload a document

POST/api/agents/{agent_id}/knowledgeTry it →

Three upload modes via Content-Type.

Request body

JSON
{
  "paste-text": {
    "name": "Pricing FAQ",
    "text": "Our starter tier is $0.09/min...",
    "source": "text"
  },
  "crawl-url": {
    "url": "https://example.com/docs",
    "source": "url"
  },
  "file-upload": "multipart/form-data with `file` blob (.pdf, .docx, .txt, .md, up to 100 MB)"
}

Response

JSON
{
  "ok": true,
  "document_id": "doc_abc123",
  "chunk_count": 18
}
curl - paste textbash
curl -X POST https://flooai.com/api/agents/AGT_ID/knowledge \
  -H "Authorization: Bearer flk_live_xxx..." \
  -H "Content-Type: application/json" \
  -d '{"name":"Pricing FAQ","text":"Our starter tier is $0.09/min...","source":"text"}'
curl - file uploadbash
curl -X POST https://flooai.com/api/agents/AGT_ID/knowledge \
  -H "Authorization: Bearer flk_live_xxx..." \
  -F "file=@./pricing.pdf" \
  -F "name=Pricing PDF"

Delete a document

DELETE/api/agents/{agent_id}/knowledge?doc_id={doc_id}Try it →

Deletes the document and all its chunks (cascade).

Response

JSON
{
  "ok": true
}

Search the KB

The agent itself calls the search_knowledge_base tool automatically - you usually don't need to query it directly. If you do (e.g. for debugging), see Agents.