A hackable and extendable framework for developing LLM-based multi-agentic systems.
Project description
Diskurs
Please note: diskurs is currently under development (meaning early alpha state) and not yet ready for production use.
Diskurs is a hackable and extendable Python framework for developing LLM-based multi-agentic systems to tackle complex workflow automation tasks. It allows developers to set up agent interactions using customizable configurations.
Features
- Multi-Agent System: Define and configure multiple agents with specific roles and interactions.
- Configurable Architecture: Use YAML configuration files to customize agents, tools, and dependencies.
- Extensible Tools: Integrate custom tools and modules to extend functionality.
- OpenAI and Azure OpenAI Integration: Supports integration with Azure OpenAI services for language models. (to be extended)
Installation
Diskurs requires Python 3.12 or higher.
Using Poetry
This project uses Poetry for dependency management. To install Diskurs and its dependencies:
-
Clone the repository:
git clone https://github.com/agentic-diskurs/diskurs.git cd diskurs
-
Install Poetry (if not already installed):
curl -sSL https://install.python-poetry.org | python3 -
For more details, refer to the official Poetry installation guide.
-
Install dependencies:
poetry install
Usage
Below is an example of how to launch Diskurs in your project:
import logging
from pathlib import Path
from dotenv import load_dotenv
from diskurs import create_forum_from_config, DiskursInput
logger = logging.getLogger(__name__)
logger.setLevel(level=logging.INFO)
ticket_content = """
Hello team, I cannot reach http://www.test.com:8080/ from my machine.
I tried to access it around 04.09.2024 at 1 AM. Please can you check what is wrong?
"""
load_dotenv()
diskurs_input = DiskursInput(
user_query=ticket_content,
metadata={"company_id": "3929", "proxy_instance": "academy-prx002-ch-zur-1"},
)
def main(config: Path):
forum = create_forum_from_config(config_path=config, base_path=Path(__file__).parent)
res = forum.ama(diskurs_input)
print(res)
if __name__ == "__main__":
main(Path(__file__).parent / "config.yaml")
Steps to Run
-
Set Up Configuration: Create a
config.yamlfile in your project directory. This file contains the necessary configurations for your agents, tools, and dependencies (see the Configuration section below). -
Load Environment Variables: Create a
.envfile or set environment variables in your system. This includes API keys and other sensitive information required by Diskurs.Example
.envfile:AZURE_OPENAI_API_KEY=your_azure_openai_api_key
-
Run the Script: Execute your Python script to start the forum interaction.
poetry run python your_script.py
Configuration
The config.yaml file is used to customize your agents, tools, and dependencies. Below is a condensed example configuration to help you set up your own:
first_contact: "Conductor_Agent"
toolExecutorType: "default"
dispatcherType: "synchronous"
customModules:
- "config"
- "tools.custom_tools"
llms:
- name: "gpt-4-base"
type: "azure"
modelName: "gpt-4-0613"
endpoint: "https://your-azure-endpoint.openai.azure.com"
apiVersion: "2023-03-15-preview"
apiKey: "${AZURE_OPENAI_API_KEY}"
agents:
- name: "Conductor_Agent"
type: "conductor"
llm: "gpt-4-base"
prompt:
type: "conductor_prompt"
location: "agents/Conductor_Agent"
userPromptArgumentClass: "ConductorUserPromptArgument"
systemPromptArgumentClass: "ConductorSystemPromptArgument"
longtermMemoryClass: "ConductorLongtermMemory"
canFinalizeName: "can_finalize"
topics:
- "Agent_A"
- "Agent_B"
- name: "Agent_A"
type: "multistep"
llm: "gpt-4-base"
prompt:
type: "multistep_prompt"
location: "agents/Agent_A"
systemPromptArgumentClass: "AgentASystemPrompt"
userPromptArgumentClass: "AgentAUserPrompt"
isValidName: "is_valid"
isFinalName: "is_final"
tools:
- "tool_x"
topics:
- "Conductor_Agent"
- name: "Agent_B"
type: "multistep"
llm: "gpt-4-base"
prompt:
type: "multistep_prompt"
location: "agents/Agent_B"
systemPromptArgumentClass: "AgentBSystemPrompt"
userPromptArgumentClass: "AgentBUserPrompt"
isValidName: "is_valid"
isFinalName: "is_final"
tools:
- "tool_y"
topics:
- "Conductor_Agent"
tools:
- name: "tool_x"
functionName: "function_x"
modulePath: "tools/custom_tools.py"
configs:
param1: "value1"
param2: "value2"
- name: "tool_y"
functionName: "function_y"
modulePath: "tools/custom_tools.py"
configs:
param1: "value1"
param2: "value2"
toolDependencies:
- type: "external_service"
name: "service_x"
url: "http://service-x-url"
port: 8080
Configuration Details
-
first_contact: Specifies the initial agent that interacts with the user's input.
-
llms: Configures the language models used by the agents. Replace
endpointandapiKeywith your Azure OpenAI endpoint and API key. -
agents: Defines the agents involved in the system, their types, prompts, tools, and interactions.
- name: Unique identifier for the agent.
- type: Agent type (
conductor,multistep, etc.). - llm: The language model the agent uses.
- prompt: Configuration for the agent's prompts.
- type: Type of prompt.
- location: Directory where prompt templates are stored.
- userPromptArgumentClass: Class name for user prompt arguments.
- systemPromptArgumentClass: Class name for system prompt arguments.
- longtermMemoryClass: Class for handling long-term memory (optional).
- canFinalizeName: Method name to check if the conductor agent can finalize the conversation.
- tools: List of tools the agent can use.
- topics: Agents that this agent can communicate with.
-
tools: Lists the tools that agents can use to perform specific tasks.
- name: Unique identifier for the tool.
- functionName: The function that implements the tool's logic.
- modulePath: Path to the Python module containing the tool.
- configs: Configuration parameters for the tool.
-
toolDependencies: Specifies external dependencies required by the tools.
- type: Type of the dependency (e.g.,
external_service). - name: Unique identifier for the dependency.
- url: URL of the external service.
- port: Port number for the service.
- type: Type of the dependency (e.g.,
Setting Up Your Own Configuration
-
Define Language Models: In the
llmssection, configure the language models your agents will use. Replace theendpointandapiKeywith your own Azure OpenAI details. -
Create Agents: In the
agentssection, define your agents. Specify their names, types, language models, prompts, tools they use, and the agents they interact with. -
Implement Prompts: For each agent, create the prompt templates and argument classes as specified in the
promptsection. These should be located in the paths you provide underlocation. -
Add Tools: In the
toolssection, list the tools your agents will use. Implement the tool functions in the specifiedmodulePath. -
Configure Dependencies: If your tools rely on external services or databases, specify them in the
toolDependenciessection. -
Environment Variables: Use environment variables for sensitive information like API keys. Reference them in your
config.yamlusing${VARIABLE_NAME}.
Dependencies
- Python 3.12 or higher
- Poetry for dependency management
- Required Python packages (specified in
pyproject.toml):diskurspython-dotenv- Other dependencies as specified in the repository
Contributing
Contributions are welcome! Please follow these steps:
-
Fork the repository on GitHub.
git clone https://github.com/agentic-diskurs/diskurs.git
-
Create a new branch for your feature or bug fix.
git checkout -b feature/your-feature-name
-
Commit your changes with clear messages.
git commit -m "Add new feature: description"
-
Push your branch to your forked repository.
git push origin feature/your-feature-name
-
Open a pull request detailing your changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For questions, issues, or suggestions, please open an issue on the GitHub repository.
Happy coding with Diskurs!
Project details
Release history Release notifications | RSS feed
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 diskurs-0.0.11.tar.gz.
File metadata
- Download URL: diskurs-0.0.11.tar.gz
- Upload date:
- Size: 33.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c96de53638aac7a84af18ae1ce7fc1af8e00e3169eae835af7586761ee160aa
|
|
| MD5 |
ed6fceb86f7d8278a3c2e516065768f6
|
|
| BLAKE2b-256 |
85e6537341316de4e8989811d982ed48b76c27f4c7acfe550e492db996367671
|
File details
Details for the file diskurs-0.0.11-py3-none-any.whl.
File metadata
- Download URL: diskurs-0.0.11-py3-none-any.whl
- Upload date:
- Size: 37.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56f672704315e98ca00246ad91cd2faf90226b698c59bfc800277dd6a5410c49
|
|
| MD5 |
3b402b871dc0383ca3f4e2129dd0c10c
|
|
| BLAKE2b-256 |
3385c588ab45cdc1a4940df6a853246f479c1b2e4048c8346901a5404927a126
|