feat: AI auto-tagging - #1232
Conversation
|
This is awesome. Lgtm, hopefully this will get merged soon. |
|
@sissbruecker we are waiting for this |
|
@7jrxt42BxFZo4iAnN4CX sadly this is only a single OpenAI, not a self-hosted Ollama or other AI-APIs solution… The difference is not so bad but should be carefully thought of – my2ct |
|
@Eragos Then expand to any OpenAI compatible ones? I'd like an open router. |
I’m already working on Ollama integration, I was just waiting for this PR to be merged first and to check whether there were any blockers |
|
@emanuelebeffa Great news, that would be great. |
|
I almost finished Ollama integration, I’ll be reopening the PR soon |
Review SummaryThanks for this feature! The implementation is well-structured with good test coverage. I found a few issues worth addressing before merge. 🔴 CriticalBulk "Refresh AI tags" doesn't work for bookmarks with existing tags The documentation states:
However, if bookmark.tags.exists():
logger.info(f"Skipping AI tagging - bookmark {bookmark_id} already has tags")
returnSuggested fix: Add a def auto_tag_bookmark(user: User, bookmark: Bookmark, force: bool = False):
# ...
_auto_tag_bookmark_task(bookmark.id, user.id, force)
@task()
def _auto_tag_bookmark_task(bookmark_id: int, user_id: int, force: bool = False):
if bookmark.tags.exists() and not force:
return
# ...Then in 🟠 Important1. API key exposed in API response
Suggested fix: ai_api_key = serializers.CharField(write_only=True, required=False, allow_blank=True)2. No rate limiting for bulk AI operations Selecting many bookmarks for bulk refresh could trigger hundreds of API calls, potentially exceeding provider rate limits or incurring unexpected costs. Suggestion: Consider adding a limit or at least a warning in the UI. 🟡 Minor / Nice-to-have
Overall, great work! The Pydantic structured outputs, error handling with retry logic for 5xx errors, and hallucination filtering are all well done. 👍 |
|
Thanks for the review! I've pushed fixes for |
|
Looks great! I've reviewed the latest changes, and they successfully address all the previous points. The implementation looks solid and ready to go. |
|
Hey @sissbruecker I just rebased the PR after the latest commits on master. Could you please take a look so we can merge it? Thanks! |
|
To clarify.. this will allow us to use a local AI model to take all of our existing bookmarks and have AI auto-tag them based on title, content, both? |
|
The auto-tagging is based on URL, title and description. |
|
Thanks, this is awesome. I built a docker image locally for testing your feature but I had to remove python type hint at first to make it work: Did you experience the same error? |
|
Hi, when I merged the latest changes from origin/master, I forgot to build the Docker image. I’ve now pushed a commit that fixes the issue. |
|
@emanuelebeffa whats the status on this pull request, did @sissbruecker respond why this was not merged (yet)? |
|
@Radiotechniman not yet, no reply from @sissbruecker and repo has been quiet for a few months. PR's up to date and ready whenever he can take a look. |
|
Maybe we can start using your fork ? |
|
The growing list of unchecked PRs is concerning. Lots of AI slop driven? No idea, but it would be nice if the maintainer prioritized majorly useful features like this one and merged. |
Adds AI-powered auto-tagging functionality using OpenAI compatible APIs. Users can configure their API key, model, base URL and define a vocabulary of allowed tags, then use the "Refresh AI tags" action to automatically generate tag suggestions for their bookmarks based on content (URL, title, description).
The feature includes:
Estimated cost analysis
Using OpenAI's gpt-5-nano model at $0.05 per 1M input tokens and $0.4 per 1M output tokens:
Average cost per bookmark: ~$0.000043
Input: ~250 tokens
Cost: $0,0000125
Output: ~100 tokens
Cost: $0.00004
Possible future evolution