Skip to content
No description, website, or topics provided.
Python JavaScript HTML Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea feat: historian agent implemented. Documentation updated. Nov 28, 2019
docs Bump version: 0.4.9-dev0 → 0.4.9 Nov 30, 2019
frontend fix: frontend static files added Nov 30, 2019
munggoggo fix: missing swagger theme Dec 6, 2019
rmq init Oct 31, 2019
scripts init Oct 31, 2019
static fix: missing swagger theme Dec 6, 2019
.bumpversion.cfg Bump version: 0.4.9-dev0 → 0.4.9 Nov 30, 2019
.env feat: sql_agent added Nov 29, 2019
.envrc chore: clean up environment Nov 27, 2019
.gitignore hygiene: update and cleanup Nov 27, 2019
.readthedocs.yml . Nov 29, 2019
Makefile fix: missing swagger theme Dec 6, 2019
Pipfile . Nov 30, 2019
Pipfile.lock . Nov 30, 2019
README.rst fix: missing swagger theme Dec 6, 2019
README_DEV.md
VERSION Bump version: 0.4.9-dev0 → 0.4.9 Nov 30, 2019
agent1.py Bump version: 0.4.7 → 0.4.8-dev0 Nov 29, 2019
agent2.py Bump version: 0.4.6-dev0 → 0.4.7-dev0 Nov 29, 2019
agent_minimal.py
asgi.py Bump version: 0.4.6-dev0 → 0.4.7-dev0 Nov 29, 2019
ctrl.py
historian.py Bump version: 0.4.6-dev0 → 0.4.7-dev0 Nov 29, 2019
munggoggo.cast
munggoggo.png Bump version: 0.4.5-dev0 → 0.4.6-dev0 Nov 29, 2019
ping_agent.py Bump version: 0.4.6-dev0 → 0.4.7-dev0 Nov 29, 2019
pyproject.toml Bump version: 0.4.6-dev0 → 0.4.7-dev0 Nov 29, 2019
requirements.txt . Nov 29, 2019
run_tests.sh feat: messages traces for outgoing rmq messages Nov 30, 2019
setup.py init Oct 31, 2019
test_ctrl.py feat: format output Dec 5, 2019

README.rst

Munggoggo

A modern message based async agent framework

An asyncio based agent platform written in Python and based on RabbitMQ. Agents are isolated processes which can host multiple parallel running behaviours as business logic and can be deployed as dedicated pods in a kubernetes cluster. WEB communication access to the agent network via REST/HTTP, websocket and jsonrpc.

Documentation: https://munggoggo.readthedocs.io/en/latest/

from mode import Worker
from behaviour import Behaviour
from core import Core


class Agent(Core):
    class PingBehav(Behaviour):
        async def setup(self):
            self.counter = 0

        async def run(self):
            self.counter += 1
            msg = await self.receive()
            if msg:
                print(f"{self.name}: Message received: {msg.body.decode()}")
            await self.publish(str(self.counter), 'ping')
            await asyncio.sleep(0.9)

    async def setup(self) -> None:
        """ Register behaviour and subscribe to 'ping' topic """
        await self.add_runtime_dependency(self.PingBehav(self, binding_keys=['ping']))


if __name__ == '__main__':
    Worker(Agent(identity='Agent'), loglevel="info").execute_from_commandline()

This gets you an agent which publishes and reads messages from the message bus on topic: ping.

Features

  • asyncio based agent framework.
  • RabbitMQ messaging backend.
  • Basic agents provided as building blocks.
  • agents can have (multiple) behaviours!
  • agents and their behaviours form a graph and can be visualized.
  • communication model: broadcast, point-to-point, topics pub-sub, RPC
  • WEB RPC
  • React based frontend using WebSockets
  • Python >= 3.7
  • ASGI framework, the future of Python web services!
  • A built in testing agent for the web ....
  • Capability of running within uvicorn.
  • OpenAPI schema generation, with interactive documentation!
  • Single-page webapp support.

Web features powered by Starlette.

Installing Munggoggo

Install docker and docker-compose.

$ git clone https://github.com/sysid/munggoggo.git
$ cd munggoggo; pipenv install
✨🍰✨

Only Python 3.7+ is supported.

Start RabbitMQ as communication backend.

# prerequisite: docker, docker-compose installed
cd rmq
docker-compose up

Start demo agents and WEB user interface in separate terminals:

# terminal1
python agent1.py

# terminal2
python agent2.py

# terminal3
python asgi.py

To see the frontend go to http://localhost:8000/static/frontend/index.html.

The Basic Idea

The basic idea is a combination of several best practices I came across during my work on agent based systems and consolidate them into a single framework, along with some new ideas I have. Not everything is 100% full quality (yet), so see it as proof of concept rather than production ready software!

User Guides

A modern message based async agent framework: version (0.4.9)

.. toctree::
   :maxdepth: 2

   tour
   agents
   core
   behaviour
   asgi
   messages


Ideas

Indices and tables

You can’t perform that action at this time.