komrad

search_documents

Search documents by full text, reading each as it is now and never an earlier version.

read-onlyidempotentMCP toolAgent

Quote phrases and prefix - to exclude. Narrow to one agent with agent_id or one type with type.

Calling it#

curl -X POST http://127.0.0.1:8787/komrad.agent.v1.AgentService/SearchDocuments \
  -H 'Content-Type: application/json' \
  -d '{
  "query": "<query>"
}'

Request#

SearchDocumentsRequest#

FieldTypeDescription
querystring*

at most 500 characters

The words to search for in each document's newest version, matched whole and stemmed. A quoted phrase matches in order, and a leading minus excludes a word.

agent_iduuid

The agent whose documents to search, by id. Unset searches every agent's, archived agents included.

typestring

not empty

at most 100 characters

The type of documents to search, by name. Unset searches every type.

limitint32

between 0 and 200

How many documents to return across matches and near. Zero returns up to fifty.

Response#

SearchDocumentsResponse#

FieldTypeDescription
matchesDocumentHit[]

The documents that contain every word, best match first.

nearDocumentHit[]

The documents that contain a word only inside a longer word, closest first.

Types#

DocumentHit#

DocumentHit is one document that matched a search.

FieldTypeDescription
document_iduuid*

The document's id.

agent_iduuid*

The id of the agent that owns the document.

namestring

The document's title.

snippetstring

The text around the match, with the matched words marked.