1
+ """
2
+ Lightweight library demonstrating how to create a simple agenting application without using any specific framework.
3
+
4
+ ## Table of Contents
5
+
6
+ - [Features](#features)
7
+ - [Future work](#future-work)
8
+ - [Getting Started](#getting-started)
9
+ - [Demos](#demos)
10
+ - [Testing](#testing)
11
+ - [License](#license)
12
+ - [Contributing](#contributing)
13
+
14
+ ## Features
15
+
16
+ This project framework provides the following features:
17
+
18
+ - Multi-agent chat
19
+ - Agent routing (including option to look for available tools to decide)
20
+ - Agent state management
21
+ - Custom stop conditions
22
+ - Interactive or unattended user input
23
+ - Chat resumability
24
+ - Function calling on agents
25
+ - Constrained agent routing
26
+ - Sub-workflows
27
+ - Simple RAG via function calls
28
+ - Image input support
29
+ - Ability to run pre and post steps via Sequence
30
+ - Conversation context "hidden" variables, which are not displayed to the user but agents can read and write to access additional information
31
+ - Usage metrics tracking per conversation, plus internal log for debuggability
32
+ - Multiple strategies for agent to filter conversation messages (All, last N, top K and Last N, summarize, etc..)
33
+ - LLMLingua (`extras` module) support to compress system prompts via strategies
34
+ - LLM support for Structured Output
35
+ - Remoting support ((`remote` module)), allowing agents to be run on a remote server and accessed elsewhere
36
+ - REST and gRPC channels supported
37
+ - Default implementation to run hosts with agent discovery and registration
38
+ - Generated Code execution locally and via ACA Dynamic Sessions
39
+ - Streaming support, even over REST or gRPC agents
40
+
41
+ ## Future work
42
+
43
+ - Plugins
44
+ - Azure AI Search plugin
45
+ - DB plugin
46
+ - API plugin
47
+ - DAPR integration
48
+ - Multi-agent chat with multiple users
49
+
50
+ ## Getting Started
51
+
52
+ ### Prerequisites
53
+
54
+ Python 3.11 or later is required to run this project.
55
+
56
+ ### Quickstart
57
+
58
+ ```powershell
59
+ git clone https://github.com/Azure-Samples/vanilla-aiagents
60
+
61
+ cd "vanilla-aiagents"
62
+
63
+ # Create a virtual environment
64
+ python -m venv .venv
65
+
66
+ # Activate the virtual environment
67
+
68
+ # On Windows
69
+ .\.venv\Scripts\a ctivate
70
+ # On Unix or MacOS
71
+ source .venv/bin/activate
72
+
73
+ # Install the required dependencies
74
+ pip install -r requirements.txt
75
+
76
+ # Clone .env.sample to .env and update the values
77
+ cp .env.sample .env
78
+ ```
79
+
80
+ Here is a simple example of how to use the framework:
81
+
82
+ ```python
83
+ import os
84
+ from vanilla_aiagents.llm import AzureOpenAILLM
85
+ from vanilla_aiagents.agent import Agent
86
+ from vanilla_aiagents.team import Team
87
+ from vanilla_aiagents.workflow import Workflow
88
+
89
+ llm = AzureOpenAILLM({
90
+ "azure_deployment": os.getenv("AZURE_OPENAI_MODEL"),
91
+ "azure_endpoint": os.getenv("AZURE_OPENAI_ENDPOINT"),
92
+ "api_key": os.getenv("AZURE_OPENAI_KEY"),
93
+ "api_version": os.getenv("AZURE_OPENAI_API_VERSION"),
94
+ })
95
+
96
+ # Initialize agents and team
97
+ sales = Agent(id="sales", llm=llm, description="A sales agent", system_message=\" ""
98
+ You are a sales assistant. You provide information about our products and services.
99
+
100
+ # PRODUCTS
101
+ - Product 1: $100, description
102
+ - Product 2: $200, description
103
+ - Product 3: $300, description
104
+ \" "")
105
+ support = Agent(id="support", llm=llm, description="A support agent", system_message=\" ""
106
+ You are a support assistant. You provide help with technical issues and account management.
107
+
108
+ # SUPPORT GUIDELINES
109
+ - For technical issues, please provide the following information: ...
110
+ - For account management, please provide the following information: ...
111
+ \" "")
112
+ team = Team(id="team", description="Contoso team", members=[sales, support], llm=llm)
113
+
114
+ # Create a workflow
115
+ workflow = Workflow(askable=team)
116
+
117
+ # Run the workflow
118
+ result = workflow.run("Hello, I'd like to know more about your products.")
119
+ print(workflow.conversation.messages)
120
+ ```
121
+ """
0 commit comments