Skip to content

MVP of ACS plus initial port of CLI to new ACS abstractions#91

Merged
andyk merged 13 commits intoagentos-project:masterfrom
nickjalbert:nj_init_clean
Jun 14, 2021
Merged

MVP of ACS plus initial port of CLI to new ACS abstractions#91
andyk merged 13 commits intoagentos-project:masterfrom
nickjalbert:nj_init_clean

Conversation

@nickjalbert
Copy link
Copy Markdown
Contributor

@nickjalbert nickjalbert commented Feb 13, 2021

Initial (rough) port of agentos {init, train, test} command-line tools to the new abstractions. Issuing this PR in case you all want to start writing code against these changes.

See design discussion here.

Demo

# Create new agent dir
mkdir andy_agent
cd andy_agent/

# Initialize your agent
agentos init . -n AndyAgent

# Train your agent in a loop for 5 iterations
agentos learn 5

# Run your agent against default corridor environment
agentos run

# Install 2048 as your environment
agentos install 2048

# Run your agent against 2048
agentos run

Limitations

This is a very rough first stab, some limitations:

  • I assume you will be running these commands within the agent directory (and don't support specifying custom agent.ini yet) train and run now support a -f flag to specify the agent.ini to use.
  • I skipped all but one two of the tests (😬). They'll come back online as we port example agents and run_agent to the new abstractions.
  • I added agentos test (instead of modifying agentos run)
  • General API instability

Next step

  • I'd like to port run_agent (and the dependent tests) to the new abstractions. Thoughts?
  • Reinstate the skipped tests
  • Porting over agents to use the new abstractions
  • Making a plan for action_space and observation_space in Policy

- agentos {init, train, test}
- agent.ini file
- functional basic agent
@nickjalbert nickjalbert requested review from andyk and trush February 13, 2021 08:22
@nickjalbert
Copy link
Copy Markdown
Contributor Author

Updated this PR to remove the Trainer abstraction.

@nickjalbert
Copy link
Copy Markdown
Contributor Author

Made some more progress on porting the core and CLI to the new abstractions.

@andyk
Copy link
Copy Markdown
Contributor

andyk commented Feb 14, 2021

Can you link to the design discussion thread in the first comment of this PR conversation?

@nickjalbert
Copy link
Copy Markdown
Contributor Author

Added a first cut at agentos install. Demo has been updated in this PR description.

Copy link
Copy Markdown
Contributor

@andyk andyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good first step towards a 0.0.8. Do we want to cut 0.0.7 before we merge this into master?

Comment thread agentos/agents.py
@@ -1,16 +1,31 @@
"""Implementation of agents available in AgentOS. See core.py for Agent API."""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we get rid of the agents module entirely and instead have a them available via the registry?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this makes sense. Maybe we punt on it for now because the tests use this at the moment?

Comment thread agentos/core.py
raise NotImplementedError


def run_agent(agent, hz=40, max_iters=None, as_thread=False):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should write down some user stories for the agentos.run_agent() helper function now that we have shifted towards an agent being defined by an agent.ini?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we talked about this before, but I forget where we came down on it: are we thinking we'll keep agentos.run_agent()?

Either way seems reasonable to me. An initial stab at a user story:

Agent developer incorporating RL into their tech stack
As a developer incorporating RL into my tech stack, I need to run experiments with different agent configurations to determine what flavor of RL is best suited to the business problem my work is addressing. Being able to programmatically interact with agents allows me to run these experiments as well as train and deploy my agent in a reproducible way.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I like sticking to a guiding philosophy where anything you can do from the CLI you can also do via Python API and vice versa.

Good user story, should we add it to the design doc w/ the others?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I like sticking to a guiding philosophy where anything you can do from the CLI you can also do via Python API and vice versa.

SGTM!

I'll add it to the design doc.

@nickjalbert
Copy link
Copy Markdown
Contributor Author

@andyk

Do we want to cut 0.0.7 before we merge this into master?

Just checking that I understand this proposal:

  • Update master so we're on version 0.0.7 (instead of 0.0.7-alpha)
  • Merge this PR
  • Call master 0.0.8-alpha (or whatever is after 0.0.7)

is that right? If so, sounds good to me!

@andyk
Copy link
Copy Markdown
Contributor

andyk commented Feb 20, 2021

@andyk

Do we want to cut 0.0.7 before we merge this into master?

Just checking that I understand this proposal:

* Update master so we're on version 0.0.7 (instead of 0.0.7-alpha)

* Merge this PR

* Call master 0.0.8-alpha (or whatever is after 0.0.7)

is that right? If so, sounds good to me!

Yeah, this is what I was thinking with one more step before these that you listed being: @trush to review and [if/when it's ready] merge #93

@andyk
Copy link
Copy Markdown
Contributor

andyk commented Feb 20, 2021

  • Call master 0.0.8-alpha (or whatever is after 0.0.7)

I propose we update the version to 0.1.0-alpha because it will change core abstractions quite a bit

@nickjalbert
Copy link
Copy Markdown
Contributor Author

@andyk branch and versioning plan sounds good to me!

@nickjalbert
Copy link
Copy Markdown
Contributor Author

97014da adds the ability to install 2048 via the agentos CLI. Demo updated.

@andyk
Copy link
Copy Markdown
Contributor

andyk commented Feb 23, 2021

@andyk branch and versioning plan sounds good to me!

Moving ahead with this plan in #102

@andyk andyk closed this Jun 14, 2021
@andyk andyk reopened this Jun 14, 2021
@andyk andyk merged commit 288e868 into agentos-project:master Jun 14, 2021
@andyk andyk changed the title Initial port of CLI to new abstractions MVP of ACS plus initial port of CLI to new ACS abstractions Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants