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

Integrating MemGPT-like Functionality #2937

Draft
wants to merge 42 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fd5adae
Edited Makefile
khushvind Jul 6, 2024
78be88f
updated num_retries
khushvind Jul 6, 2024
efc1c55
Merge remote-tracking branch 'upstream/main' into MemGPT
khushvind Jul 7, 2024
9ee63e1
Fix ruff issues and added summarizer
khushvind Jul 9, 2024
a4e2a18
Merge remote-tracking branch 'upstream/main'
khushvind Jul 10, 2024
507a67e
Merge remote-tracking branch 'upstream/main' into MemGPT
khushvind Jul 10, 2024
ccffdcc
added summarize function
khushvind Jul 14, 2024
4c3482f
Integrated MemGPT like functionality
khushvind Jul 14, 2024
4b1bf53
Integrated MemGPT like Functionality
khushvind Jul 14, 2024
de1b94b
Merge remote-tracking branch 'upstream/main'
khushvind Jul 15, 2024
5fc4ce4
Merge remote-tracking branch 'upstream/main' into MemGPT_Summarize_St…
khushvind Jul 15, 2024
85a8f4b
Retriving Summary
khushvind Jul 15, 2024
2845c2c
removed bugs
khushvind Jul 15, 2024
7a8299b
removed pip install -q -U google-generativeai from Makefile
khushvind Jul 16, 2024
a7a4c8a
removed bugs
khushvind Jul 18, 2024
0428dcc
Merge remote-tracking branch 'upstream/main' into MemGPT
khushvind Jul 19, 2024
bd9d14f
corrected the max_input_token
khushvind Jul 19, 2024
22e92d7
moved condenser configs to LLMConfig
khushvind Jul 19, 2024
d2b1ae1
fixed issue causing error in test on linux
khushvind Jul 20, 2024
1afd574
Merge remote-tracking branch 'upstream/main' into MemGPT
khushvind Jul 20, 2024
c43ed97
converted each message to Message class with additional attributes
khushvind Jul 21, 2024
6080071
Moved condenser functions to LLM class
khushvind Jul 22, 2024
515e038
removed condenser.py file
khushvind Jul 23, 2024
44d3c9d
Removed ContextWindowExceededError - TokenLimitExceededError already …
khushvind Jul 23, 2024
d93f5ee
Merge remote-tracking branch 'upstream/main' into MemGPT
khushvind Jul 25, 2024
0fece3f
Merge branch 'main' into MemGPT
khushvind Jul 25, 2024
d59be73
build condenser as mixin class
khushvind Jul 26, 2024
85b715d
build condenser as mixin class
khushvind Jul 26, 2024
7c5606d
Merge remote-tracking branch 'origin' into MemGPT
khushvind Jul 26, 2024
d9b3aae
Merge remote-tracking branch 'origin/MemGPT' into MemGPT
khushvind Jul 26, 2024
2a81073
Merge remote-tracking branch 'upstream/main' into MemGPT
khushvind Jul 26, 2024
140253c
replaced get_response with the original llm.completion
khushvind Jul 27, 2024
c7a3713
returning summarize_action to agent controller to add to memory
khushvind Jul 28, 2024
754a9c3
Merge remote-tracking branch 'upstream/main' into MemGPT
khushvind Jul 28, 2024
490b192
removed bug - pass summary in prompt
khushvind Jul 30, 2024
2162c91
modified summarize_messages
khushvind Jul 30, 2024
a90edc8
Merge remote-tracking branch 'upstream/main' into MemGPT
khushvind Jul 31, 2024
8d7bc30
Merge remote-tracking branch 'upstream/main' into MemGPT
khushvind Jul 31, 2024
34caa62
Merged with latest main
khushvind Aug 20, 2024
f30a572
updated prompt for condenser
khushvind Aug 21, 2024
13a9f64
removed print summary message
khushvind Aug 22, 2024
d25e19e
Modified how agent_controller handles summarization actions
khushvind Aug 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 22 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,34 @@

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 20
- package-ecosystem: "npm" # See documentation for possible values
directory: "/frontend" # Location of package manifests

