Skip to content

Frontend enabling work#26

Open
foolishsailor wants to merge 37 commits intoeumemic:masterfrom
foolishsailor:feInitialSetup
Open

Frontend enabling work#26
foolishsailor wants to merge 37 commits intoeumemic:masterfrom
foolishsailor:feInitialSetup

Conversation

@foolishsailor
Copy link
Copy Markdown
Contributor

@foolishsailor foolishsailor commented Apr 16, 2023

  • BE moved in agents-controller folder
  • frontend repo using react and vite created
  • devops yml updated to run/build both repos
  • proof of concept streaming of messages displayed in list in FE
  • send messages to agents from FE

Ready for merge will be merging this locally with my dev branch and start a new branch to add a control bar with buttons etc for things like: stop/start agent, add ability to clikc an agent and send message to that agent etc

@foolishsailor
Copy link
Copy Markdown
Contributor Author

judging by all the red above ill have to sort the yml...

Comment thread frontend/src/components/agentStram.tsx Outdated
@@ -0,0 +1,131 @@
import React, { useEffect, useState } from 'react';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just a typo in file name ;)
frontend/src/components/agentStream.tsx

@foolishsailor foolishsailor marked this pull request as ready for review April 18, 2023 14:04
@eumemic eumemic changed the title Fe initial setup Frontend enabling work Apr 19, 2023
Copy link
Copy Markdown
Owner

@eumemic eumemic left a comment

Choose a reason for hiding this comment

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

Thanks! This mostly looks good but I think there's some unnecessary changes included here.

Comment thread .eslintrc.js Outdated
Comment on lines +13 to +15
ecmaFeatures: {
jsx: true,
},
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

We don't need this any more since you moved the actual frontend code out, right?

Suggested change
ecmaFeatures: {
jsx: true,
},

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.

yep leftt over will remove

Comment thread .github/workflows/ci.yml Outdated

jobs:
build:
build_agent_controller:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can we revert this?

Suggested change
build_agent_controller:
build:

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.

will revert

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +15 to +14
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Curious why node 14 is no longer supported?

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.

wasnt building in CI/CD due to my machine creating a newer version of lockfile?

Comment thread .github/workflows/ci.yml Outdated

- name: Install dependencies
run: npm ci
run: npm i
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why this change?

Comment thread README.md Outdated

```
npm run start [# of agents] [gpt-3.5-turbo|gpt-4]
npm run start agents=[# of agents] model=[gpt-3.5-turbo|gpt-4] test=[true|false]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This seems like the only change in this file that's relevant to this PR, can we revert the rest? In particular I don't understand why you removed the part at the top with the discord link or the action errors section.

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.

Ahh shite - that was unintentional - I had split our the readme to the parent readme for the rpo - which contained all the info like the disord linked and it had two links to the backend readme and the frontend readme. This was just the backend readme. It needs to be reintegrated with the monorepo readme

Comment thread src/web-socket-server.ts Outdated
Comment on lines +32 to +34
if (test) {
generateObjectEveryTwoSeconds();
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Something about this leaves a bad taste in my mouth. I'd rather not have the core code responsible for generating test data based on a CLI parameter. Rather, it would be better if we could stand up a normal server and then have an external test script pump in fake data if we want to run tests.

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.

im ok with this, this was a quick and easy process to help build the FE without a mock data server running. Will remove

Comment thread README.md
Comment on lines +1 to +14
### Agent state

Each agent stores its state under the `.store` directory. Agent 1, for example has

```
.store/1/memory
.store/1/goals
.store/1/notes
```

You can simply delete any of these things, or the whole agent folder (or the whole `.store`) to selectively wipe whatever state you want between runs. Otherwise agents will pick up where you left off on restart.

A nice aspect of this is that when you want to debug a problem you ran into with a particular agent, you can delete the events in their memory subsequent to the point where the problem occurred, make changes to the code, and restart them to effectively replay that moment until you've fixed the bug. You can also ask an agent to implement a feature, and once they've done so you can restart, tell them that you've loaded the feature and ask them to try it out.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Somehow this duplicate content got added to the top of the README now.

Suggested change
### Agent state
Each agent stores its state under the `.store` directory. Agent 1, for example has
```
.store/1/memory
.store/1/goals
.store/1/notes
```
You can simply delete any of these things, or the whole agent folder (or the whole `.store`) to selectively wipe whatever state you want between runs. Otherwise agents will pick up where you left off on restart.
A nice aspect of this is that when you want to debug a problem you ran into with a particular agent, you can delete the events in their memory subsequent to the point where the problem occurred, make changes to the code, and restart them to effectively replay that moment until you've fixed the bug. You can also ask an agent to implement a feature, and once they've done so you can restart, tell them that you've loaded the feature and ask them to try it out.

Comment thread src/agent.ts
Comment on lines +61 to +81
const t0 = Date.now();
this.messageBus.send(
messageBuilder.agentToAgent(
this.id,
[AGENT_ID],
`Reflecting on ${events.length} events...`
)
);

const actionText = await makeDecision(events);

this.messageBus.send(
messageBuilder.agentToAgent(
this.id,
[AGENT_ID],
`Arrived at a decision after ${((Date.now() - t0) / 1000).toFixed(
1
)}s \n\n ${actionText}`
)
);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I don't think we need to send these as messages to the control agent. If the user is interested in when the agent is thinking they will presumably be using your UI to monitor it.

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.

3 participants