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

v0.1-alpha - Multi-step Agents & Planning #35

Merged
merged 205 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
6ff9ae5
nginx+uvicorn support
kreneskyp Apr 12, 2023
ae11a48
don't double report logs in test failure output
kreneskyp Apr 23, 2023
95faa5b
Adding new ChatView oriented around chats. Adds content rendering for…
kreneskyp Apr 23, 2023
e61654d
dont rebuild npm unless packages change
kreneskyp Apr 23, 2023
2cb46f7
linting js
kreneskyp Apr 23, 2023
5fa5a82
format messages better for agent context
kreneskyp Apr 23, 2023
7169fb8
adding Plan, PlanSteps, and Artifact models
kreneskyp Apr 23, 2023
9826899
Adding agent class as a config option. Including factory method and u…
kreneskyp Apr 23, 2023
1e48ee6
adding more tmp dirs to gitignore
kreneskyp Apr 23, 2023
603a362
Consolidate AgentProcess error handling for AI interactions
kreneskyp Apr 23, 2023
557624f
AgentProcess now stores a reference to the last message instead of ju…
kreneskyp Apr 23, 2023
ce31221
allow autonomous mode to be disabled entirely
kreneskyp Apr 23, 2023
cab55a6
factor AutoAgent out of AgentProcess
kreneskyp Apr 23, 2023
ec9c600
adding GenerativeAgent and PlanningAgent classes
kreneskyp Apr 23, 2023
e625ab8
Component for rendering Plans
kreneskyp Apr 23, 2023
7a540eb
add models for Chats
kreneskyp Apr 23, 2023
4200a18
update schema to add Chat, Artifact, and other types
kreneskyp Apr 23, 2023
940fdcc
fix double logging by celery worker
kreneskyp Apr 25, 2023
387272b
adding plans/tasks to chat sidebar
kreneskyp Apr 25, 2023
e2ef1e3
message_id no longer displayed for EXECUTE_ERROR
kreneskyp Apr 25, 2023
70d9917
fix call to AgentProcess.log_exception
kreneskyp Apr 25, 2023
40cf821
optimize planning prompt
kreneskyp Apr 25, 2023
e125c37
add chat to INSTALLED_APPS
kreneskyp Apr 25, 2023
9e741a0
fix double logging in test output
kreneskyp Apr 25, 2023
54b0340
try to ignore generated file
kreneskyp Apr 25, 2023
6defcd7
Add fake_chat method
kreneskyp Apr 25, 2023
45d1ee5
fixes to fake methods to work with agent class loader and AgentProces…
kreneskyp Apr 25, 2023
426df2b
fake_agent fixes:
kreneskyp Apr 25, 2023
3fa1fe5
Add sidebar to chat for Plans & Tasks
kreneskyp Apr 25, 2023
93d96c5
mount ipython state in docker-compose for persistant history and config
kreneskyp Apr 25, 2023
5a34ae9
Chain breaking events are now raised as exceptions
kreneskyp Apr 26, 2023
e2bcf45
optimize planning query
kreneskyp Apr 26, 2023
f7ebedd
log messages from AI interaction
kreneskyp Apr 26, 2023
07f8c44
push prompt down into subclasses
kreneskyp Apr 26, 2023
1555bbf
enable mock responses from AI
kreneskyp Apr 26, 2023
a74023c
update input flow to handle both auto and generative flows
kreneskyp Apr 26, 2023
601cc2d
optimize planning prompt
kreneskyp Apr 26, 2023
0be6150
linting
kreneskyp Apr 26, 2023
e41e6df
ThoughtContent should render when missing usage stats
kreneskyp Apr 28, 2023
1e4b66f
Convert to langchain:
kreneskyp Apr 28, 2023
625c59c
linting
kreneskyp May 1, 2023
ad07664
PlanContent now includes an AuthorizeButton
kreneskyp May 1, 2023
38cb4e0
ThinkContent no longer echos user_input
kreneskyp May 1, 2023
3546a59
add utility for catching errors in graphene queries where they may be…
kreneskyp May 1, 2023
5bc0641
move chains to top level
kreneskyp May 1, 2023
f009c64
adding chains app with models for storing langchain chains
kreneskyp May 1, 2023
e0601fe
adding API schema for chains
kreneskyp May 1, 2023
0b052a9
adding UX to list and display chains
kreneskyp May 1, 2023
eb6a37c
fixing light mode colors in navigation
kreneskyp May 1, 2023
9cf0173
add NPM packages and webpacj updates needed for chains UX
kreneskyp May 1, 2023
3118f05
Adding updated migrations for Chat and Tasks
kreneskyp May 1, 2023
95f62e1
Updates to AgentProcess:
kreneskyp May 1, 2023
162bb3a
remove mock responses, needs to be pushed down into chain's llm settings
kreneskyp May 1, 2023
83a0f80
moving common functions to common location
kreneskyp May 2, 2023
8fe6a10
Task status icons now display correctly based on status
kreneskyp May 2, 2023
49a0c41
backend for creating new chats
kreneskyp May 2, 2023
78564cc
replace Add Task button with Add Chat button
kreneskyp May 2, 2023
7a3c483
linting
kreneskyp May 2, 2023
6055f0b
default agent fixture now has classpath
kreneskyp May 2, 2023
b9aedff
RunPlan now saves EXECUTE messages and updates is_complete flags as i…
kreneskyp May 2, 2023
a240acd
Moving authorize to work on artifacts. This breaks from the auto-agent
kreneskyp May 2, 2023
4a13a6a
wrong kwarg used to send user_input
kreneskyp May 2, 2023
d275bd4
optimizing migrations
kreneskyp May 2, 2023
7d16747
adding fixture for planning chain
kreneskyp May 2, 2023
42b03db
missing import
kreneskyp May 2, 2023
add409d
IxCallback handler now correctly applied to llms
kreneskyp May 3, 2023
2ada42a
Agent model cleanup:
kreneskyp May 3, 2023
06d81e0
Fixed planning chain fixture, and moved to correct app
kreneskyp May 4, 2023
c62b12d
linting
kreneskyp May 4, 2023
63fcb8d
Chat is now the default route
kreneskyp May 4, 2023
03efdc0
AgentCard now displays chain info
kreneskyp May 4, 2023
032055e
AgentEditor can now be opened again from AgentCard in ChatView
kreneskyp May 4, 2023
1ab6ec6
add syntax highlighter and apply it to command output, streamline Pla…
kreneskyp May 5, 2023
c61edaf
refactoring input setup to fix priority of inputs and to make it exte…
kreneskyp May 5, 2023
15ff1da
AgentProcess now loads the chain from the task's agent
kreneskyp May 5, 2023
a8ec24b
ParseJSON now allows input/output key to be configured
kreneskyp May 6, 2023
67e1e5f
linting
kreneskyp May 6, 2023
ef257c8
Split out JSON parsing into separate function
kreneskyp May 6, 2023
7a54af7
Adding LLMChain and LLMToolChain classes that encapsulate chat prompt…
kreneskyp May 6, 2023
5697177
Adding planner v1 command as example script.
kreneskyp May 6, 2023
397ca60
linting
kreneskyp May 6, 2023
9e5df70
remove Task.goals and update fake methods
kreneskyp May 6, 2023
d54a4c8
Add artifact list to sidebar
kreneskyp May 7, 2023
a122589
fix formatting and colormode for SideBarPlanList
kreneskyp May 7, 2023
14dc05c
PlanContent simpler format, highlighted artifacts
kreneskyp May 7, 2023
84ffde1
Plans are now set to isDraft=False when running them
kreneskyp May 7, 2023
dde2b36
renaming artifact reference to storage to be more clear
kreneskyp May 7, 2023
2518d81
PlanSteps now have an auto-set `order` field
kreneskyp May 7, 2023
15eac90
save entire traceback when logging exception
kreneskyp May 7, 2023
eb5b377
RunPlan now saves artifacts for each step
kreneskyp May 7, 2023
1368b0f
add migration for PlanSteps.order
kreneskyp May 7, 2023
f5df422
simplifying execute messages until artifact info can be added
kreneskyp May 7, 2023
e433010
list components were missing keys on their children
kreneskyp May 7, 2023
65afb8a
AgentCardModalButton is now a reusable AgentDetailModalButton
kreneskyp May 7, 2023
4ca1e16
AssistantAvatar updated to prep for custom icons per agent
kreneskyp May 7, 2023
9e598cb
Chat sidebar's AgentCard has been replaced with SideBarAgentList
kreneskyp May 7, 2023
d78ecd3
various styling update to sidebar and artifact detail
kreneskyp May 7, 2023
b3dbbbf
update TaskLogLeftPane to use updated AgentDetailModalButton
kreneskyp May 7, 2023
ba3b0b0
only reset the planning chain when run
kreneskyp May 8, 2023
262345c
Add planning chain v3 script
kreneskyp May 8, 2023
fa9210a
add prototype chat moderation chain
kreneskyp May 8, 2023
a6a4fc4
adding fixtures for planning_v3 and moderator_v1. Updating make dev_f…
kreneskyp May 8, 2023
5726585
default_agent fixture now creates a planner and moderator
kreneskyp May 8, 2023
97cadd8
add chat alias to Agent model and UX
kreneskyp May 9, 2023
051c1b5
adding some missing fields from queries
kreneskyp May 9, 2023
674c6a8
Artifact storage now clearer in ArtifactDetail
kreneskyp May 9, 2023
e70cc80
making ChatMutationResponse a generic response for all chat updates
kreneskyp May 9, 2023
d43c293
PlanContent now handles overflowing content better
kreneskyp May 9, 2023
60b9ed5
strip createdAt out of AgentEditor data since it cant be updated
kreneskyp May 9, 2023
15dbb31
adding missing agent fields to multiple queries
kreneskyp May 9, 2023
0fb832f
linting
kreneskyp May 9, 2023
4d248aa
default messages when sidebar content is empty
kreneskyp May 13, 2023
ebb191c
add mock point
kreneskyp May 13, 2023
f6875df
moving think_msg up since it's needed for exceptions
kreneskyp May 13, 2023
111b558
Fixing unittests:
kreneskyp May 13, 2023
ffa7cda
make nav a bit darker
kreneskyp May 13, 2023
593c0ea
linting
kreneskyp May 13, 2023
7346481
reference was renamed storage
kreneskyp May 13, 2023
10ec54a
THINK messages should be from assistant
kreneskyp May 13, 2023
b4ce196
don't mutate message_config
kreneskyp May 13, 2023
9834092
model updates:
kreneskyp May 13, 2023
e31981c
Split CommandContent and AssistantContent
kreneskyp May 14, 2023
d320264
Display agent alias and Assistant icon when message contains agent
kreneskyp May 14, 2023
91fb820
Convert SendFeedback to ChatInput
kreneskyp May 14, 2023
54e8320
add notices when there are no plans or artifacts yet
kreneskyp May 14, 2023
47bd1ca
More conversion to ChatInput
kreneskyp May 14, 2023
c088673
remove goals from more queries
kreneskyp May 14, 2023
33ba909
Refactoring AgentProcess:
kreneskyp May 14, 2023
f519520
Adding LLMReply which is a basic Chain that records model response as…
kreneskyp May 14, 2023
ebe203f
ChatModerator chain now functional, includes tests
kreneskyp May 14, 2023
d8b72b5
Add Task.parent to enable subtask tracking. TaskLogMessage stream now…
kreneskyp May 14, 2023
4ff0e36
skip planner test since it isn't mocked yet
kreneskyp May 14, 2023
b17e461
update ChatInputMutation for updated AgentProcess and runner
kreneskyp May 14, 2023
35a3759
linting
kreneskyp May 14, 2023
0328e9a
add Task.delegate_to_agent util method
kreneskyp May 14, 2023
e4a5442
regenerate for updates
kreneskyp May 14, 2023
63cbbba
add Agent.alias
kreneskyp May 14, 2023
318fb3d
removing usage from thought content until it can be fetched again
kreneskyp May 14, 2023
85b0dad
add two more example agents
kreneskyp May 14, 2023
ace0bb8
another feedback to input change
kreneskyp May 14, 2023
ae84050
linting
kreneskyp May 14, 2023
aefd0a0
moving more common fixtures to conftest
kreneskyp May 14, 2023
e84d22e
add mutations for adding and removing an agent from chat
kreneskyp May 14, 2023
1e78978
Agents can now be added and removed from a chat
kreneskyp May 14, 2023
f7c4185
add searchAgents query, add more tests for add/remove agent
kreneskyp May 14, 2023
b6556d6
Merge branch 'nginx' into agent_sockets
kreneskyp May 15, 2023
549abaa
configure asgi app to support both http and websockets
kreneskyp May 15, 2023
6af30f2
fix command startup
kreneskyp May 15, 2023
99dc761
configure relay environment for websocket
kreneskyp May 15, 2023
dfc5f73
reenable django-channels
kreneskyp May 15, 2023
a9b6c1b
Add ChatMessages component that receives realtime updates through gra…
kreneskyp May 15, 2023
67a6a44
Fix relay environment and add needed library
kreneskyp May 15, 2023
ce256db
add ChatMessageSubscription to graphene schema
kreneskyp May 15, 2023
d5fdc56
deprecated code
kreneskyp May 15, 2023
4a3cce3
fake_task_log_msg was not setting parent kwarg
kreneskyp May 15, 2023
dbe496e
ChatMessages now only subscribes once or after disconnect.
kreneskyp May 16, 2023
83a3ef8
ChatMessagesSubscription now binds to chat's task_ids, handles agent …
kreneskyp May 16, 2023
aad149a
moving redis cache to separate database from channels
kreneskyp May 16, 2023
8f15c07
connect ChatMessageSubscription to TaskLogMessage save
kreneskyp May 16, 2023
ceb00f2
only broadcast on new messages
kreneskyp May 16, 2023
88e7b5d
Moving chat message fetching higher up in the view
kreneskyp May 16, 2023
dc3a9d5
linting
kreneskyp May 16, 2023
7412278
fixing mocks for tests
kreneskyp May 16, 2023
32fcff1
Merge pull request #36 from kreneskyp/agent_sockets
kreneskyp May 16, 2023
a39e6f9
Message stream updates:
kreneskyp May 16, 2023
e66898c
Better light mode for ChatMessages
kreneskyp May 16, 2023
49d2680
light mode adjustments for left nav
kreneskyp May 16, 2023
a9c4b27
update light mode for chat agent management modal
kreneskyp May 16, 2023
534260e
more light/dark tweaks for messages
kreneskyp May 17, 2023
8bbb4a8
link more messages to their THINK messages
kreneskyp May 17, 2023
ce306f4
New Chat button now replaces current chat if there is one displayed
kreneskyp May 17, 2023
2a2612d
setup think_msg in chat fixture
kreneskyp May 17, 2023
9dc72c8
linting
kreneskyp May 17, 2023
7bd3c06
adding array util needed for handling message stream
kreneskyp May 18, 2023
23e8453
Adding ChatHistoryView, including graphql queries, and pagination uti…
kreneskyp May 19, 2023
7816fff
Authorizing plans now works again
kreneskyp May 19, 2023
02d5f04
always run celery in eager mode for tests
kreneskyp May 19, 2023
7cabf6b
linting
kreneskyp May 19, 2023
3558e02
update django for security fix
kreneskyp May 19, 2023
fec44c1
authorizations are grouped separately from messages and now shown in …
kreneskyp May 19, 2023
1c5c19a
fallback rendering to prevent full page failure
kreneskyp May 19, 2023
620a861
Add hook that returns colors for chain editor
kreneskyp May 19, 2023
a3fb9fe
ChainNode now uses colors from useEditorColorMode
kreneskyp May 19, 2023
ef98a98
callback_magnager.think_msg now propogates to child.
kreneskyp May 19, 2023
b2bd615
SavePlan ARTIFACT+AUTHORIZE and RunPlan EXECUTE messages now associat…
kreneskyp May 19, 2023
5b8cf85
Key wasn't on correct element in list
kreneskyp May 20, 2023
b061ba9
Adding MapSubchain for running a chain over a list of elements. Inclu…
kreneskyp May 20, 2023
f47c4a2
Update tests that were not mocking AgentProcess
kreneskyp May 20, 2023
51b532c
Reorganizing for clarity
kreneskyp May 20, 2023
6131111
NodeChain.load_chain now maps edges to edge.key for map types.
kreneskyp May 20, 2023
7bd6205
linting
kreneskyp May 20, 2023
70f6f6a
V0.1 docs + cleanup (#37)
kreneskyp May 20, 2023
e702d11
Add highlighting to mentions and artifacts tagged in ChatMessages
kreneskyp May 21, 2023
776ad11
Adding a fancier isThinking spinner to ChatMessage avatar.
kreneskyp May 21, 2023
55bef66
Adding SaveArtifact chain for generating artifacts
kreneskyp May 22, 2023
6a9f32c
Add Coder v1 + ArtifactContent refactor + FileArtifactContent
kreneskyp May 22, 2023
fc42cca
linting
kreneskyp May 22, 2023
bd7ad80
adding note about psycopg2 vs 3
kreneskyp May 22, 2023
4822650
increase timeout and max tokens for v3_planner
kreneskyp May 22, 2023
bf38283
Ix and CoderV1 now default agents for chat.
kreneskyp May 22, 2023
2d12061
updating data fixture setup to use management commands until fixtures…
kreneskyp May 22, 2023
5444269
V0.1docs part2 (#38)
kreneskyp May 22, 2023
2619bc1
Query for chain graph was missing node_type for root node, resulting …
kreneskyp May 22, 2023
8b0b5ec
fix borders in light mode
kreneskyp May 22, 2023
143b678
tweak colors for avatars so there isn't quite so much contrast in lig…
kreneskyp May 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ node_modules
.pyc
.coverage
__generated__
frontend/schema.graphql
.ipython

__pycache__

Expand All @@ -18,3 +20,6 @@ public
react-app-unused
tmp
workspace
.bak
*.bak
workdir
90 changes: 90 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@


## 0.1 - Alpha release of core functionality.

This is the first tagged release and it focuses on establishing some core functionality. This project is
still in the early stages of development and is not ready for general use. It is in a state that allows
developers to begin hacking chains and agents.

### Langchain
The `AgentProcess` has been converted to use langchain chains, LLM, and memory. This is introduces support for
multi-step LLM processes.

The default agent is now a zero-shot agent that runs a root chain. A `LLMToolChooser` may be used to replicate
decision making of an agent. Future releases will introduce additional agent types.

#### JSON Config
A custom JSON config loading mechanism was introduced for loading langchain chains. This allowed for loading
custom chain classes provided by Ix and integrating Ix specific functionality.

It is a goal to provide better interoperability between vanilla langchain config objects and Ix. This will
be explored in a future release.

#### Data model

New models `ChainNode` and `ChainEdge` were introduced to store langchain chains. This includes helper methods
to convert to/from `ChainNode` and `ChainEdge`, a json config, and a `Chain` instance.

#### Custom Chain types
Multiple custom chains were added to support the Ix style of implementing chains and to add flow control.

New basic chains:
- LLMToolChain: chain that has `tools` available in the prompt.
- LLMChain: wrapper around `langchain.LLMChain` to add config loader.
- LLMReply: chain that replies to a message with LLM prompt.
- ParseJSON: chain that parses a JSON string into a python object.

New routing / flow control chains:
- IxSequence: wrapper for Sequence that provides config loader
- MapSubchain: chain that runs a subchain for each value in a list
- ToolChooser: chain that chooses a tool with a subchain
- LLMToolChooser: chain that chooses a tool with LLM prompt

New chains were added:
- ChatModerator: moderates a chat by delegating tasks to other agents.
- Planner v3: plans and executes a sequence of tasks.

Test / Example chains were added:
- MockChain: echos inputs back for tests.
- Fake Weather: generates fake weather data.
- Dad Jokes: tells dad jokes.


### Multi-agent chat
Chats now include the ability to add multiple agents. The main agent is a moderator that delegates tasks
to the other agents. Agent's may be targeted directly by starting a message with a @mention.


### UX Updates

#### Chain viewer
This release introduces a chain viewer that allows the user to view a graphical representation of a chain. The
viewer will be converted to an editor in a future release.

#### Chat
- Chat replaces the task view as the default view
- Chat message updates are now over websockets for real-time updates.
- Chat messages are now grouped by execution to provide a clean and concise view of the chat.
- Chat messages now indicate the agent that sent the message.


#### Misc
- various tweaks to improve light/dark style

### Artifacts

This version introduces the artifact system. Artifacts represent the result of tasks the agent has performed.
It provides a type of object permanence and common understand for the agent. Artifacts are stored in the database
and can be viewed by the user or used by the agent in future tasks.

Future release will introduce the ability to reference artifacts in tasks and to create new artifacts
from existing ones.

### System

- Webserver is now Nginx and uvicorn to support websockets and http requests.
- Django upgraded to 4.2.1
- Switched to psycopg v3 for async query support.
- Django channels is now available for inter-process communication.
- ReactFlow is now available to frontend
- Webpack now supports css to support ReactFlow
29 changes: 20 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

DOCKER_COMPOSE=docker-compose.yml
DOCKERFILE=Dockerfile
DOCKER_REGISTRY=ghcr.io
Expand All @@ -7,8 +8,8 @@ IMAGE_TAG=$(shell cat $(HASH_FILES) | md5sum | cut -d ' ' -f 1)
IMAGE_URL=$(DOCKER_REPOSITORY):$(IMAGE_TAG)
IMAGE_SENTINEL=.sentinel/image

DOCKER_COMPOSE_RUN=docker-compose run --rm sandbox
DOCKER_COMPOSE_RUN_WITH_PORT=docker-compose run -p 8000:8000 --rm sandbox
DOCKER_COMPOSE_RUN=docker-compose run --rm web
DOCKER_COMPOSE_RUN_WITH_PORT=docker-compose run -p 8000:8000 --rm web

# set to skip build, primarily used by github workflows to skip builds when image is cached
NO_IMAGE_BUILD?=0
Expand Down Expand Up @@ -59,13 +60,13 @@ frontend: compose npm_install graphene_to_graphql compile_relay webpack

# install npm packages
.PHONY: npm_install
npm_install: compose
docker-compose run --rm sandbox npm install
npm_install: compose package.json
docker-compose run --rm web npm install

# compile javascript
.PHONY: webpack
webpack: compose
docker-compose run --rm sandbox webpack --progress
${DOCKER_COMPOSE_RUN} webpack --progress

# compile javascript in watcher mode
.PHONY: webpack-watch
Expand All @@ -75,19 +76,26 @@ webpack-watch: compose
# compile graphene graphql classes into schema.graphql for javascript
.PHONY: graphene_to_graphql
graphene_to_graphql: compose
docker-compose run --rm sandbox ./manage.py graphql_schema --out ./frontend/schema.graphql
${DOCKER_COMPOSE_RUN} ./manage.py graphql_schema --out ./frontend/schema.graphql

# compile javascript
.PHONY: compile_relay
compile_relay: compose
docker-compose run --rm sandbox npm run relay
${DOCKER_COMPOSE_RUN} npm run relay


# =========================================================
# Run
# =========================================================

# run backend and frontend
# run backend and frontend. This starts uvicorn for asgi+websockers
# and nginx to serve static files
.PHONY: server
server: compose
docker-compose up web nginx


# run django debug server, backup in case nginx ever breaks
.PHONY: runserver
runserver: compose
${DOCKER_COMPOSE_RUN_WITH_PORT} ./manage.py runserver 0.0.0.0:8000
Expand Down Expand Up @@ -126,7 +134,10 @@ migrations: compose
# load initial data needed for dev environment
.PHONY: dev_fixtures
dev_fixtures: compose
${DOCKER_COMPOSE_RUN} ./manage.py loaddata fake_user.json default_agent.json
${DOCKER_COMPOSE_RUN} ./manage.py loaddata fake_user
# use management commands for now since fixtures didn't load correctly
${DOCKER_COMPOSE_RUN} ./manage.py create_moderator_v1
${DOCKER_COMPOSE_RUN} ./manage.py create_coder_v1


# =========================================================
Expand Down
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ knowledge, casting a shadow of intrigue over the galaxy.

## About
<div>
iX is a platform to run semi-autonomous GPT-4 agents, providing a scalable and responsive solution for delegating tasks.
Agents can be spawned as individual processes to research and complete tasks through a web based interface while the
backend architecture efficiently manages message queues and inter-agent communication between a fleet of workers.
Ix is an experimental platform for designing and deploying semi-autonomous LLM agents. It provides a scalable and
responsive solution for delegating tasks to AI powered agents. The platform is designed to be extensible, allowing
developers to create custom agents and chains to perform a wide variety of tasks.

The backend is designed to support multiple agents running in parallel and communicating with each other. Each agent
may be customized and may utilize parallel processes to complete tasks.
<br>
<br>
The platform supports deployment using Docker containers, ensuring a consistent environment and enabling easy scaling
Expand All @@ -40,44 +43,41 @@ to multiple worker containers.

## How does it work

You provide a task and goals and an agent uses that direction to investigate, plan, and complete tasks. The agents are
### Basic Usage
You chat with an agent that uses that direction to investigate, plan, and complete tasks. The agents are
capable of searching the web, writing code, creating images, interacting with other APIs and services. If it can be
coded, it's within the realm of possibility for an agent to assist.
coded, it's within the realm of possibility that an agent can be built to assist you.

1. Start by create a task and goals for the agent to work towards.
![Dialog for entering task name and goals](docs/create_task.png)
1. Setup the server and visit `http://localhost:8000`, a new chat will be created automatically

2. The agent will begin researching and planning to complete the task.
![chat interface displaying log](docs/chat.png)
2. Enter a request and the Ix moderator will delegate the task to the agent best suited for the response. Or @mention
an agent to request a specific agent to complete the task.

3. The chat system provides an interaction model for the agent and user to communicate. The agent will respond to
user input and provide updates on its progress. The Agent will request additional information and authorization
from the user as needed.
3. Customized agents may be added or removed from the chat as needed to process your tasks

![chat interface displaying log](docs/chat_interactions.png)

4. Agents are customizable and can be extended to support new functionality. The platform provides a plugin architecture
for adding new agents and customizing existing agents.
![chat interface displaying log](docs/model_options.png)
### Creating Custom Agents and Chains

View the [documentation](docs/chains/chains.rst) to create custom agents and chains.


## Key Features

- Scalable model for running a fleet of GPT agents.
- Responsive user interface. for interacting with agents.
- Responsive user interface for interacting with agents.
- Persistent storage of interactions, processes, and metrics.
- Message queue for agent jobs and inter-agent communication.
- Extensible model for customizing agents.
- Deployment using Docker.


## Technologies:
## Stack:
- Python 3.11
- Django 4.2
- PostgreSQL 14.4
- Graphql
- Graphql / Graphene / Relay
- React 18
- Langchain
- Integrated with OpenAI GPT models
- Plugin architecture to support extending agent functionality (e.g. web browsing, writing code, etc)
- Generic framework for vector database based agent memory
Expand Down Expand Up @@ -131,7 +131,7 @@ make dev_setup
Run the dev server

```bash
make runserver
make server
```

Start a worker
Expand All @@ -155,7 +155,7 @@ Run as many worker processes as you want with `make worker`.
Here are some helpful commands for developers to set up and manage the development environment:

### Running:
- `make runserver`: Start the application in development mode on `0.0.0.0:8000`.
- `make server`: Start the application in development mode on `0.0.0.0:8000`.
- `make worker`: Start an Agent worker.

### Building:
Expand Down
1 change: 1 addition & 0 deletions bin/celery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
set -o errexit

CELERY_CONCURRENCY=${CELERY_CONCURRENCY:=1}
DJANGO_SETTINGS_MODULE=ix.server.celery_settings

celery -A ix worker --loglevel=info --concurrency=${CELERY_CONCURRENCY}
16 changes: 14 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ services:
POSTGRES_DB: ix
POSTGRES_HOST_AUTH_METHOD: trust

sandbox:
web:
image: ghcr.io/ix/sandbox:latest
#image: ghcr.io/ix:latest
command: uvicorn ix.server.asgi:application --host 0.0.0.0 --port 8001 --reload
ports:
- "8001:8001"
links:
- db
- redis
Expand All @@ -19,12 +23,21 @@ services:
#- .node_modules:/var/npm/node_modules
- ./bin:/usr/bin/ix
- .bash_profile:/root/.bash_profile
- .ipython:/root/.ipython
env_file:
- .env
environment:
DJANGO_SETTINGS_MODULE: "ix.server.settings"

nginx:
image: nginx:latest
ports:
- "8000:8000"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./.compiled-static:/var/static/
depends_on:
- web

worker:
image: ghcr.io/ix/sandbox:latest
Expand All @@ -41,7 +54,6 @@ services:
- .env



redis:
image: redis

Loading