A Python library for building agentic applications
Project description
Agentic Kernel, inspired by Semantic Kernel and Autogen
Supercharge your Microsoft Semantic Kernel applications with AgenticFleet Labs!
This repository provides a collection of robust, pre-built plugins designed to give your AI agents powerful capabilities with minimal setup. Integrate these plugins easily to enable tasks like web browsing, file system interaction, and more.
Available Plugins
Easily add sophisticated features to your Semantic Kernel agents:
🌐 WebSurfer Plugin (agentic_kernel.plugins.web_surfer)
Enable your agent to access and understand information from the live web.
- Web Search: Perform dynamic web searches using DuckDuckGo to fetch up-to-date information.
web_search(query: str, max_results: int = 5)-> Returns titles, URLs, snippets.
- Webpage Summarization: Extract and summarize the key content from any webpage URL.
summarize_webpage(url: HttpUrl)-> Returns a concise text summary.
Quick Start:
import asyncio
import semantic_kernel as sk
from agentic_kernel.plugins.web_surfer import WebSurferPlugin
async def main():
kernel = sk.Kernel()
# Import the plugin into the kernel
web_surfer_plugin = kernel.add_plugin(WebSurferPlugin(), "WebSurfer")
# --- Example: Search the web ---
search_query = "Latest advancements in large language models"
print(f"Searching for: '{search_query}'")
search_function = web_surfer_plugin["web_search"]
# Note: In SK v1+, invoke needs keyword arguments or a KernelArguments object
result = await kernel.invoke(search_function, query=search_query, max_results=3)
print("Search Results:")
# The result of web_search is a list of Pydantic models,
# SK might wrap primitive types or require explicit handling.
# Assuming direct access or appropriate parsing based on SK version:
if isinstance(result.value, list): # Check if the result is directly the list
for item in result.value:
print(f"- {item.title}: {item.url}")
else:
print(f"Raw result: {result}") # Adjust parsing as needed
# --- Example: Summarize a webpage ---
page_url = "https://learn.microsoft.com/en-us/semantic-kernel/overview/"
print(f"\nSummarizing: {page_url}")
summarize_function = web_surfer_plugin["summarize_webpage"]
summary_result = await kernel.invoke(summarize_function, url=page_url)
print(f"Summary:\n{summary_result}")
if __name__ == "__main__":
asyncio.run(main())
📁 FileSurfer Plugin (agentic_kernel.plugins.file_surfer)
Allow your agent to safely interact with files on the local system within designated boundaries.
- List Files: Browse directories and find files matching specific patterns.
list_files(pattern: str = "*", recursive: bool = False)-> Returns file details (name, path, size, type, modified date).
- Read Files: Extract the content of specific text-based files.
read_file(file_path: str)-> Returns file content as a string.
- Search File Content: Locate files containing specific text.
search_files(text: str, file_pattern: str = "*")-> Returns list of files where the text was found.
Important Security Note: This plugin must be initialized with a base_path to restrict file operations to a specific directory, preventing unintended access to sensitive areas of the file system.
Quick Start:
import asyncio
import semantic_kernel as sk
from pathlib import Path
from agentic_kernel.plugins.file_surfer import FileSurferPlugin
async def main():
kernel = sk.Kernel()
# --- Setup: Create a safe directory for the example ---
safe_dir = Path("./agent_files_example").resolve() # Use resolve() for absolute path
safe_dir.mkdir(exist_ok=True)
(safe_dir / "notes.txt").write_text("Meeting notes: Discuss project Alpha.")
(safe_dir / "report.md").write_text("# Project Beta Report\nStatus: Ongoing.")
print(f"Created example files in: {safe_dir}")
# --- Initialize and add the plugin ---
# CRITICAL: Always define a safe base_path!
file_surfer = FileSurferPlugin(base_path=safe_dir)
file_plugin = kernel.add_plugin(file_surfer, "FS") # Short name 'FS'
# --- Example: List text files ---
print("\nListing '.txt' files:")
list_func = file_plugin["list_files"]
list_result = await kernel.invoke(list_func, pattern="*.txt")
if isinstance(list_result.value, list):
for f in list_result.value:
print(f"- {f.name} (Modified: {f.last_modified})")
else:
print(f"Raw result: {list_result}")
# --- Example: Read a specific file ---
print("\nReading 'notes.txt':")
read_func = file_plugin["read_file"]
read_result = await kernel.invoke(read_func, file_path="notes.txt")
print(f"Content:\n{read_result}")
# --- Example: Search for files containing 'Project' ---
print("\nSearching for files with 'Project':")
search_func = file_plugin["search_files"]
search_result = await kernel.invoke(search_func, text="Project", file_pattern="*.md")
if isinstance(search_result.value, list):
for f in search_result.value:
print(f"- Found in: {f.name}")
else:
print(f"Raw result: {search_result}")
# --- Cleanup: Remove example directory ---
print("\nCleaning up example files...")
for item in safe_dir.iterdir():
item.unlink()
safe_dir.rmdir()
print("Cleanup complete.")
if __name__ == "__main__":
asyncio.run(main())
Installation
Get started with AgenticFleet Labs plugins in your project quickly.
Prerequisites:
- Python 3.10+
- An existing Python project with Semantic Kernel installed.
piporuv(recommended) package manager.
Steps:
-
Install the package:
-
Using
pip:pip install agentic-kernel
(Note: Replace
agentic-kernelwith the actual package name on PyPI once published) -
Using
uv:uv pip install agentic-kernel
(Note: Replace
agentic-kernelwith the actual package name on PyPI once published) -
For development/local use: If you've cloned the repository (
git clone ...), you can install it in editable mode from the project directory:# Activate your project's virtual environment first! # Using pip: pip install -e . # Using uv: uv pip install -e .
-
-
Import and use the plugins in your Semantic Kernel application as shown in the examples above.
Contributing & Development
Interested in contributing to AgenticFleet Labs or developing the plugins further? We welcome your help!
Quick Setup for Development:
- Clone:
git clone https://github.com/AgenticFleet/AgenticFleet-Labs.git && cd AgenticFleet-Labs - Environment:
uv venv && source .venv/bin/activate(or use standardpython -m venv .venv) - Install Dev Dependencies:
uv pip install -e ".[test,dev]"(orpip install -e ".[test,dev]") - Install Hooks:
pre-commit install
Key Development Tasks:
- Run Tests:
uv run pytest(orpytest) - Format & Lint:
uv run ruff format . && uv run ruff check --fix .(or useruffdirectly) - Type Check:
uv run mypy .(ormypy .)
Please refer to our Contribution Guidelines (link to be created) for more details on the development process, coding standards, and submitting pull requests. We also use tasks.md to track ongoing work.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Need Help?
If you encounter issues or have questions, please file an issue on the GitHub repository.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentic_kernel-0.1.0.tar.gz.
File metadata
- Download URL: agentic_kernel-0.1.0.tar.gz
- Upload date:
- Size: 59.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c60e5291d49e6dd2f79e71d96939764fe9f0d88906a96f4d59c6ae8219565a95
|
|
| MD5 |
6488ab87c1050812dc0c4db28cedba16
|
|
| BLAKE2b-256 |
1194519d6fce235c57ccb9f15d6f9cf1af763b3dae92a5dacd85a8db1b649777
|
File details
Details for the file agentic_kernel-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentic_kernel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 50.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e729492956c40cf965a8a92e6f5fb33e295f11fd1b6dfb9a945a79a688ca7c1
|
|
| MD5 |
65728da1b57ad007f4fb78bf6ec06d56
|
|
| BLAKE2b-256 |
05c1a4394c7784085b44b88067e07b3b439ee3a96b1e8432c21cfb5414bdab77
|