See llms.txt for all machine-readable content.

Back to Templates

AI-powered document chat with Nextcloud files using LangChain and OpenAI

Main Workflow “AI Nextcloud”

  • Entry point: A password-protected chat trigger greets the user; every incoming chat message starts the flow.
  • AI agent: A LangChain agent (“AI Nextcloud”) uses the configured OpenAI model plus short-term memory to continue the dialogue in context.
  • Purpose: Answers questions about files stored in a Nextcloud folder. The user includes a path relative to the configured folder in their question.
  • Tool integration: Calls the sub-workflow “Nextcloud Tool” whenever it needs to read files and pass their text back to the AI.

Sub-Workflow “Nextcloud Tool”

  1. Invocation: Triggered by other workflows with the input parameter path (folder path).

  2. File listing: Retrieves every file in the specified folder via the Nextcloud API.

  3. Filter: Allows only readable formats (PDF, Markdown, DOCX).

  4. Download & text extraction

    • PDF → Text via Extract From File
    • Markdown → Raw text
    • DOCX → Text from the Word document body using the built-in archive reader
  5. Aggregation: Combines all extracted text into a single output field and returns it.

Outcome: Each call yields the plain content of every supported file in a Nextcloud folder—providing rich context for the AI agent to answer user questions accurately.

Choose the accessible root in Allowed Nextcloud folder, configure Basic Auth on chat, connect Nextcloud and OpenAI, then publish so the workflow can call its own workers. Only immediate files in that folder are read. Requests are limited to 40 documents, 12 MiB per document and 250,000 extracted characters.