Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split agents to separate app #17

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Split agents to separate app #17

wants to merge 2 commits into from

Conversation

timonv
Copy link
Member

@timonv timonv commented Oct 8, 2023

Draft concept split into two parts.

Everything agent goes to ruby agents, everything else stays in deckhand.

Conceptialliy, main app pushes events via AMQP for agents to pick up and process. Agents can also push events to trigger new agents and push back to the main app.

In terms of code changes:

  • deckhand: remove all agent code, remove all agent related tests
  • deckhand: replace agent calls with AMQP events
  • agents: replace all necessary ORM calls with AMQP events

For this to merge, to keep the scope small, I'd suggest to not split up agents, add new functionality / tests or change the way agents work. Just replace the calls with AMQP events and keep the rest as is.

@timonv timonv added the draft label Oct 8, 2023
@timonv
Copy link
Member Author

timonv commented Oct 8, 2023

Todo for later:

  • Setup sneakers to run the agents
  • Summarize all different queue names
  • Some sql updates moved to amqp are probably missing context / relations now
  • Ensure otel sees it as seperate service
  • Maybe test it

}
)
# TODO: should be pushed to amqp instead
AmqpConnection.instance.publish_on_channel('agents.events', type: 'prompt', content: { prompt: result.prompt, response: result.full_response }.to_json)
Copy link
Member Author

Choose a reason for hiding this comment

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

naming


def initialize(assignment, codebase: nil, **kwargs)
@codebase_id = codebase.id
super(assignment, **kwargs)
end

def codebase
Codebase.find(codebase_id)
raise "finding codebase not allowed"
Copy link
Member Author

Choose a reason for hiding this comment

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

tragedy waiting to happen

context.agent_run.events.create!(event_hash: context.history.last)
# TODO: should post agent run updates to amqp instead
AmqpConnection.instance.publish_on_channel("agents.update", context.agent_run.as_json)
AmqpConnection.instance.publish_on_channel("agents.event", context.agent_run.events.last.as_json)
Copy link
Member Author

Choose a reason for hiding this comment

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

naming

Copy link
Member

Choose a reason for hiding this comment

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

I like it, maar misschien AmqpConnection.instance.publish_on_channel nog even abstraheren naar iets als Message.publish('agents.update', context.agent_run.as_json) ofzo zodat we gemakkelijk Amqp uit kunnen swappen of mocken als nodig.

@tinco
Copy link
Member

tinco commented Oct 9, 2023

Sneakers ziet er gaaf uit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants