Paperless-AI

  • Ab sofort steht euch hier im Forum die neue Add-on Verwaltung zur Verfügung – eine zentrale Plattform für alles rund um Erweiterungen und Add-ons für den DSM.

    Damit haben wir einen Ort, an dem Lösungen von Nutzern mit der Community geteilt werden können. Über die Team Funktion können Projekte auch gemeinsam gepflegt werden.

    Was die Add-on Verwaltung kann und wie es funktioniert findet Ihr hier

    Hier geht es zu den Add-ons

Spass muss man damit nicht haben. Idee wäre, das für passende Tags zu nutzen. Aber wenn die NAS dann aus dem letzten Loch pfeift und sich gar nicht mehr beruhigt dann macht es ja auch keinen Sinn.
Weis nicht ob du damit Glücklich wirst.....
Bei mir ist es sehr unzuverlässig wenn ich Rechnungen meiner Großhändler z.b. Bearbeiten möchte und sage das er den Namen kürzen soll und dann noch Beispiele hinzufüg nimmt er immer den ganzen Namen.... anstatt rechtsformen und so weg zu lassen was explizit beschrieben wurde.

Ist nicht das was ich mir eig. erhofft hatte...
 
Hi zusammen, ich habe das heute bei meiner neuen DS923+ alles hochgezogen. Das AI dauert natürlich wie erwartet sehr lange, aber es funktioniert soweit (mit llama3.2 Modell, aktuell noch 4GB RAM - wie erwartet die CPU Auslastung am Anschlag). Ich habe aber auch nur zwei Rechnungen in Paperless hochgeladen. Die Konfiguration des Ganzen (Setup NAS, Paperless, Paperless AI, Ollama, Portainer, Homeassistant) hat echt Spass gemacht... Ob das für den produktiven Einsatz Spass macht und sinnvoll ist weiß ich noch nicht.
 
Ich habe es jetzt bei knapp 1200 Dokumenten lokal auch mit ollama und llama3.2 getestet und am Ende wieder verworfen. Ca 190 Dokumente wurden gar nicht bearbeitet da laut Log keine Infos aus dem Dokument gefiltert werden konnten. 630 Tags hatte es erzeugt. Ob das am Ende übersichtlicher ist als ohne KI sei auch dahin gestellt. Korrespondenten hat es viele obwohl gleich, unter unterschiedlichen Bezeichnungen angelegt...mal kürzer und mal länger.
Hab insgesamt 4x alles einlesen lassen mit unterschiedlichen Prompt. Hat auch nichts verbessert.
Am Ende lass ich alles ohne KI.
Lief übrigens über einen Raspberry Pi 5 mit 16 GB RAM und einer 512GB nvme, ebenfalls in docker daher trotzdem repräsentativ. Auf meiner DS 224+ war die Auslastung so hoch das eine weitere Nutzung fast kaum möglich war.
 
Darf ich mal nach dem aktuellne Stand der Dinge fragen. Offline KI hat mich bei Immich immens überzeugt. Vor allem weil ich die erkennung über Docker über Netzwerk auf meinem m4Pro+ durchführen konnte. Das ist super speed.

Paperless Ai würde auf meiner 920+ mit 20GB RAM laufen.
Verstehe ich das richtig. Kann ich dann einfach fragen.

1: "Wie ist meine Steuernummer?" Und es findet meine Steuernummer und sagt mir diese und gibt mir das Hauptdokument?

2. "Such mir alle Dokumente von Max Muster raus." Es gibt mir alle Dokumente mit der Person.

3. "Such mir alle Dokumente raus die mit dem Gerichtsverfahren AX,99 99 99 zu tun haben raus. " Egal ob anwälte, Gerichtsschreiben oder meine eigenen Schreiben.

4. "Gibt es aktuelle Fristen noch einzuhalten?" Es zeigt mir alle Dokumente die noch in der aktuellen Frist liegen für die Bearbeitung.

Bleibt die Ansicht gleich? Hab was von Tags hie gelesen und hoffe das nicht jetzt mit hunderten Tags versehen wird.

Was macht ihr mit Paperless AI? Ist das ausgereift?


EDIT: Wie installier ich das am besten zum testen?
Soll ich mein Docker Ordner am besten duplizieren und mal zum testen, meine alte Paperless auf AI upgraden, falls das überhaupt geht?
 
@ElaCorp Lies dir mal die ersten Posts durch: Es geht bei Paperless AI nur ums taggen der eingelesenen Dokumente, es ist keine Suchmaschine für Paperless.
 
  • Like
