Request API
Operations for the currently processing user request (message). Only available inEventListener and Command components. Access methods:
- In event handler methods of
EventListener: Internal methods ofevent_context: context.EventContextobject - In subcommand handler methods of
Command: Internal methods ofcontext: ExecuteContextobject
Direct Reply Message
Directly reply with a message chain to the session where the current request is located. For message chain construction methods, please refer to Message Platform Entities.Get Bot UUID
Get the UUID of the bot that originated the current request.Set Request Variables
Some information in a single request is stored in request variables. When using external Agent platforms like Dify, these variables are explicitly passed to Agent platforms.Get Request Variables
Get a single request variable.Get All Request Variables
List Pipeline Knowledge Bases
Get the list of knowledge bases configured for the pipeline used by the current request.Local Agent configuration of the pipeline corresponding to the current request. If the current pipeline has no knowledge bases configured, or does not use Local Agent, an empty list is returned.
LangBot API
These APIs can be called in any plugin component. Access methods:- In the plugin root directory
main.py: Internal methods of theselfobject, these APIs are all provided by the plugin class parent classBasePlugin. - In any plugin component class: Internal methods of the
self.pluginobject.
Get Plugin Configuration
Plugin configuration format can be written inmanifest.yaml, and users need to fill it out according to the plugin configuration format in LangBot’s plugin management. Plugin code can then call this API to get plugin configuration information.
Get LangBot Version
Get the LangBot version number, returned as a string in formatv<major>.<minor>.<patch>.
Get Configured Bot List
Returns a list of all bot UUIDs.Get Bot Information
Get bot information.Send Proactive Message
Send proactive messages through bot UUID and target session ID. For message chain construction methods, please refer to Message Platform Entities.Get Configured LLM Model List
Returns a list of UUIDs for all configured LLM models.Invoke LLM Model
Invoke an LLM model, returns an LLM message. Non-streaming.List Available Parsers
List Parser plugins currently available on the host, optionally filtered by MIME type.List All Available Tools
List all available tools in the current LangBot instance (including plugin tools and MCP tools).Get Tool Detail
Get detailed information about a specific tool.Call Tool
Call a specific tool.Set Plugin Persistent Data
Persistently store plugin data. Data stored through this interface can only be accessed by this plugin. Values need to be converted to bytes manually.Get Plugin Persistent Data
Get All Plugin Persistent Data Keys
Delete Plugin Persistent Data
Get Workspace Persistent Data
Data stored through this interface can be accessed by all plugins. Values need to be converted to bytes manually.Get Workspace Persistent Data
Get All Workspace Persistent Data Keys
Delete Workspace Persistent Data
Get Plugin File-typed Config Field Data
file or array[file.
Knowledge Base API
These APIs are accessible viaself.plugin in any component, allowing you to list and retrieve from all knowledge bases in the LangBot instance without pipeline restrictions.
List All Knowledge Bases
List all available knowledge bases in the LangBot instance.Retrieve from Knowledge Base
Retrieve relevant documents from any knowledge base.RAG API
These APIs are available forKnowledgeEngine components to access the LangBot host’s embedding models, vector database, and file storage. Access method:
- In
KnowledgeEnginecomponent classes: Internal methods of theself.pluginobject.
Invoke Embedding Model
Generate text embeddings using the host’s configured embedding model.Vector Upsert
Upsert vectors to the host’s vector database.Vector Search
Search similar vectors in the host’s vector database.Each result returned by
vector_search is a dict containing id (vector ID), score (distance score), and metadata (metadata provided during upsert). If you need text content in retrieval results, store the text in metadata during ingestion.Vector Delete
Delete vectors from the host’s vector database.The Note: Chroma, Qdrant, and SeekDB store full metadata and can filter on any field. Milvus and pgvector only store
filters parameter supports Chroma-style where syntax for metadata filtering. Multiple top-level keys are AND-ed. Supported operators: $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin.text, file_id, and chunk_uuid — filters on other fields will be silently ignored.