2024-09-18 06:12:08 -07:00
|
|
|
[build-system]
|
|
|
|
|
requires = ["hatchling"]
|
|
|
|
|
build-backend = "hatchling.build"
|
|
|
|
|
|
|
|
|
|
[project]
|
|
|
|
|
name = "autogen-ext"
|
2025-07-09 10:46:23 -07:00
|
|
|
version = "0.6.4"
|
2024-10-09 15:01:09 -04:00
|
|
|
license = {file = "LICENSE-CODE"}
|
2024-09-18 06:12:08 -07:00
|
|
|
description = "AutoGen extensions library"
|
|
|
|
|
readme = "README.md"
|
|
|
|
|
requires-python = ">=3.10"
|
|
|
|
|
classifiers = [
|
|
|
|
|
"Programming Language :: Python :: 3",
|
|
|
|
|
"License :: OSI Approved :: MIT License",
|
|
|
|
|
"Operating System :: OS Independent",
|
|
|
|
|
]
|
2024-10-01 09:35:49 +10:00
|
|
|
dependencies = [
|
2025-07-09 10:46:23 -07:00
|
|
|
"autogen-core==0.6.4",
|
2024-09-18 06:12:08 -07:00
|
|
|
]
|
|
|
|
|
|
2024-10-01 09:35:49 +10:00
|
|
|
[project.optional-dependencies]
|
2025-03-22 16:46:55 +09:00
|
|
|
anthropic = ["anthropic>=0.48"]
|
2024-10-23 01:40:41 +10:00
|
|
|
langchain = ["langchain_core~= 0.3.3"]
|
2025-01-25 08:26:48 +10:00
|
|
|
azure = [
|
2025-05-27 10:52:47 -07:00
|
|
|
"azure-ai-inference>=1.0.0b9",
|
|
|
|
|
"azure-ai-projects>=1.0.0b11",
|
2025-01-25 08:26:48 +10:00
|
|
|
"azure-core",
|
|
|
|
|
"azure-identity",
|
Add Azure AI Search tool implementation (#5844)
# Azure AI Search Tool Implementation
This PR adds a new tool for Azure AI Search integration to autogen-ext,
enabling agents to search and retrieve information from Azure AI Search
indexes.
## Why Are These Changes Needed?
AutoGen currently lacks native integration with Azure AI Search, which
is a powerful enterprise search service that supports semantic, vector,
and hybrid search capabilities. This integration enables agents to:
1. Retrieve relevant information from large document collections
2. Perform semantic search with AI-powered ranking
3. Execute vector similarity search using embeddings
4. Combine text and vector approaches for optimal results
This tool complements existing retrieval capabilities and provides a
seamless way to integrate with Azure's search infrastructure.
## Features
- **Multiple Search Types**: Support for text, semantic, vector, and
hybrid search
- **Flexible Configuration**: Customizable search parameters and fields
- **Robust Error Handling**: User-friendly error messages with
actionable guidance
- **Performance Optimizations**: Configurable caching and retry
mechanisms
- **Vector Search Support**: Built-in embedding generation with
extensibility
## Usage Example
```python
from autogen_ext.tools.azure import AzureAISearchTool
from azure.core.credentials import AzureKeyCredential
from autogen import AssistantAgent, UserProxyAgent
# Create the search tool
search_tool = AzureAISearchTool.load_component({
"provider": "autogen_ext.tools.azure.AzureAISearchTool",
"config": {
"name": "DocumentSearch",
"description": "Search for information in the knowledge base",
"endpoint": "https://your-service.search.windows.net",
"index_name": "your-index",
"credential": {"api_key": "your-api-key"},
"query_type": "semantic",
"semantic_config_name": "default"
}
})
# Create an agent with the search tool
assistant = AssistantAgent(
"assistant",
llm_config={"tools": [search_tool]}
)
# Create a user proxy agent
user_proxy = UserProxyAgent(
"user_proxy",
human_input_mode="TERMINATE",
max_consecutive_auto_reply=10,
code_execution_config={"work_dir": "coding"}
)
# Start the conversation
user_proxy.initiate_chat(
assistant,
message="What information do we have about quantum computing in our knowledge base?"
)
```
## Testing
- Added unit tests for all search types (text, semantic, vector, hybrid)
- Added tests for error handling and cancellation
- All tests pass locally
## Documentation
- Added comprehensive docstrings with examples
- Included warnings about placeholder embedding implementation
- Added links to Azure AI Search documentation
## Related issue number
Closes #5419
## Checks
- [x] I've included any doc changes needed for
<https://microsoft.github.io/autogen/>. See
<https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md> to
build and test documentation locally.
- [x] I've added tests (if relevant) corresponding to the changes
introduced in this PR.
- [x] I've made sure all auto checks have passed.
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
2025-04-02 16:16:48 -07:00
|
|
|
"azure-search-documents>=11.4.0",
|
2025-01-25 08:26:48 +10:00
|
|
|
]
|
2025-01-31 14:14:43 -08:00
|
|
|
docker = ["docker~=7.0", "asyncio_atexit>=1.0.1"]
|
2025-02-26 11:02:48 -05:00
|
|
|
ollama = ["ollama>=0.4.7", "tiktoken>=0.8.0"]
|
2025-03-18 22:20:04 -07:00
|
|
|
openai = ["openai>=1.66.5", "tiktoken>=0.8.0", "aiofiles"]
|
2024-12-10 08:28:48 -08:00
|
|
|
file-surfer = [
|
2025-07-09 10:46:23 -07:00
|
|
|
"autogen-agentchat==0.6.4",
|
2025-03-12 21:17:25 -07:00
|
|
|
"magika>=0.6.1rc2",
|
|
|
|
|
"markitdown[all]~=0.1.0a3",
|
2024-12-10 08:28:48 -08:00
|
|
|
]
|
2025-03-11 01:53:53 +02:00
|
|
|
|
|
|
|
|
llama-cpp = [
|
2025-03-14 12:20:42 -07:00
|
|
|
"llama-cpp-python>=0.3.8",
|
2025-03-11 01:53:53 +02:00
|
|
|
]
|
|
|
|
|
|
2025-01-15 21:04:17 +10:00
|
|
|
graphrag = ["graphrag>=1.0.1"]
|
2025-04-10 12:41:41 -04:00
|
|
|
chromadb = ["chromadb>=1.0.0"]
|
2025-06-17 04:39:02 +06:00
|
|
|
mem0 = ["mem0ai>=0.1.98"]
|
|
|
|
|
mem0-local = [
|
|
|
|
|
"mem0ai>=0.1.98",
|
|
|
|
|
"neo4j>=5.25.0",
|
|
|
|
|
"chromadb>=1.0.0"
|
|
|
|
|
]
|
2024-11-07 16:47:53 -08:00
|
|
|
web-surfer = [
|
2025-07-09 10:46:23 -07:00
|
|
|
"autogen-agentchat==0.6.4",
|
2024-11-07 16:47:53 -08:00
|
|
|
"playwright>=1.48.0",
|
|
|
|
|
"pillow>=11.0.0",
|
2025-03-12 21:17:25 -07:00
|
|
|
"magika>=0.6.1rc2",
|
|
|
|
|
"markitdown[all]~=0.1.0a3",
|
2024-11-07 16:47:53 -08:00
|
|
|
]
|
2024-12-03 12:14:47 -08:00
|
|
|
magentic-one = [
|
2025-07-09 10:46:23 -07:00
|
|
|
"autogen-agentchat==0.6.4",
|
2025-03-12 21:17:25 -07:00
|
|
|
"magika>=0.6.1rc2",
|
|
|
|
|
"markitdown[all]~=0.1.0a3",
|
2024-12-03 12:14:47 -08:00
|
|
|
"playwright>=1.48.0",
|
|
|
|
|
"pillow>=11.0.0",
|
|
|
|
|
]
|
2024-11-29 14:41:23 -08:00
|
|
|
video-surfer = [
|
2025-07-09 10:46:23 -07:00
|
|
|
"autogen-agentchat==0.6.4",
|
2024-11-29 14:41:23 -08:00
|
|
|
"opencv-python>=4.5",
|
|
|
|
|
"ffmpeg-python",
|
|
|
|
|
"openai-whisper",
|
|
|
|
|
]
|
2025-01-16 15:47:38 -08:00
|
|
|
diskcache = [
|
|
|
|
|
"diskcache>=5.6.3"
|
|
|
|
|
]
|
|
|
|
|
redis = [
|
|
|
|
|
"redis>=5.2.1"
|
|
|
|
|
]
|
2024-10-01 09:35:49 +10:00
|
|
|
|
2024-12-04 16:23:20 -08:00
|
|
|
grpc = [
|
2025-01-28 22:11:54 -08:00
|
|
|
"grpcio~=1.70.0",
|
2024-12-04 16:23:20 -08:00
|
|
|
]
|
2025-01-25 08:26:48 +10:00
|
|
|
|
2025-01-18 22:11:40 +01:00
|
|
|
jupyter-executor = [
|
|
|
|
|
"ipykernel>=6.29.5",
|
|
|
|
|
"nbclient>=0.10.2",
|
|
|
|
|
]
|
2024-12-04 16:23:20 -08:00
|
|
|
|
2025-04-18 05:25:57 +08:00
|
|
|
docker-jupyter-executor = [
|
|
|
|
|
"docker~=7.0",
|
|
|
|
|
"asyncio_atexit>=1.0.1",
|
|
|
|
|
"websockets>=15.0.1",
|
|
|
|
|
"requests>=2.32.3",
|
|
|
|
|
"aiohttp>=3.11.16",
|
|
|
|
|
]
|
|
|
|
|
|
2025-04-10 12:41:41 -04:00
|
|
|
task-centric-memory = ["chromadb>=1.0.0"]
|
Task-Centric Memory (#5227)
_(EXPERIMENTAL, RESEARCH IN PROGRESS)_
In 2023 AutoGen introduced [Teachable
Agents](https://microsoft.github.io/autogen/0.2/blog/2023/10/26/TeachableAgent/)
that users could teach new facts, preferences and skills. But teachable
agents were limited in several ways: They could only be
`ConversableAgent` subclasses, they couldn't learn a new skill unless
the user stated (in a single turn) both the task and how to solve it,
and they couldn't learn on their own. **Task-Centric Memory** overcomes
these limitations, allowing users to teach arbitrary agents (or teams)
more flexibly and reliably, and enabling agents to learn from their own
trial-and-error experiences.
This PR is large and complex. All of the files are new, and most of the
added components depend on the others to run at all. But the review
process can be accelerated if approached in the following order.
1. Start with the [Task-Centric Memory
README](https://github.com/microsoft/autogen/tree/agentic_memory/python/packages/autogen-ext/src/autogen_ext/task_centric_memory).
1. Install the memory extension locally, since it won't be in pypi until
it's merged. In the `agentic_memory` branch, and the `python/packages`
directory:
- `pip install -e autogen-agentchat`
- `pip install -e autogen-ext[openai]`
- `pip install -e autogen-ext[task-centric-memory]`
2. Run the Quickstart sample code, then immediately open the
`./pagelogs/quick/0 Call Tree.html` file in a browser to view the work
in progress.
3. Click through the web page links to see the details.
2. Continue through the rest of the main README to get a high-level
overview of the architecture.
3. Read through the [code samples
README](https://github.com/microsoft/autogen/tree/agentic_memory/python/samples/task_centric_memory),
running each of the 4 code samples while viewing their page logs.
4. Skim through the 4 code samples, along with their corresponding yaml
config files:
1. `chat_with_teachable_agent.py`
2. `eval_retrieval.py`
3. `eval_teachability.py`
4. `eval_learning_from_demonstration.py`
5. `eval_self_teaching.py`
6. Read `task_centric_memory_controller.py`, referring back to the
previously generated page logs as needed. This is the most important and
complex file in the PR.
7. Read the remaining core files.
1. `_task_centric_memory_bank.py`
2. `_string_similarity_map.py`
3. `_prompter.py`
8. Read the supporting files in the utils dir.
1. `teachability.py`
2. `apprentice.py`
3. `grader.py`
4. `page_logger.py`
5. `_functions.py`
2025-03-04 09:56:49 -08:00
|
|
|
|
2025-01-18 18:57:20 +10:00
|
|
|
semantic-kernel-core = [
|
|
|
|
|
"semantic-kernel>=1.17.1",
|
|
|
|
|
]
|
|
|
|
|
|
2025-02-10 16:29:43 -08:00
|
|
|
gemini = [
|
|
|
|
|
"google-genai>=1.0.0",
|
|
|
|
|
]
|
|
|
|
|
|
2025-01-18 18:57:20 +10:00
|
|
|
semantic-kernel-google = [
|
|
|
|
|
"semantic-kernel[google]>=1.17.1",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
semantic-kernel-hugging-face = [
|
|
|
|
|
"semantic-kernel[hugging_face]>=1.17.1",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
semantic-kernel-mistralai = [
|
|
|
|
|
"semantic-kernel[mistralai]>=1.17.1",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
semantic-kernel-ollama = [
|
|
|
|
|
"semantic-kernel[ollama]>=1.17.1",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
semantic-kernel-onnx = [
|
|
|
|
|
"semantic-kernel[onnx]>=1.17.1",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
semantic-kernel-anthropic = [
|
|
|
|
|
"semantic-kernel[anthropic]>=1.17.1",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
semantic-kernel-pandas = [
|
|
|
|
|
"semantic-kernel[pandas]>=1.17.1",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
semantic-kernel-aws = [
|
|
|
|
|
"semantic-kernel[aws]>=1.17.1",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
semantic-kernel-dapr = [
|
|
|
|
|
"semantic-kernel[dapr]>=1.17.1",
|
|
|
|
|
]
|
|
|
|
|
|
2025-02-10 15:27:27 -05:00
|
|
|
http-tool = [
|
|
|
|
|
"httpx>=0.27.0",
|
|
|
|
|
"json-schema-to-pydantic>=0.2.0"
|
|
|
|
|
]
|
|
|
|
|
|
2025-01-18 18:57:20 +10:00
|
|
|
semantic-kernel-all = [
|
|
|
|
|
"semantic-kernel[google,hugging_face,mistralai,ollama,onnx,anthropic,usearch,pandas,aws,dapr]>=1.17.1",
|
|
|
|
|
]
|
|
|
|
|
|
2025-01-24 09:50:38 -08:00
|
|
|
rich = ["rich>=13.9.4"]
|
|
|
|
|
|
2025-06-04 05:36:16 +09:00
|
|
|
mcp = ["mcp>=1.8.1"]
|
2025-04-21 18:03:29 +10:00
|
|
|
canvas = [
|
|
|
|
|
"unidiff>=0.7.5",
|
|
|
|
|
]
|
2025-02-09 06:20:00 +01:00
|
|
|
|
2024-09-18 06:12:08 -07:00
|
|
|
[tool.hatch.build.targets.wheel]
|
|
|
|
|
packages = ["src/autogen_ext"]
|
|
|
|
|
|
2024-12-27 13:11:42 -05:00
|
|
|
[dependency-groups]
|
|
|
|
|
dev = [
|
2024-12-30 09:09:33 -08:00
|
|
|
"autogen_test_utils",
|
|
|
|
|
"langchain-experimental",
|
2025-01-15 21:04:17 +10:00
|
|
|
"pandas-stubs>=2.2.3.241126",
|
2025-01-30 11:03:54 -08:00
|
|
|
"httpx>=0.28.1",
|
2025-04-15 12:04:01 -04:00
|
|
|
"opentelemetry-proto>=1.28.0"
|
2024-12-04 16:23:20 -08:00
|
|
|
]
|
2024-09-18 06:12:08 -07:00
|
|
|
|
|
|
|
|
[tool.ruff]
|
|
|
|
|
extend = "../../pyproject.toml"
|
|
|
|
|
include = ["src/**", "tests/*.py"]
|
Task-Centric Memory (#5227)
_(EXPERIMENTAL, RESEARCH IN PROGRESS)_
In 2023 AutoGen introduced [Teachable
Agents](https://microsoft.github.io/autogen/0.2/blog/2023/10/26/TeachableAgent/)
that users could teach new facts, preferences and skills. But teachable
agents were limited in several ways: They could only be
`ConversableAgent` subclasses, they couldn't learn a new skill unless
the user stated (in a single turn) both the task and how to solve it,
and they couldn't learn on their own. **Task-Centric Memory** overcomes
these limitations, allowing users to teach arbitrary agents (or teams)
more flexibly and reliably, and enabling agents to learn from their own
trial-and-error experiences.
This PR is large and complex. All of the files are new, and most of the
added components depend on the others to run at all. But the review
process can be accelerated if approached in the following order.
1. Start with the [Task-Centric Memory
README](https://github.com/microsoft/autogen/tree/agentic_memory/python/packages/autogen-ext/src/autogen_ext/task_centric_memory).
1. Install the memory extension locally, since it won't be in pypi until
it's merged. In the `agentic_memory` branch, and the `python/packages`
directory:
- `pip install -e autogen-agentchat`
- `pip install -e autogen-ext[openai]`
- `pip install -e autogen-ext[task-centric-memory]`
2. Run the Quickstart sample code, then immediately open the
`./pagelogs/quick/0 Call Tree.html` file in a browser to view the work
in progress.
3. Click through the web page links to see the details.
2. Continue through the rest of the main README to get a high-level
overview of the architecture.
3. Read through the [code samples
README](https://github.com/microsoft/autogen/tree/agentic_memory/python/samples/task_centric_memory),
running each of the 4 code samples while viewing their page logs.
4. Skim through the 4 code samples, along with their corresponding yaml
config files:
1. `chat_with_teachable_agent.py`
2. `eval_retrieval.py`
3. `eval_teachability.py`
4. `eval_learning_from_demonstration.py`
5. `eval_self_teaching.py`
6. Read `task_centric_memory_controller.py`, referring back to the
previously generated page logs as needed. This is the most important and
complex file in the PR.
7. Read the remaining core files.
1. `_task_centric_memory_bank.py`
2. `_string_similarity_map.py`
3. `_prompter.py`
8. Read the supporting files in the utils dir.
1. `teachability.py`
2. `apprentice.py`
3. `grader.py`
4. `page_logger.py`
5. `_functions.py`
2025-03-04 09:56:49 -08:00
|
|
|
exclude = ["src/autogen_ext/agents/web_surfer/*.js", "src/autogen_ext/runtimes/grpc/protos", "tests/protos", "README.md"]
|
2024-09-18 06:12:08 -07:00
|
|
|
|
|
|
|
|
[tool.pyright]
|
2024-09-18 16:23:53 -04:00
|
|
|
extends = "../../pyproject.toml"
|
2024-09-18 06:12:08 -07:00
|
|
|
include = ["src", "tests"]
|
2024-12-04 16:23:20 -08:00
|
|
|
exclude = ["src/autogen_ext/runtimes/grpc/protos", "tests/protos"]
|
2024-09-18 06:12:08 -07:00
|
|
|
|
|
|
|
|
[tool.pytest.ini_options]
|
|
|
|
|
minversion = "6.0"
|
|
|
|
|
testpaths = ["tests"]
|
2025-02-07 11:57:30 -05:00
|
|
|
markers = [
|
|
|
|
|
"grpc",
|
|
|
|
|
]
|
2024-09-18 06:12:08 -07:00
|
|
|
|
|
|
|
|
[tool.poe]
|
|
|
|
|
include = "../../shared_tasks.toml"
|
|
|
|
|
|
|
|
|
|
[tool.poe.tasks]
|
2024-12-12 14:42:40 -08:00
|
|
|
test.sequence = [
|
|
|
|
|
"playwright install",
|
2025-01-18 00:32:18 +10:00
|
|
|
"pytest -n 1 --cov=src --cov-report=term-missing --cov-report=xml",
|
2024-12-12 14:42:40 -08:00
|
|
|
]
|
|
|
|
|
test.default_item_type = "cmd"
|
2025-02-07 11:57:30 -05:00
|
|
|
test-grpc = "pytest -n 1 --cov=src --cov-report=term-missing --cov-report=xml --grpc"
|
2025-03-11 07:00:14 +10:00
|
|
|
test-windows = "pytest -n 1 --cov=src --cov-report=term-missing --cov-report=xml -m 'windows'"
|
2024-12-04 16:23:20 -08:00
|
|
|
mypy = "mypy --config-file ../../pyproject.toml --exclude src/autogen_ext/runtimes/grpc/protos --exclude tests/protos src tests"
|
2024-10-12 02:28:15 +10:00
|
|
|
|
|
|
|
|
[tool.mypy]
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
|
module = "docker.*"
|
2024-10-23 08:24:36 -07:00
|
|
|
ignore_missing_imports = true
|