Skip to content

Commit 0f1eb19

Browse files
authored
Merge branch 'master' into feature/context-agent-tables-tools
2 parents db5c41b + 834279d commit 0f1eb19

96 files changed

Lines changed: 14167 additions & 920 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/build-docs.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ jobs:
255255

256256
- name: Login to GitHub Container Registry
257257
if: steps.changed.outputs.dockerfile_changed == 'true'
258-
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
258+
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
259259
with:
260260
registry: ghcr.io
261261
username: ${{ github.actor }}

‎.github/workflows/docker-build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- name: Login to GitHub Container Registry
3131
if: github.event_name != 'pull_request'
32-
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
32+
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
3333
with:
3434
registry: ghcr.io
3535
username: ${{ github.actor }}

‎AGENTS.md‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,34 @@ Use `fixes #NNNN` in the PR body to auto-close on merge; use `relates to #NNNN`
181181
| `check-occ-command` | Invalid OCC command references |
182182

183183
Sphinx treats warnings as errors in CI — fix all of them.
184+
185+
## Nextcloud Contribution Policy
186+
187+
All contributions generated or assisted by this agent must fully comply with:
188+
189+
- **[AI Contribution Policy](https://github.com/nextcloud/.github/blob/master/AI_POLICY.md)** - the primary reference for AI-specific rules, covering disclosure, author accountability, communication, security, licensing, code quality, and autonomous agent behavior.
190+
- **[Contribution Guidelines](https://github.com/nextcloud/.github/blob/master/CONTRIBUTING.md)** - covering testing requirements, the Developer Certificate of Origin (DCO), license headers, conventional commits, and translations. These apply in full to all contributions regardless of how they were produced.
191+
192+
### What this agent must always do
193+
194+
- Add an `Assisted-by: AGENT_NAME:MODEL_VERSION` git trailer to every commit containing AI-assisted content.
195+
- Ensure every pull request includes a disclosure of AI tool use in the PR description.
196+
- Produce focused, scoped pull requests that address exactly one concern. Do not touch unrelated files or introduce incidental refactors.
197+
- Write code comments that document the code, never the process that produced it:
198+
- Comments describe what the code does - method signatures, behavior, and constraints the code itself cannot express (e.g. a non-obvious invariant or workaround).
199+
- Never add comments that document progress, decisions, or changes (e.g. "changed X to Y", "as requested", "this fixes ...", "previously this did ..."). That belongs in the commit message or PR discussion; in the code it goes stale and becomes misleading.
200+
- Do not narrate self-explanatory code. If the code is readable without a comment, omit the comment.
201+
- Keep comments brief - short and simple, matching the comment density of the surrounding code.
202+
- Reuse existing helper functions and utilities instead of re-implementing their logic inline. When fixing a flawed pattern, fix every occurrence of it across the changed code, not only the instance that was pointed out.
203+
- Explicitly inform the contributor when any action they are about to take, or have taken, would violate the AI Contribution Policy or the Contribution Guidelines. Do not silently proceed. State which rule is at risk and what the contributor should do instead.
204+
- Warn the contributor if a pull request is growing too large. A PR approaching several thousand lines of changed code is a signal that it should be split into smaller, focused PRs. Suggest a logical split before the PR is opened, not after.
205+
- Recommend opening a ticket for discussion before starting implementation whenever a feature or change is sufficiently complex - for example when it touches multiple subsystems, requires architectural decisions, or the right approach is not yet clear. A ticket allows maintainers and the contributor to align on direction before code is written, avoiding wasted effort on a PR that may be rejected or require fundamental rework.
206+
207+
### What this agent must never do
208+
209+
- Open issues, submit pull requests, post review comments, or send security reports autonomously. Every contribution must be reviewed and submitted by a human.
210+
- Add `Signed-off-by` tags to commits. Only the human contributor can certify the Developer Certificate of Origin.
211+
- Generate or submit security reports without independent human verification. Report verified vulnerabilities via [HackerOne](https://hackerone.com/nextcloud), not as GitHub issues.
212+
- Write PR descriptions, review comments, or issue reports on behalf of the contributor. These must be in the contributor's own words.
213+
- Fully automate the resolution of issues labeled [`good first issue`](https://github.com/issues?q=org%3Anextcloud+label%3A%22good+first+issue%22) or similar beginner-friendly labels.
214+
- Submit code that has not been reviewed and cleaned up by the contributor. Dead code, redundant logic, excessive comments, malformed or garbled characters (e.g. `�` replacement characters), and unrelated changes must be removed before submission.

‎admin_manual/ai/app_assistant.rst‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Nextcloud Assistant
66

77
Nextcloud assistant is the primary graphical user interface for interacting with artificial intelligence features in Nextcloud.
88

9-
It offers the graphical user interface for the unified AI Task processing API offering features like summarizing text, generating headlines, asking arbitrary questions, transcription of media files, image generation and it integrates with the context_chat app to offer in-context answers about your own data stored in Nextcloud. The assistant app also offers a chat interface to interact with the chosen language model. Nextcloud can provide customer support upon request, please talk to your account manager for the possibilities.
9+
It offers the graphical user interface for the unified AI Task processing API offering features like summarizing text, generating headlines, asking arbitrary questions, transcription of media files, image generation and it integrates with the context_chat app to offer in-context answers about your own data stored in Nextcloud. The assistant app also offers a chat interface to interact with the chosen language model, including multimodal chat with file attachments when a compatible backend is configured. Nextcloud can provide customer support upon request, please talk to your account manager for the possibilities.
1010

1111
Find the user documentation here:
1212
`AI assistant user documentation <https://docs.nextcloud.com/server/latest/user_manual/ai_assistant.html>`_
@@ -106,6 +106,15 @@ In order to make use of our "Chat with AI" feature you will need any one of the
106106
* :ref:`llm2<ai-app-llm2>` - Runs open source AI language models locally on your own server hardware (Customer support available upon request)
107107
* `OpenAI and LocalAI integration (via OpenAI API) <https://apps.nextcloud.com/apps/integration_openai>`_ - Integrates with the OpenAI API to provide AI functionality from OpenAI servers (Customer support available upon request; see :ref:`AI as a Service<ai-ai_as_a_service>`)
108108

109+
Multimodal chat
110+
~~~~~~~~~~~~~~~
111+
112+
Multimodal chat extends "Chat with AI" so users can attach files for the language model to analyze in the conversation, such as images and, with some models, audio and video. Text files can also be attached as context.
113+
114+
In order to make use of multimodal chat you will need any one of the following backends with a multimodal-capable model:
115+
116+
* :ref:`llm2<ai-app-llm2>` - Use a multimodal model such as the shipped Qwen 3.5 9B (vision) or Gemma 4 E4B (vision and audio) (Customer support available upon request)
117+
* `OpenAI and LocalAI integration (via OpenAI API) <https://apps.nextcloud.com/apps/integration_openai>`_ - Integrates with multimodal models via the OpenAI API (Customer support available upon request; see :ref:`AI as a Service<ai-ai_as_a_service>`)
109118

110119
Voice Chat
111120
~~~~~~~~~~

‎admin_manual/ai/app_context_agent.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,15 +516,15 @@ Combining tools
516516

517517
These tools can also be combined by the agent to fulfil tasks like the following:
518518

519-
* *"How is the weather where Andrew lives?"*
519+
* *"How is the weather where Andrew lives?"*
520520

521521
* Uses contacts to look up Andrew's address and then checks the weather
522522

523-
* *"How is the weather where I live?"*
523+
* *"How is the weather where I live?"*
524524

525525
* Look up the current user's address and then checks the weather
526526

527-
* *"Send an email from carry@company.com to Andrew"*
527+
* *"Send an email from carry@company.com to Andrew"*
528528

529529
* Uses contacts to look up Andrew's email and then sends an email
530530

‎admin_manual/ai/app_context_chat.rst‎

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ This app supports input and output in the same languages that the currently conf
1818
Requirements
1919
------------
2020

21-
* Minimal Nextcloud version: 30
21+
* Minimal Nextcloud version: 32
2222
* Nextcloud AIO is supported
23-
* We currently support NVIDIA GPUs and x86_64 CPUs
23+
* We currently support NVIDIA GPUs, AMD GPUs (via Vulkan) and x86_64 CPUs
2424
* CPU that supports AVX and AVX2 instruction
25-
* CUDA >= v12.2 on your host system
25+
* CUDA >= v12.8 on your host system if NVIDIA GPUs are used
2626
* Both podman and docker are supported
2727
* GPU Setup Sizing
2828

29-
* A NVIDIA GPU with at least 2GB VRAM
29+
* A GPU with at least 2GB VRAM
3030
* The requirements for the text-to-text providers should be checked separately for each app :ref:`here <tp-consumer-apps>` in the "Backend apps" section, as they can vary greatly based on the model used and whether the provider is hosted locally or remotely.
3131
* At least 8GB of system RAM
3232
* 2 GB + additional 500MB for each concurrent request made to the backend if configuration parameters are changed
@@ -66,7 +66,9 @@ Installation
6666

6767
6. Optionally but recommended, setup background workers for faster pickup of tasks. See :ref:`the relevant section in AI Overview<ai-overview_improve-ai-task-pickup-speed>` for more information.
6868

69-
**Note**: Both apps need to be installed and both major version and minor version of the two apps must match for the functionality to work (ie. "v1.3.4" and "v1.3.1"; but not "v1.3.4" and "v2.1.6"; and not "v1.3.4" and "v1.4.5"). Keep this in mind when updating.
69+
.. note::
70+
71+
Both apps need to be installed and both major version and minor version of the two apps must match for the functionality to work (ie. "v1.3.4" and "v1.3.1"; but not "v1.3.4" and "v2.1.6"; and not "v1.3.4" and "v1.4.5"). Keep this in mind when updating.
7072

7173

7274
Initial loading of data
@@ -75,30 +77,11 @@ Initial loading of data
7577
Auto-indexing
7678
~~~~~~~~~~~~~
7779

78-
| Context chat will automatically load user data into the Vector DB using asynchronous background jobs.
80+
| Context chat will automatically load user data into the Vector DB. Context chat backend pulls the queued files and content providers' items from the context chat PHP app and indexes them.
7981
| The initial loading of data can take a long time depending on the number of files and their size.
8082
81-
The indexing jobs are set up to run during the Nextcloud instance's maintenance window (typically during the night) only. If you have not set a maintenance window, indexing will run 24/7.
82-
83-
| You can set up a separate cron job to run every 30 minutes for Context Chat to avoid slowing down normal background job operation on larger instances.
84-
| The following command can bypass the maintenance window so it can either be set to run during the day even with a maintenance window set, or it can be set to run during the weekends 24/7 to speed up the indexing process.
85-
86-
.. code-block::
87-
88-
php cron.php "OCA\\ContextChat\\BackgroundJobs\\IndexerJob" "OCA\\ContextChat\\BackgroundJobs\\ActionJob" "OCA\\ContextChat\\BackgroundJobs\\SubmitContentJob" "OCA\\ContextChat\\BackgroundJobs\\StorageCrawlJob" "OCA\\ContextChat\\BackgroundJobs\\InitialContentImportJob"
89-
90-
91-
Synchronous indexing
92-
~~~~~~~~~~~~~~~~~~~~
93-
94-
| To index all the files synchronously, use the following command:
95-
| Note: This does not interact with the auto-indexing feature and that list would remain unchanged. However, the indexed files would be skipped when the auto indexer runs.
96-
97-
.. code-block::
98-
99-
occ context_chat:scan <user_id>
10083

101-
**Note**: The synchronous command could take several days to complete. On larger systems we thus recommend to use auto-indexing.
84+
.. _scaling-context-chat:
10285

10386
Scaling
10487
-------
@@ -119,23 +102,42 @@ Listed below are the major parts of the system that can be scaled independently
119102
| The embedding model performance can be scaled by using a hosted embedding service, locally or remotely hosted. It should be able to serve an OpenAI-compatible API.
120103
| The embedding service URL can be set using the environment variable ``CC_EM_BASE_URL`` during deployment in the "Deploy Options". Other options like the model name, api key, or username and password can be set using the environment variables ``CC_EM_MODEL_NAME``, ``CC_EM_API_KEY``, ``CC_EM_USERNAME``, and ``CC_EM_PASSWORD`` respectively.
121104
122-
| Note that you cannot change the embedding model after installing the app, so if you want to use a different embedding model or service you will need to do a full uninstall (removing all data of the ExApp) and reinstall the ``context_chat_backend`` ExApp with the new environment variables and an empty vectorDB. If the vectorDB is external, the connected database (can be `ccb`) should be dropped before installing the ExApp again.
105+
.. warning::
106+
107+
The embedding model cannot be changed after installing the app. To use a different embedding model or service, you
108+
will need to do a full uninstall (removing all data of the ExApp) and reinstall the ``context_chat_backend`` ExApp
109+
with the new environment variables and an empty vector DB. If the vector DB is external, the connected database
110+
(database may be named ``ccb``) should be dropped before installing the ExApp again.
111+
112+
For the ``context_chat`` app, obtain a clean slate by dropping all the ``<PREFIX>_context_chat_*`` tables in the database, and removing all the config values:
113+
And re-installing it.
114+
115+
.. code-block:: sql
116+
117+
drop table if exists oc_context_chat_action_queue;
118+
drop table if exists oc_context_chat_content_queue;
119+
drop table if exists oc_context_chat_fs_events;
120+
drop table if exists oc_context_chat_queue;
121+
delete from oc_appconfig where appid = 'context_chat';
123122
124-
One part of the system that cannot be scaled yet is the parsing of the documents to extract text.
125-
This is currently done in a single instance of the ``context_chat_backend`` ExApp.
126-
It is a CPU-bound task so having a powerful CPU will help speed up the parsing process.
123+
124+
4. The parsing of the documents to extract text
125+
126+
| The parsing of the documents to extract text is done in a single instance of the ``context_chat_backend`` ExApp in a docker-based environment. It is a CPU-bound task, so having a powerful CPU will help speed up the parsing process.
127+
| This can be scaled by using Kubernetes for deployment, allowing multiple instances of the ``context_chat_backend`` ExApp to handle the parsing concurrently, see :ref:`the Kubernetes section <kubernetes-context-chat>`.
127128
128129
If ``context_chat_backend`` is already deployed, you can change these environment variables by redeploying it with the new values.
129130

130131
1. Go to Apps page -> search for "Context Chat Backend"
131-
2. Disable and remove the app taking care the data is not removed
132+
2. Disable and remove the app taking care the data is not removed (except when the embedding model is changed, in which case the data should be removed)
132133
3. Set the "Deploy Options" with the new environment variables
133134
4. Reinstall the app
134135

136+
.. _kubernetes-context-chat:
135137

136138
Kubernetes
137139
~~~~~~~~~~
138-
Starting with version 5.4.0 of the app, Kubernetes is supported for deployment of the backend to scale ContextChat to large instances. Nextcloud customers can find details about Kubernetes deployment in the customer documentation or by contacting support.
140+
Starting with version 5.4.0 of the app and Nextcloud 34, Kubernetes is supported for deployment of the backend to scale ContextChat to large instances. Nextcloud customers can find details about Kubernetes deployment in the customer documentation or by contacting support.
139141

140142
App store
141143
---------
@@ -160,15 +162,16 @@ The options for each command can be found like this, using scan as example: ``co
160162
* ``context_chat:search``
161163
Perform a semantic (vector DB based) search on your indexed documents, with options for selective context.
162164

163-
* ``context_chat:scan``
164-
Scan and index the user's documents based on the user ID provided, synchronously.
165-
166165
* ``context_chat:stats``
167166
| Shows the time taken to complete the initial indexing of the documents if it has finished,
168167
| and the current no. of items in the indexer and actions queue.
169168
| "Actions" refers to tasks like file deletions, ownership changes through share changes, etc.
170169
| These file and ownership changes are synced with the backed through this actions queue.
171170
171+
* ``context_chat:reindex``
172+
| Schedule a full re-crawl of all the files in all the mounts. Indexed files are not re-indexed when compared against context_chat_backend's vector DB.
173+
| Content providers are not re-indexed.
174+
172175

173176
Configuration Options
174177
---------------------
@@ -181,6 +184,8 @@ Configuration Options
181184
occ config:app:set context_chat auto_indexing --value='true' --type=string
182185
183186
187+
Context chat backend's configuration options are available through the environment variable in :ref:`Deploy Options <ai-app_api_deploy_options>`.
188+
184189
Logs
185190
----
186191

0 commit comments

Comments
 (0)