A programming framework for agentic AI
Add documentation (#68)
Eric Zhu1dc22d9672e4
diff --git a/docs/src/core-concepts/agent.md b/docs/src/core-concepts/agent.mdnew file mode 100644index 000000000..caa8a0863--- /dev/null+++ b/docs/src/core-concepts/agent.md@@ -0,0 +1,24 @@+# Agent++An agent in AGNext is an entity that can react to, send, and publish+messages. Messages are the only means through which agents can communicate+with each others.++## TypeRoutedAgent++`agnext.components.TypeRoutedAgent`+is a base class for building custom agents. It provides+a simple API for associating message types with message handlers.+Here is an example of simple agent that reacts to `TextMessage`:++```python+from agnext.chat.types import TextMessage+from agnext.components import TypeRoutedAgent, message_handler+from agnext.core import AgentRuntime, CancellationToken++class MyAgent(TypeRoutedAgent):++ @message_handler()+ async def on_text_message(self, message: TextMessage, cancellation_token: CancellationToken)) -> None:+ await self._publish(TextMessage(content=f"I received this message: ({message.content}) from {message.source}"))+```diff --git a/docs/src/core-concepts/memory.md b/docs/src/core-concepts/memory.mdnew file mode 100644index 000000000..08450ddf3--- /dev/null+++ b/docs/src/core-concepts/memory.md@@ -0,0 +1,7 @@+# Memory++Memory is a collection of data corresponding to the conversation history+of an agent.+Data in meory can be just a simple list of all messages, or a sightly more+realistic one which provides a view of the last N messages+(`agnext.chat.memory.BufferedChatMemory`).diff --git a/docs/src/core-concepts/patterns.md b/docs/src/core-concepts/patterns.mdnew file mode 100644index 000000000..51829a449--- /dev/null+++ b/docs/src/core-concepts/patterns.md@@ -0,0 +1 @@+# Multi-Agent Patternsdiff --git a/docs/src/core-concepts/runtime.md b/docs/src/core-concepts/runtime.mdnew file mode 100644index 000000000..c01ea809e--- /dev/null+++ b/docs/src/core-concepts/runtime.md@@ -0,0 +1,12 @@+# Agent Runtime++Agent runtime is the execution environment for agents in AGNext.+Similar to the runtime environment of a programming language, the+agent runtime provides the necessary infrastructure to facilitate communication+between agents, manage agent states, and provide API for monitoring and+debugging multi-agent interactions.++Further readings:++1. `agnext.core.AgentRuntime`+2. `agnext.application.SingleThreadedAgentRuntime`diff --git a/docs/src/core-concepts/tools.md b/docs/src/core-concepts/tools.mdnew file mode 100644index 000000000..40986faed--- /dev/null+++ b/docs/src/core-concepts/tools.md@@ -0,0 +1 @@+# Toolsdiff --git a/docs/src/getting-started/contributing.md b/docs/src/getting-started/contributing.mdnew file mode 100644index 000000000..de202e5f9--- /dev/null+++ b/docs/src/getting-started/contributing.md@@ -0,0 +1 @@+# Contributing to AGNextdiff --git a/docs/src/getting-started/tutorial.md b/docs/src/getting-started/tutorial.mdnew file mode 100644index 000000000..4f50eccc5--- /dev/null+++ b/docs/src/getting-started/tutorial.md@@ -0,0 +1 @@+# Tutorialdiff --git a/docs/src/index.rst b/docs/src/index.rstindex 53f8eba86..7f2c41a87 100644--- a/docs/src/index.rst+++ b/docs/src/index.rst@@ -6,6 +6,18 @@ agnext:hidden:getting-started/installation+ getting-started/tutorial+ getting-started/contributing++.. toctree::+ :caption: Core Concepts+ :hidden:++ core-concepts/runtime+ core-concepts/agent+ core-concepts/patterns+ core-concepts/memory+ core-concepts/tools.. toctree:::caption: Guides