Skip to content

Conversation

@zhjuzi
Copy link

@zhjuzi zhjuzi commented Jul 22, 2025

feat: Add dynamic user profile agent

  • Add user profile agent module with PreferenceAgent class for behavioral analysis
  • Implement structured user profile types with Pydantic models (ProfileSummary, Preferences, CommunityProfile)
  • Define comprehensive enums for interests, interaction styles, content styles, behavioral archetypes, and community roles
  • Integrate dynamic user profile updates into OasisEnv with automatic collection and analysis
  • Add comprehensive unit tests covering agent functionality, data models, and enum validation

Key Features:

  • Real-time user behavior analysis and profile generation
  • Structured profile data with validation and type safety
  • Configurable profile update intervals and file storage
  • Support for incremental profile updates based on user actions
  • Robust error handling and fallback mechanisms

Files Modified:

  • oasis/environment/env.py: Add user profile update functionality
  • oasis/social_agent/agent.py: Remove max_iteration

Files Added:

  • oasis/user_profile_agent/: Complete user profile agent module
  • test/agent/test_user_profile_agent.py: Comprehensive unit tests

Closes #95

@zhjuzi zhjuzi changed the title Feat/user profile feat: Add dynamic user profile agent Jul 22, 2025
@zhangzaibin
Copy link
Member

Hi! @zhjuzi Can you provide a example code in the examples to show how your added feature works?

from oasis.social_platform.platform import Platform
from oasis.social_platform.typing import (ActionType, DefaultPlatformType,
RecsysType)
from oasis.user_profile_agent.agent import PreferenceAgent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pull this branch locally. This part can not be imported.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry!I actually missed this file 😭

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add profile agent demo in examples/preference_agent_demo.py
image

@zhjuzi zhjuzi force-pushed the feat/user-profile branch from 139863f to 45f9fb3 Compare July 27, 2025 10:52
@zhjuzi zhjuzi force-pushed the feat/user-profile branch 2 times, most recently from f7f7518 to 8a891ab Compare July 27, 2025 11:01
@zhjuzi zhjuzi force-pushed the feat/user-profile branch from 8a891ab to 166ccbb Compare July 27, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Enhance SocialEnvironment with Comprehensive User Profiles and Dynamic Updates

2 participants