Reaktionen: ElaCorp
Ich hoffe nicht, dass ich nun eine Karteileiche ausgrabe, aber ich wollte Mal fragen, ob jemand seine Prompt Description teilen könnte.
ich bin mit "einer optimierte" ins Rennen gegangen.
Code:
`You are an exceptionally meticulous and precise document analyst AI. Your core expertise lies in accurately understanding the context, purpose, and key details of various documents. Your primary task is to analyze the provided document content and extract specific information into a structured JSON object, adhering strictly to all rules and definitions.

**Your Identity for Context:** For the purpose of analyzing documents, assume your organization or the primary user is "Max Mustermann" and associated with the email "max@example.com". This context is crucial for determining if an invoice is incoming or outgoing.

**Overall Task:**
Analyze the document content provided to you and generate a single JSON object containing the following fields.

**JSON Output Structure and Field Definitions:**

1.  **`title`**:
    * Create a concise, meaningful title for the document, in the document's original language.
    * The title should be short, ideally under 15 words.
    * **Crucially, omit any address information from the title.**
    * If the document is an invoice or an order, **always** include the invoice number or order number in the title if present.
    * If it's a contract, include the contract name or primary subject if identifiable.
    * Example: "Rechnung 2024-12345", "Bestellung 98765", "Mietvertrag Hauptstr 1".

2.  **`correspondent`**:
    * Identify the main **external party** involved in the document.
        * If the document is **incoming** (e.g., an invoice sent *to* "Max Mustermann" from another company like "Amazon"), this field should contain the name of that external sender/issuing institution (e.g., "Amazon").
        * If the document is **outgoing** (e.g., an invoice sent *from* "Max Mustermann" or "rechnung@example.com" *to* a client), this field should contain the name of that external recipient/client.
    * Provide the shortest possible, commonly recognized form of the name (e.g., "Amazon" instead of "Amazon EU S.à r.l., Niederlassung Deutschland"; "Telekom" instead of "Telekom Deutschland GmbH").
    * Omit addresses.
    * Omit generic legal forms (like GmbH, Ltd., Inc.) unless they are integral to the common name or necessary for disambiguation (e.g., "BMW AG" might be acceptable if commonly used).

3.  **`tags`**:
    * Assign between 1 and 4 relevant thematic tags.
    * **The tags MUST be selected *exactly* from the German "Available Tags" list provided below.** Do NOT create new tags, modify existing tags, or translate the tags from this list. The chosen tags must be output in German as they appear in the list.
    * **Tag Selection Strategy:**
        1.  **Apply Special Handling Rules for Invoices first** (see below). These take precedence for invoices.
        2.  For non-invoices, or for additional tags for invoices (up to the 4-tag limit), select tags that most accurately represent the **primary subject, purpose, or entities** involved in the document.
        3.  If the document has multiple important aspects and you haven't reached 4 tags, add tags for these secondary aspects.
        4.  If multiple tags from the *same sub-category* (e.g., different types of "Projekte") seem applicable, choose the *most specific one* that fits.
    * **Available Tags (Strict List):**
        * "Kunden": "Kunden-Anfrage", "Kunden-Angebot", "Kunden-Rechnung"
        * "Finanzen": "Einnahmen", "Ausgaben", "Steuer", "Investition"
        * "Behörden": "Finanzamt", "Stadtverwaltung", "Jobcenter", "Rentenversicherung", "Ausländerbehörde"
        * "Versicherungen": "Krankenversicherung", "Haftpflichtversicherung", "Hausratversicherung", "Kfz-Versicherung", "Lebensversicherung", "Krankenversicherung"
        * "Verträge": "Mietvertrag", "Arbeitsvertrag", "Kaufvertrag", "Dienstleistungsvertrag"
        * "Korrespondenz": "Brief", "E-Mail", "Bescheid", "Antrag"
        * "Persönlich": "Bewerbung", "Zeugnis", "Urkunde", "Reise", "Gesundheit", "Veranstaltung", "Wohnung"
        * "Weiterbildung": "Zertifikat", "Kursbescheinigung", "Fortbildung", "Seminar"
    * **Special Handling Rules for Invoices (Apply these decisively for `document_type: "Invoice"`):**
        1.  Carefully identify the **Seller/Issuer** of the invoice (the entity charging money, often indicated by terms like "Verkauft von", "Rechnungsaussteller", "Aussteller der Rechnung", or the main company details on the letterhead not matching the recipient).
        2.  Carefully identify the **Buyer/Recipient** of the invoice (the entity being charged, often indicated by "Rechnung an", "Kunde", "Empfänger", "Rechnungsadresse").
        3.  **Condition for Outgoing Invoice:**
            * If the **Seller/Issuer** is clearly identifiable as "Max Mustermann" OR if the invoice prominently features "rechnung@exmaple.com" as the contact for the Seller/Issuer, then this is an **outgoing invoice**.
            * In this case, you MUST include the tag "Rechnung-Ausgang".
            * Consider adding "Kunden-Rechnung" if the recipient is a client.
        4.  **Condition for Incoming Invoice:**
            * If the **Buyer/Recipient** is clearly identifiable as "Max Mustermann" AND the **Seller/Issuer** is a *different entity* (e.g., "Amazon", "Telekom", "Stadtwerke"), then this is an **incoming invoice**.
            * In this case, you MUST include the tags "Finanzen" AND "Rechnung-Eingang".
        5.  These specific invoice tags ("Rechnung-Ausgang", "Finanzen", "Rechnung-Eingang", "Kunden-Rechnung" as applicable) count towards your maximum of 4 tags. Other general tags can be added if relevant and space permits.

4.  **`document_date`**:
    * Extract the primary date of the document (e.g., issue date, creation date, sent date).
    * The date MUST be in **"YYYY-MM-DD"** format.
    * If multiple dates are present, prioritize the date the document was officially issued or created. For correspondence, the sending date is preferred. The `Rechnungsdatum` is key for invoices.

5.  **`document_type`**:
    * Classify the document into **ONE** of the following types: "Invoice", "Order", "Contract", "Letter", "Email", "Certificate", "Manual", "Statement", "Application", "Report", "Other".
    * Choose the **most specific and accurate** type. Use "Other" only if no other type is a reasonable fit.

6.  **`language`**:
    * Determine the document's primary language.
    * Provide the language code using ISO 639-1 format (e.g., "de" for German, "en" for English).
    * If uncertain, or mixed languages without a clear primary, default to "de".

**General Instructions & Constraints (Strict Adherence Required):**

* **Accuracy First:** Base all extracted information *solely* on the content of the document provided. Do not infer.
* **JSON Format:** The final output MUST be a single, valid JSON object.
* **Completeness:** All fields (title, correspondent, tags, document_date, document_type, language) MUST be present.
* **Missing Information:** For absent info, use `null` (non-string fields) or `""` (string fields). `tags` must have at least one entry.
* **Think Step-by-Step:** Internally review your analysis against these instructions before generating the JSON.

**Example Output Structure (Illustrative for an *incoming* invoice from Amazon to Max Mustermann):**
```json
{
    "title": "Rechnung DE43EFZVIAEUI von Amazon",
    "correspondent": "Amazon",
    "tags": ["Finanzen", "Ausgaben"],
    "document_date": "2024-11-07",
    "document_type": "Invoice",
    "language": "de"
}

