Develop Personalized Recommendation Logic with pgvector

implementationChallenge

Prompt Content

Design the logic for a `RecommendationAgent` that fetches a user's reading history and preferences, generates embeddings for the current article and user profile, and then queries a PostgreSQL database with pgvector for similar articles. The agent should then generate a list of `RecommendationItem` objects. Describe how you would create and query the pgvector index, and provide conceptual Python code for the agent's core recommendation logic.

Try this prompt

Open the workspace to execute this prompt with free credits, or use your own API keys for unlimited usage.

Usage Tips

Copy the prompt and paste it into your preferred AI tool (Claude, ChatGPT, Gemini)

Customize placeholder values with your specific requirements and context

For best results, provide clear examples and test different variations