[GH-ISSUE #529] Allow AI to only use tags created by the user #341

Closed
opened 2026-03-02 11:49:01 +03:00 by kerem · 3 comments
Owner

Originally created by @devbydaniel on GitHub (Oct 13, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/529

Hi! First of all, great app!

I was wondering if you'd consider an option where users can restrict the automatic AI tagging to only use tags which are created by the user.

The background is that some people (like me) will have a pretty clear set of pre-defined tags which they want to use. Restricting the AI to only use these tags would greatly improve the organization of the bookmark library because everything will be sorted into expected buckets.

I briefly went through your code, and I think the implementation could look something like

  • extend the prompt builder functions in /packages/shared/prompts.ts to accept an optional userDefinedTags param and if present, add those tags to the prompt
  • If the results are unreliable, switch the OpenAI call to use function calling as the way to return the list of tags (since launching the structured output API extension, OpenAI guarantees 100% accuracy in function calling, so this should definitely work), e.g. like so:
{
    "name": "assign_tags",
    "description": "Assign tags to the given bookmark according to the content. If no tags fit the bookmark, return an empty array",
    "parameters": {
        "type": "object",
        "properties": {
            "tags": {
                "type": "array",
                "description": "The array of tags which should be assigned to the bookmark.",
                "items": {
                    "type": "string",
                    "enum": ["tag1", "tag2", "tag3"] // dynamically load user tags here
                },
            },
        },
        "required": ["tags"],
        "additionalProperties": false,
    }
}
  • add an option to the UI to restrict tag assignment to only consider user defined tags
  • in /apps/workers/openaiWorker.ts check if that option is present and if so, pass the user defined tags to the prompt builder

I'm happy to support you / provide more details / try to implement it myself as soon as I have time in case that sounds interesting for you.

Originally created by @devbydaniel on GitHub (Oct 13, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/529 Hi! First of all, great app! I was wondering if you'd consider an option where users can restrict the automatic AI tagging to only use tags which are created by the user. The background is that some people (like me) will have a pretty clear set of pre-defined tags which they want to use. Restricting the AI to only use these tags would greatly improve the organization of the bookmark library because everything will be sorted into expected buckets. I briefly went through your code, and I think the implementation could look something like - extend the prompt builder functions in `/packages/shared/prompts.ts` to accept an optional `userDefinedTags` param and if present, add those tags to the prompt - If the results are unreliable, switch the OpenAI call to use [function calling](https://platform.openai.com/docs/guides/function-calling) as the way to return the list of tags (since launching the [structured output API extension](https://openai.com/index/introducing-structured-outputs-in-the-api/), OpenAI guarantees 100% accuracy in function calling, so this should definitely work), e.g. like so: ```ts { "name": "assign_tags", "description": "Assign tags to the given bookmark according to the content. If no tags fit the bookmark, return an empty array", "parameters": { "type": "object", "properties": { "tags": { "type": "array", "description": "The array of tags which should be assigned to the bookmark.", "items": { "type": "string", "enum": ["tag1", "tag2", "tag3"] // dynamically load user tags here }, }, }, "required": ["tags"], "additionalProperties": false, } } ``` - add an option to the UI to restrict tag assignment to only consider user defined tags - in `/apps/workers/openaiWorker.ts` check if that option is present and if so, pass the user defined tags to the prompt builder I'm happy to support you / provide more details / try to implement it myself as soon as I have time in case that sounds interesting for you.
kerem closed this issue 2026-03-02 11:49:02 +03:00
Author
Owner

@kamtschatka commented on GitHub (Oct 13, 2024):

Sounds exactly like https://github.com/hoarder-app/hoarder/issues/111, but with some suggestions on how to fix it?

<!-- gh-comment-id:2408967773 --> @kamtschatka commented on GitHub (Oct 13, 2024): Sounds exactly like https://github.com/hoarder-app/hoarder/issues/111, but with some suggestions on how to fix it?
Author
Owner

@devbydaniel commented on GitHub (Oct 13, 2024):

Ahh, thanks for the hint, I will respond there

<!-- gh-comment-id:2409005385 --> @devbydaniel commented on GitHub (Oct 13, 2024): Ahh, thanks for the hint, I will respond there
Author
Owner

@kamtschatka commented on GitHub (Oct 13, 2024):

duplicate of https://github.com/hoarder-app/hoarder/issues/111

<!-- gh-comment-id:2409027073 --> @kamtschatka commented on GitHub (Oct 13, 2024): duplicate of https://github.com/hoarder-app/hoarder/issues/111
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#341
No description provided.