Plugin Core Concepts
In the previous chapter, you have successfully created and run a simple plugin. This chapter will take you deep into the various core concepts that constitute Nekro Agent plugins. Mastering these concepts is the foundation for developing more complex and powerful plugins.
We will explore the following topics in sequence:
- Plugin Instance and Lifecycle: Learn how to define a plugin (
NekroPlugin) and the complete lifecycle events from loading to unloading. - Sandbox Methods Explained: Deep understanding of sandbox methods—the main interface through which plugins provide functionality to AI, including their different types and implementation specifications.
- Plugin Configuration: Learn how to add user-customizable configuration items for your plugin and manage them through WebUI.
- Data Storage: Learn how to use plugin storage to persist data, whether session-related or global.
- Prompt Injection: Explore how to influence AI behavior and provide contextual information by injecting prompts.
- Agent Context (AgentCtx): Deep dive into the core context object in plugin development, including file system, message sending, configuration access, and other functionalities.
Let's get started one by one!
