Skip to content

Optimize assistant - #36

Merged
loks0n merged 6 commits into
mainfrom
optimize
Jul 21, 2025
Merged

Optimize assistant#36
loks0n merged 6 commits into
mainfrom
optimize

Conversation

@ItzNotABug

@ItzNotABugItzNotABug commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR does the following -

  1. Update Dockerfile with more stages to slim the sizes
  2. Parallelize node ops for faster docs creation, 88 seconds to <5 seconds now!
  3. Remove .git to shave off another 500MB for a smaller image size
    • Once the final git checkout {BRANCH} is done, we don't really need the .git folder IMO.
  4. Bump examples and releases to use cloud and not 1.6.x

Final image size can be just around ~200MB now.

Screenshot 2025-07-21 at 11 17 17 AM

Test Plan

Manual.
Ran pnpm test, updated the same examples here in the PR as well.

Related PRs and Issues

N/A.

Have you read the Contributing Guidelines on issues?

Yes.

@ItzNotABugItzNotABug self-assigned this Jul 21, 2025
@ChiragAgg5k
ChiragAgg5k requested a review from CopilotJuly 21, 2025 04:37

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the Appwrite assistant by implementing several Docker and build improvements to reduce image size and increase build performance. The changes focus on switching to a lighter base image, parallelizing operations, removing unnecessary files, and updating version references.

  • Docker optimization: Switched from node:18-alpine to node:18-slim and removed .git folder to reduce final image size by ~675-700MB
  • Performance improvement: Parallelized document processing operations, reducing build time from 88 seconds to under 5 seconds
  • Version updates: Updated references from 1.6.x to cloud across examples, releases, and configuration files

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
DockerfileOptimized base image and multi-stage build process for smaller final image
src/documents.jsParallelized documentation and reference fetching with Promise.all
scripts/web-sources.jsParallelized SDK and service downloads, added error handling
src/embeddings.jsFixed typo in function name from intializeDocumentRetriever to initializeDocumentRetriever
src/main.jsUpdated import to use corrected function name
.github/workflows/*.ymlUpdated build arguments to use cloud version instead of 1.6.x
CONTRIBUTING.mdUpdated documentation examples to use cloud version
package.jsonAdded new make-sources script
scripts/git-sources.jsAdded removal of .git directory after checkout
scripts/test-prompts.jsAdded new test prompt for static website hosting
tests/*.mdUpdated test documentation content with newer information and corrected references

Comment threadsrc/embeddings.js
@loks0n
loks0n merged commit 4d47510 into mainJul 21, 2025
3 checks passed
@ItzNotABug
ItzNotABug deleted the optimize branch July 21, 2025 09:52
Sign up for freeto 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.

4 participants

@ItzNotABug@loks0n@ChiragAgg5k