- package-ecosystem: "npm"
directory: "/frontend"
schedule:
interval: "daily"
open-pull-requests-limit: 20
- package-ecosystem: "npm" # See documentation for possible values
directory: "/docs" # Location of package manifests
groups:
docusaurus:
patterns:
- "*docusaurus*"
eslint:
patterns:
- "*eslint*"

- package-ecosystem: "npm"
directory: "/docs"
schedule:
interval: "daily"
open-pull-requests-limit: 20
groups:
docusaurus:
patterns:
- "*docusaurus*"
eslint:
patterns:
- "*eslint*"
69 changes: 69 additions & 0 deletions .github/workflows/clean-up.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Workflow that cleans up outdated and old workflows to prevent out of disk issues
name: Delete old workflow runs

# This workflow is currently only triggered manually
on:
workflow_dispatch:
inputs:
days:
description: 'Days-worth of runs to keep for each workflow'
required: true
default: '30'
minimum_runs:
description: 'Minimum runs to keep for each workflow'
required: true
default: '10'
delete_workflow_pattern:
description: 'Name or filename of the workflow (if not set, all workflows are targeted)'
required: false
delete_workflow_by_state_pattern:
description: 'Filter workflows by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually'
required: true
default: "ALL"
type: choice
options:
- "ALL"
- active
- deleted
- disabled_inactivity
- disabled_manually
delete_run_by_conclusion_pattern:
description: 'Remove runs based on conclusion: action_required, cancelled, failure, skipped, success'
required: true
default: 'ALL'
type: choice
options:
- 'ALL'
- 'Unsuccessful: action_required,cancelled,failure,skipped'
- action_required
- cancelled
- failure
- skipped
- success
dry_run:
description: 'Logs simulated changes, no deletions are performed'
required: false

jobs:
del_runs:
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: ${{ github.event.inputs.days }}
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}
delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }}
delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }}
delete_run_by_conclusion_pattern: >-
${{
startsWith(github.event.inputs.delete_run_by_conclusion_pattern, 'Unsuccessful:')
&& 'action_required,cancelled,failure,skipped'
|| github.event.inputs.delete_run_by_conclusion_pattern
}}
dry_run: ${{ github.event.inputs.dry_run }}
22 changes: 16 additions & 6 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# Workflow that builds and deploys the documentation website
name: Deploy Docs to GitHub Pages

# * Always run on "main"
# * Run on PRs that target the "main" branch and have changes in the "docs" folder or this workflow
on:
push:
branches:
- main
pull_request:
paths:
- 'docs/**'
- '.github/workflows/deploy-docs.yml'
branches:
- main

jobs:
# Build the documentation website
build:
if: github.repository == 'OpenDevin/OpenDevin'
name: Build Docusaurus
runs-on: ubuntu-latest
if: github.repository == 'OpenDevin/OpenDevin'
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -25,25 +32,29 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

python-version: '3.11'
- name: Generate Python Docs
run: rm -rf docs/modules/python && pip install pydoc-markdown && pydoc-markdown
- name: Install dependencies
run: cd docs && npm ci
- name: Build website
run: cd docs && npm run build

- name: Upload Build Artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: docs/build

# Deploy the documentation website
deploy:
if: github.ref == 'refs/heads/main' && github.repository == 'OpenDevin/OpenDevin'
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
# This job only runs on "main" so only run one of these jobs at a time
# otherwise it will fail if one is already running
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
needs: build
if: github.ref == 'refs/heads/main' && github.repository == 'OpenDevin/OpenDevin'
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
Expand All @@ -52,7 +63,6 @@ jobs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/dummy-agent-test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# Workflow that uses the DummyAgent to run a simple task
name: Run E2E test with dummy agent

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

# Always run on "main"
# Always run on PRs
on:
push:
branches:
- main
pull_request:

env:
PERSIST_SANDBOX : "false"

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -25,7 +21,7 @@ jobs:
- name: Set up environment
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry install --without evaluation
poetry install --without evaluation,llama-index
poetry run playwright install --with-deps chromium
wget https://huggingface.co/BAAI/bge-small-en-v1.5/raw/main/1_Pooling/config.json -P /tmp/llama_index/models--BAAI--bge-small-en-v1.5/snapshots/5c38ec7c405ec4b44b94cc5a9bb96e735b38267a/1_Pooling/
- name: Run tests
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/fe-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Workflow that runs frontend unit tests
name: Run Frontend Unit Tests

# * Always run on "main"
# * Run on PRs that have changes in the "frontend" folder or this workflow
on:
push:
branches:
- main
pull_request:
paths:
- 'frontend/**'
- '.github/workflows/fe-unit-tests.yml'

jobs:
# Run frontend unit tests
fe-test:
name: FE Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
working-directory: ./frontend
run: npm ci
- name: Run tests and collect coverage
working-directory: ./frontend
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
148 changes: 148 additions & 0 deletions .github/workflows/gchr_app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Workflow that builds, tests and then pushes the app docker images to the ghcr.io repository
name: Build and Publish App Image


# Always run on "main"
# Always run on tags
# Always run on PRs
# Can also be triggered manually
on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:
inputs:
reason:
description: 'Reason for manual trigger'
required: true
default: ''

jobs:
# Builds the OpenDevin Docker images
ghcr_build:
name: Build App Image
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.capture-tags.outputs.tags }}
permissions:
contents: read
packages: write
strategy:
matrix:
image: ['opendevin']
platform: ['amd64', 'arm64']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build and export image
id: build
run: ./containers/build.sh ${{ matrix.image }} ${{ github.repository_owner }} ${{ matrix.platform }}
- name: Capture tags
id: capture-tags
run: |
tags=$(cat tags.txt)
echo "tags=$tags"
echo "tags=$tags" >> $GITHUB_OUTPUT
- name: Upload Docker image as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.image }}_image_${{ matrix.platform }}
path: /tmp/${{ matrix.image }}_image_${{ matrix.platform }}.tar
retention-days: 14

# Push the OpenDevin and sandbox Docker images to the ghcr.io repository
ghcr_push:
runs-on: ubuntu-latest
needs: [ghcr_build]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main')
env:
tags: ${{ needs.ghcr_build.outputs.tags }}
permissions:
contents: read
packages: write
strategy:
matrix:
image: ['opendevin']
platform: ['amd64', 'arm64']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download Docker images
uses: actions/download-artifact@v4
with:
name: ${{ matrix.image }}_image_${{ matrix.platform }}
path: /tmp/${{ matrix.platform }}
- name: Load images and push to registry
run: |
mv /tmp/${{ matrix.platform }}/${{ matrix.image }}_image_${{ matrix.platform }}.tar .
loaded_image=$(docker load -i ${{ matrix.image }}_image_${{ matrix.platform }}.tar | grep "Loaded image:" | head -n 1 | awk '{print $3}')
echo "loaded image = $loaded_image"
tags=$(echo ${tags} | tr ' ' '\n')
image_name=$(echo "ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}" | tr '[:upper:]' '[:lower:]')
echo "image name = $image_name"
for tag in $tags; do
echo "tag = $tag"
docker tag $loaded_image $image_name:${tag}_${{ matrix.platform }}
docker push $image_name:${tag}_${{ matrix.platform }}
done
# Creates and pushes the OpenDevin and sandbox Docker image manifests
create_manifest:
runs-on: ubuntu-latest
needs: [ghcr_build, ghcr_push]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main')
env:
tags: ${{ needs.ghcr_build.outputs.tags }}
strategy:
matrix:
image: ['opendevin']
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and push multi-platform manifest
run: |
image_name=$(echo "ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}" | tr '[:upper:]' '[:lower:]')
echo "image name = $image_name"
tags=$(echo ${tags} | tr ' ' '\n')
for tag in $tags; do
echo 'tag = $tag'
docker buildx imagetools create --tag $image_name:$tag \
$image_name:${tag}_amd64 \
$image_name:${tag}_arm64
done
Loading