Commit Graph

32 Commits

Author SHA1 Message Date
Ubuntu 594144e195 fix(simulation): move regenerate_agent validation to request handler (404/400 before task creation) 2026-05-03 22:02:56 +00:00
Ubuntu 5d679024c3 feat(simulation): add POST /agent create and /agent/{id}/regenerate endpoints
Implements Tasks 8 and 9 of F2-A+B: async agent creation from entity UUID
and async per-agent profile regeneration, both with atomic profile file writes.
Refactors generate_profile_from_entity to accept extra_instructions instead
of requiring user_id (renamed internal logic to _generate_single_profile).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 21:59:25 +00:00
Ubuntu 306414a555 fix(simulation): add int coercion and 400 validation for max_agents in prepare endpoint 2026-05-03 21:56:03 +00:00
Ubuntu ef46ba1743 feat(simulation): add max_agents selector via top-N connectivity in prepare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 21:54:34 +00:00
Ubuntu a74c0975fe fix(simulation): fix clone 400→404 for not found, remove redundant makedirs, hoist uuid import
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 21:52:35 +00:00
Ubuntu a6b4ccca3c feat(simulation): add POST /<simulation_id>/clone endpoint (Task 6)
Implements SimulationManager.clone_simulation() and the corresponding
Flask route. The clone copies reddit_profiles.json, twitter_profiles.csv
and agent_profiles.json from the source simulation; does not copy
simulation_config.json; sets status=PROFILES_READY and records
parent_simulation_id. All 3 tests in test_simulation_clone.py pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 21:48:57 +00:00
Ubuntu ed71afe442 fix(simulation): add FileNotFoundError check in delete_agent_profile and endpoint 2026-05-03 21:44:55 +00:00
Ubuntu 83cf890c83 feat(simulation): add DELETE agent, POST generate-config, PATCH config endpoints
- DELETE /<sim_id>/agent/<user_id>: removes agent from reddit_profiles.json (atomic write, guards against running/completed status)
- POST /<sim_id>/generate-config: transitions profiles_ready→configuring→ready, runs LLM config generation in background thread, returns task_id
- PATCH /<sim_id>/config: merges time/platform config fields into simulation_config.json (atomic write)
- Corresponding SimulationManager methods: delete_agent_profile(), patch_simulation_config()
- 7 tests all passing (3 original + 4 new)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 21:43:02 +00:00
Ubuntu c0356e706a fix(simulation): catch FileNotFoundError in patch_agent endpoint (return 404 not 500) 2026-05-03 21:40:16 +00:00
Ubuntu f7dd353a31 feat(simulation): add PATCH /simulation/{id}/agent/{user_id} endpoint
Implements atomic agent profile editing with manually_edited flag.
Blocks edits when simulation is running or completed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 21:37:19 +00:00
Ubuntu d09ee23cd3 feat: ontology import, project recovery, graphiti improvements, and docs
- Add ontology import from file (Step 1)
- Persist active task_id to project.json for browser-refresh recovery
- Add project list endpoint and frontend recovery UI
- Improve Graphiti backend stability and oasis profile generation
- Add TechnicalDesign.md and enterprise roadmap spec
- Update .gitignore to exclude secrets and local-only docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 14:28:14 +00:00
Ubuntu 09935e53a0 refactor(graph): remove hardcoded ZEP checks, use get_graph_config_errors; add embed/small LLM env docs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 21:10:40 +00:00
Ubuntu 7d172b9eec chore(i18n): replace all hardcoded Chinese strings with English in backend
Translate all Chinese comments, docstrings, log messages, error messages,
and LLM prompt text to English across the entire backend codebase.
Locale translation files (locales/*.json) are unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 23:40:58 +00:00
ghostubborn 380e456d41 fix(i18n): replace hardcoded Chinese stage names in simulation prepare SSE 2026-04-01 17:31:00 +08:00
ghostubborn 7c07237544 fix(i18n): pass locale to background threads via thread-local storage
Background threads (graph building, simulation prep, report generation,
profile generation) now inherit the requesting user's locale preference.
Previously these fell back to 'zh' because Flask request context was
unavailable in spawned threads.
2026-04-01 16:55:51 +08:00
ghostubborn 9d43b77511 feat(i18n): replace hardcoded Chinese in backend SSE progress messages 2026-04-01 16:32:10 +08:00
ghostubborn 74f673a238 feat(i18n): replace hardcoded Chinese in backend API responses with t() calls 2026-04-01 15:32:24 +08:00
666ghj e25d2e38f4 feat(SimulationAPI): add function to retrieve latest report ID for a given simulation
- Implemented `_get_report_id_for_simulation` to find the most recent report ID associated with a simulation ID by scanning the reports directory.
- Updated `get_simulation_history` to include the retrieved report ID in the response, enhancing the simulation data returned to the client.
2026-01-09 16:04:35 +08:00
666ghj 992f7d13c3 refactor(simulation): enhance simulation data retrieval and project file handling
- Updated simulation history retrieval to read project details directly from the Simulation file.
- Improved simulation configuration handling by reading simulation requirements from JSON.
- Added project file listing to the simulation history, displaying up to three associated files.
- Refined card layout in HistoryDatabase.vue to accommodate new file display features and improved responsiveness.
2026-01-07 18:54:33 +08:00
666ghj e6da45ee63 feat(history): 添加首页历史项目展示组件
- 新增 HistoryDatabase.vue 组件,实现扇形堆叠到网格展开的动画效果
- 后端 simulation.py 添加历史模拟数据 API 支持
- 修复 SimulationManager 过滤隐藏文件问题
- 前端 simulation.js 添加获取历史模拟数据的 API 方法
- Home.vue 集成历史项目展示组件
- 实现正方形网格背景装饰效果
2025-12-31 17:54:39 +08:00
666ghj f8a58819fa Enhance simulation functionality and frontend components for improved user experience
- Updated the simulation API to include a new 'force' parameter, allowing users to restart simulations while cleaning up previous logs.
- Enhanced the simulation status detail retrieval to include all actions and platform-specific actions for better monitoring.
- Introduced a new SimulationRunView component to manage the simulation process, providing a clear interface for users to start and monitor simulations.
- Improved the Step3Simulation component with detailed logging and progress indicators, ensuring users receive real-time updates during the simulation.
- Added new API endpoints for retrieving simulation posts and actions, enhancing the overall functionality and user engagement.
2025-12-12 14:44:10 +08:00
666ghj 4345f3085e Enhance simulation preparation process and frontend display for improved user experience
- Added synchronous retrieval of entity count before starting background tasks in simulation.py, allowing immediate access to expected agent totals for the frontend.
- Updated the simulation state to include expected entity count and types, enhancing the information available during preparation.
- Modified Step2EnvSetup.vue to display a pending status when the simulation is in progress and adjusted the simulation rounds configuration to dynamically reflect calculated values.
- Improved the slider for custom rounds to ensure it adapts to the auto-generated maximum rounds, enhancing usability and clarity.
2025-12-12 11:41:33 +08:00
666ghj 8b5d082fb1 Add real-time simulation configuration endpoint and update frontend components
- Introduced a new API endpoint for retrieving real-time simulation configuration, allowing users to view progress and metadata during simulation generation.
- Updated frontend API service to include the new real-time configuration method.
- Enhanced Step2EnvSetup.vue to support real-time polling for configuration updates, improving user experience during simulation setup.
- Revised display logic to show detailed configuration summaries and orchestration content, enriching the simulation setup process.
2025-12-11 18:44:00 +08:00
666ghj 1f191cb21e Enhance interview prompt handling and update README.md
- Introduced a prefix to optimize interview prompts, ensuring agents respond directly with text without invoking tools.
- Updated the simulation API to utilize the optimized prompts for individual and batch interviews.
- Modified the `get_interview_history` function to allow for flexible platform querying, returning results from both Reddit and Twitter when no platform is specified.
- Enhanced README.md to include new prompt optimization details and updated API usage examples for clarity.
2025-12-08 16:08:33 +08:00
666ghj 1042d50306 Implement Interview feature for agent interactions in simulations
- Added a new Interview module to facilitate interactions with agents post-simulation, allowing for single and batch interviews.
- Introduced IPC communication mechanism for command and response handling between the Flask backend and simulation scripts.
- Updated README.md to include detailed instructions on the new Interview functionality, including API endpoints and usage examples.
- Enhanced simulation scripts to support waiting for commands after completion, improving user control over the simulation environment.
- Implemented error handling and logging for interview processes, ensuring robust operation and traceability.
2025-12-08 15:55:39 +08:00
666ghj e3768e2707 Implement dynamic graph memory update feature for simulations
- Added a new optional parameter `enable_graph_memory_update` to the simulation API, allowing real-time updates of agent activities to the Zep knowledge graph.
- Introduced `ZepGraphMemoryUpdater` and `ZepGraphMemoryManager` classes to handle the background processing of activity updates, ensuring efficient API calls and data management.
- Updated the README.md to include detailed instructions on the new graph memory update functionality and its configuration.
- Enhanced the simulation runner to manage the lifecycle of the graph memory updater, including starting and stopping the updater based on user configuration.
- Improved logging to track the status of graph memory updates, providing better insights into the simulation process.
2025-12-05 17:53:45 +08:00
666ghj 5b4f02f421 Enhance simulation configuration and management features
- Added support for a `max_rounds` parameter in simulation API, allowing users to limit the number of simulation rounds, improving control over simulation duration.
- Updated README.md to reflect the new `max_rounds` parameter and its usage in simulation requests.
- Enhanced error handling for `max_rounds` input validation to ensure it is a positive integer.
- Modified simulation runner and related scripts to incorporate `max_rounds` functionality, ensuring consistent application across Twitter and Reddit simulations.
- Improved logging to indicate when the number of rounds is truncated due to the `max_rounds` setting, enhancing traceability during simulation execution.
2025-12-05 15:50:54 +08:00
666ghj 88676e8207 Implement real-time profile retrieval and saving in simulation API
- Added a new endpoint to retrieve real-time agent profiles during simulation, allowing users to monitor progress without going through the SimulationManager.
- Enhanced the profile generation process to support real-time saving of generated profiles to specified file formats (JSON for Reddit, CSV for Twitter).
- Updated the simulation configuration generator to assign appropriate agents to initial posts based on their types, improving the relevance of generated content.
- Improved error handling and logging for better traceability during profile generation and retrieval processes.
2025-12-04 19:02:10 +08:00
666ghj d4fac63eb4 Enhance simulation management and logging features
- Registered a cleanup function for simulation processes to ensure proper termination on server shutdown.
- Improved logging during application startup to confirm the registration of the cleanup function.
- Updated simulation preparation checks to clarify the conditions for considering a simulation ready, enhancing error handling and user feedback.
- Added detailed logging for simulation status changes, improving traceability during the simulation lifecycle.
- Introduced new files for simulation configuration and profile data, supporting enhanced testing and visualization capabilities.
2025-12-02 17:11:47 +08:00
666ghj 3cc5e3f479 Refactor simulation management and enhance logging capabilities
- Updated simulation preparation checks to exclude script files from the required files list, improving clarity on file management.
- Implemented a robust retry mechanism for Zep API calls in the ZepEntityReader service, enhancing reliability.
- Enhanced logging in simulation scripts to provide clearer insights into the simulation process and errors.
- Updated simulation runner to manage stdout and stderr logs more effectively, ensuring better error tracking.
- Improved profile generation to standardize gender fields and ensure all required fields are populated correctly.
2025-12-02 14:25:53 +08:00
666ghj af5c235695 Enhance OASIS simulation capabilities and profile generation
- Updated README.md to include detailed descriptions of new features, including Zep mixed search functionality and detailed persona generation for individual and group entities.
- Implemented a robust mechanism for checking simulation preparation status to avoid redundant profile generation.
- Added support for parallel profile generation, improving efficiency in creating OASIS Agent Profiles.
- Enhanced the simulation configuration generator to adopt a stepwise approach, ensuring better handling of complex configurations.
- Introduced error handling and retry mechanisms for LLM calls, improving the reliability of profile generation.
- Updated simulation management to support new API parameters for controlling profile generation behavior.
2025-12-01 19:40:07 +08:00
666ghj 5f159f6d88 Enhance backend functionality with OASIS simulation features
- Updated README.md to include new simulation scripts and configuration details for OASIS, including API retry mechanisms and environment variable settings.
- Added simulation management and configuration generation services to streamline the simulation process across Twitter and Reddit platforms.
- Introduced new API routes for simulation-related operations, including entity retrieval and simulation status management.
- Implemented a robust retry mechanism for external API calls to improve system stability.
- Enhanced task management model to include detailed progress tracking.
- Added logging capabilities for action tracking during simulations.
- Included new scripts for running parallel simulations and testing profile formats.
2025-12-01 15:03:44 +08:00