Skip to content

API Reference parrot.handlers.knowledge

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.handlers.knowledge

View source

HTTP handler to manage an agent's knowledge index (PageIndex / GraphIndex).

This handler exposes a REST surface to upload, edit, delete and query the documents that feed an agent's PageIndex (hierarchical, vectorless ToC tree) and/or GraphIndex (knowledge graph), and to test the agent's LLM via ask_stream over HTTP chunked transfer encoding.

Routes (registered in manager/manager.py)::

GET    /api/v1/agents/knowledge/{agent_id}            -> index status / list trees
GET    /api/v1/agents/knowledge/{agent_id}/search     -> query the index (JSON)
GET    /api/v1/agents/knowledge/{agent_id}/ask        -> ask_stream (chunked)
PUT    /api/v1/agents/knowledge/{agent_id}            -> upload new files
POST   /api/v1/agents/knowledge/{agent_id}            -> edit existing content
DELETE /api/v1/agents/knowledge/{agent_id}            -> delete node / tree

Index selection: ?index=pageindex|graphindex (default pageindex). Tree selection : ?tree=<tree_name> (default pageindex).

PageIndex supports the full file lifecycle. GraphIndex supports query and upload (when the agent exposes a GraphIndexBuilder + TenantContext); per-file edit/delete return 501 Not Implemented because the GraphIndex toolkit has no document-level edit/delete primitives.

Alias AIMessage

Re-exported from parrot.models.responses.AIMessage.

Alias AbstractBot

Re-exported from parrot.bots.AbstractBot.

Class AgentKnowledgeHandler

Manage an agent's PageIndex / GraphIndex documents over REST.

Parameter Type Default Description
*args Any ()
**kwargs Any {}

Method AgentKnowledgeHandler.get

Dispatch GET to status, /search (JSON) or /ask (chunked).

get() -> web.StreamResponse

Returns: web.StreamResponse

Method AgentKnowledgeHandler.put

Upload one or more files into the agent's index.

put() -> web.Response

Returns: web.Response

Method AgentKnowledgeHandler.post

Edit existing content in the agent's index.

post() -> web.Response

Returns: web.Response

Method AgentKnowledgeHandler.delete

Delete a node (?node_id=) or a whole tree from the index.

delete() -> web.Response

Returns: web.Response

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally