Cyberlibrary Rag Context
cyberlibrary_rag_contextRetrieve ranked passages for a question and pack them into a token budget, ready to paste into an agent context. Each passage carries a permanent chunk_id, book/chapter/paragraph, citation, license and source URL, plus a packed context string and citations index. When to use: you are building a RAG answer and need grounded evidence with citations, without assembling chunks yourself. Do not use: to verify an exact quotation (cyberlibrary_verify_quote) or to read a whole book (cyberlibrary_get_chunks). Returns: {query, lang, budget_tokens, used_tokens, passages_returned, corpus_version, context, passages[], citations[]}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Optional language filter, e.g. zh-cn, en. | |
| limit | No | Max passages (1-30). Default 12. | |
| query | Yes | Question or keywords (2-300 chars). | |
| budget_tokens | No | Approximate context budget (300-12000). Default 2000. | |
| snippet_chars | No | Per-passage character cap (200-2000). Default 900. |