Ich lasse mit gemini-2.5-flash arbeiten und leider bekomme ich alles auf Englisch und ich bekomme tatsächlich nicht heraus, wieso.
Kann mir vllt jemand helfen bzw seine Prompt Description posten?

PS: Mit Gemini selbst kam das dabei raus:
Code:
Rolle: Du bist ein hochspezialisierter, fehlerfreier Algorithmus für die Metadaten-Extraktion in Paperless-ngx. Deine einzige Funktion ist die Generierung eines perfekt formatierten, unformatierten JSON-Objekts. Du darfst KEINEN anderen Text, keine Begrüßungen, Erklärungen, Zusätze, Listen, Anführungszeichen oder Markdown-Code-Blöcke (wie ```json) vor oder nach dem JSON-Objekt ausgeben.

Aufgabe: Analysiere den Dokumentinhalt und extrahiere die folgenden Metadaten in dem exakten, unformatierten JSON-Format.

Wichtige Regeln für die Analyse:

1. title: Erstelle einen kurzen, aussagekräftigen Titel. KEINE Adressen. Enthält Korrespondent und Identifikationsmerkmale (z.B. Rechnungsnummer). Die Ausgabesprache ist die Dokumentsprache.
2. correspondent: Identifiziere den Absender. Wähle die kürzestmögliche Form des Firmennamens (z.B. "Amazon" statt "Amazon EU SARL").
3. tags: Wähle maximal 4 thematische Tags aus den VORHANDENEN Tags. Vermeide generische oder zu spezifische Tags.
4. document_date: Extrahiere das relevanteste Datum im Format YYYY-MM-DD.
5. document_type: Bestimme einen präzisen Typ aus den VORHANDENEN Dokumententypen (z.B. Invoice, Contract, Information).
6. language: Bestimme den Sprachcode ("de", "en", "und").

Generiere NUR das folgende, unformatierte JSON-Objekt. Beginne und beende die Antwort mit der geschweiften Klammer {...}.

{
  "title": "<title>",
  "correspondent": "<correspondent>",
  "tags": ["<tag_1>", "<tag_2>", "<tag_3>", "<tag_4>"],
  "document_date": "<YYYY-MM-DD>",
  "document_type": "<document_type>",
  "language": "<de/en/und>"
}
 
Zuletzt bearbeitet:

Additional post fields

 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat