claude-smart 0.2.41 → 0.2.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +17 -0
- package/README.md +1 -1
- package/bin/claude-smart.js +86 -48
- package/package.json +10 -3
- package/plugin/.claude-plugin/plugin.json +9 -3
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/README.md +2 -2
- package/plugin/dashboard/next.config.ts +9 -1
- package/plugin/pyproject.toml +2 -2
- package/plugin/scripts/_lib.sh +91 -0
- package/plugin/scripts/backend-service.sh +46 -15
- package/plugin/scripts/cli.sh +29 -1
- package/plugin/scripts/codex-hook.js +72 -4
- package/plugin/scripts/dashboard-build.sh +1 -0
- package/plugin/scripts/dashboard-service.sh +1 -0
- package/plugin/scripts/ensure-plugin-root.sh +7 -14
- package/plugin/scripts/hook_entry.sh +1 -0
- package/plugin/scripts/smart-install.sh +18 -2
- package/plugin/src/claude_smart/cli.py +72 -38
- package/plugin/src/claude_smart/context_format.py +11 -12
- package/plugin/src/claude_smart/cs_cite.py +26 -12
- package/plugin/src/claude_smart/ids.py +13 -5
- package/plugin/uv.lock +1 -1
- package/plugin/vendor/reflexio/.env.example +53 -0
- package/plugin/vendor/reflexio/LICENSE +201 -0
- package/plugin/vendor/reflexio/README.md +338 -0
- package/plugin/vendor/reflexio/pyproject.toml +271 -0
- package/plugin/vendor/reflexio/reflexio/README.md +184 -0
- package/plugin/vendor/reflexio/reflexio/__init__.py +166 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/README.md +109 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/backends.py +175 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/bench.py +642 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/embed_cache.py +330 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/report.py +317 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/results/report.md +43 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/results/results.json +4478 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/scenarios.py +134 -0
- package/plugin/vendor/reflexio/reflexio/benchmarks/retrieval_latency/seed.py +255 -0
- package/plugin/vendor/reflexio/reflexio/cli/README.md +287 -0
- package/plugin/vendor/reflexio/reflexio/cli/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/cli/__main__.py +56 -0
- package/plugin/vendor/reflexio/reflexio/cli/_client.py +86 -0
- package/plugin/vendor/reflexio/reflexio/cli/app.py +127 -0
- package/plugin/vendor/reflexio/reflexio/cli/bootstrap_config.py +266 -0
- package/plugin/vendor/reflexio/reflexio/cli/codex_auth.py +503 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/admin_cmd.py +65 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/agent_playbooks.py +503 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/api.py +114 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/auth.py +109 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/config_cmd.py +511 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/doctor.py +127 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/embeddings.py +53 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/interactions.py +478 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/profiles.py +303 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/services.py +289 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/setup_cmd.py +961 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/shortcuts.py +285 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/status_cmd.py +143 -0
- package/plugin/vendor/reflexio/reflexio/cli/commands/user_playbooks.py +373 -0
- package/plugin/vendor/reflexio/reflexio/cli/env_loader.py +284 -0
- package/plugin/vendor/reflexio/reflexio/cli/errors.py +217 -0
- package/plugin/vendor/reflexio/reflexio/cli/log_format.py +247 -0
- package/plugin/vendor/reflexio/reflexio/cli/output.py +867 -0
- package/plugin/vendor/reflexio/reflexio/cli/paths.py +41 -0
- package/plugin/vendor/reflexio/reflexio/cli/run_services.py +391 -0
- package/plugin/vendor/reflexio/reflexio/cli/state.py +204 -0
- package/plugin/vendor/reflexio/reflexio/cli/stop_services.py +96 -0
- package/plugin/vendor/reflexio/reflexio/cli/utils.py +329 -0
- package/plugin/vendor/reflexio/reflexio/client/__init__.py +3 -0
- package/plugin/vendor/reflexio/reflexio/client/cache.py +150 -0
- package/plugin/vendor/reflexio/reflexio/client/client.py +2613 -0
- package/plugin/vendor/reflexio/reflexio/defaults.py +23 -0
- package/plugin/vendor/reflexio/reflexio/integrations/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/.clawhubignore +7 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/README.md +274 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/TESTING.md +517 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/hook/handler.js +473 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package-lock.json +2156 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/package.json +18 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/handler.ts +241 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/hook/setup.ts +140 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/index.ts +130 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/publish.ts +113 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/search.ts +52 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/server.ts +103 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/sqlite-buffer.ts +156 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/lib/user-id.ts +134 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/openclaw.plugin.json +41 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/package.json +17 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/rules/reflexio.md +24 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/plugin/skills/reflexio/SKILL.md +48 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/publish_clawhub.sh +278 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/references/HOOK.md +164 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/install.sh +36 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/scripts/uninstall.sh +35 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/publish.test.ts +27 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/search.test.ts +31 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/server.test.ts +42 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/setup.test.ts +49 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/sqlite-buffer.test.ts +91 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tests/user-id.test.ts +50 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/tsconfig.json +16 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/types/openclaw.d.ts +230 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw/vitest.config.ts +13 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/README.md +120 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/TESTING.md +168 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/package-lock.json +1657 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/package.json +16 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/HEARTBEAT.md +6 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/README.md +84 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/SKILL.md +194 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/_meta.json +6 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/agents/reflexio-extractor.md +45 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/hook/handler.ts +214 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/hook/setup.ts +55 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/index.ts +327 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/consolidate.ts +233 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/dedup.ts +80 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/io.ts +155 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/openclaw-cli.ts +67 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/search.ts +33 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/write-playbook.ts +76 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/lib/write-profile.ts +79 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/openclaw.plugin.json +46 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/package.json +18 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/README.md +36 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/full_consolidation.md +56 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/playbook_extraction.md +217 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/prompts/profile_extraction.md +132 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/skills/reflexio-consolidate/SKILL.md +33 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/plugin/skills/reflexio-embedded/SKILL.md +194 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/HOOK.md +18 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/architecture.md +49 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/comparison.md +31 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/future-work.md +47 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/references/porting-notes.md +52 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/scripts/install.sh +52 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/scripts/uninstall.sh +36 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/consolidate.test.ts +135 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/dedup.test.ts +104 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/io.test.ts +175 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/search.test.ts +66 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/smoke-test.ts +140 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/write-playbook.test.ts +93 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tests/write-profile.test.ts +174 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/tsconfig.json +16 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/types/openclaw.d.ts +230 -0
- package/plugin/vendor/reflexio/reflexio/integrations/openclaw-embedded/vitest.config.ts +7 -0
- package/plugin/vendor/reflexio/reflexio/lib/__init__.py +23 -0
- package/plugin/vendor/reflexio/reflexio/lib/_agent_playbook.py +310 -0
- package/plugin/vendor/reflexio/reflexio/lib/_base.py +225 -0
- package/plugin/vendor/reflexio/reflexio/lib/_config.py +83 -0
- package/plugin/vendor/reflexio/reflexio/lib/_dashboard.py +266 -0
- package/plugin/vendor/reflexio/reflexio/lib/_generation.py +176 -0
- package/plugin/vendor/reflexio/reflexio/lib/_interactions.py +334 -0
- package/plugin/vendor/reflexio/reflexio/lib/_operations.py +153 -0
- package/plugin/vendor/reflexio/reflexio/lib/_profiles.py +545 -0
- package/plugin/vendor/reflexio/reflexio/lib/_reflection.py +52 -0
- package/plugin/vendor/reflexio/reflexio/lib/_search.py +167 -0
- package/plugin/vendor/reflexio/reflexio/lib/_storage_labels.py +103 -0
- package/plugin/vendor/reflexio/reflexio/lib/_user_playbook.py +288 -0
- package/plugin/vendor/reflexio/reflexio/lib/reflexio_lib.py +27 -0
- package/plugin/vendor/reflexio/reflexio/models/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/braintrust_schema.py +141 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/common.py +41 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/__init__.py +3 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/entities.py +1103 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/domain/enums.py +63 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/eval_overview_schema.py +487 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/internal_schema.py +28 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/pending_tool_call_schema.py +83 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/retriever_schema.py +766 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/service_schemas.py +9 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/stall_state_schema.py +32 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/__init__.py +3 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/converters.py +177 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/entities.py +129 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/ui/enums.py +25 -0
- package/plugin/vendor/reflexio/reflexio/models/api_schema/validators.py +280 -0
- package/plugin/vendor/reflexio/reflexio/models/config_schema.py +908 -0
- package/plugin/vendor/reflexio/reflexio/models/py.typed +0 -0
- package/plugin/vendor/reflexio/reflexio/server/OVERVIEW.md +90 -0
- package/plugin/vendor/reflexio/reflexio/server/README.md +616 -0
- package/plugin/vendor/reflexio/reflexio/server/__init__.py +210 -0
- package/plugin/vendor/reflexio/reflexio/server/__main__.py +132 -0
- package/plugin/vendor/reflexio/reflexio/server/_auth.py +25 -0
- package/plugin/vendor/reflexio/reflexio/server/api.py +2714 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/account_api.py +143 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/health_api.py +91 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/pending_tool_call_api.py +572 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/precondition_checks.py +66 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/publisher_api.py +540 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/request_context.py +50 -0
- package/plugin/vendor/reflexio/reflexio/server/api_endpoints/stall_state_api.py +100 -0
- package/plugin/vendor/reflexio/reflexio/server/cache/__init__.py +15 -0
- package/plugin/vendor/reflexio/reflexio/server/cache/reflexio_cache.py +208 -0
- package/plugin/vendor/reflexio/reflexio/server/correlation.py +46 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/__init__.py +30 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/embedding_service.py +110 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/image_utils.py +55 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/litellm_client.py +1595 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/llm_utils.py +112 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/model_defaults.py +469 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/claude_code_provider.py +1122 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/claude_code_stream_parser.py +197 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/embedding_service_provider.py +210 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/local_embedding_provider.py +213 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/providers/nomic_embedding_provider.py +255 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/rerank/__init__.py +6 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/rerank/cross_encoder_reranker.py +177 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/rerank/llm_reranker.py +148 -0
- package/plugin/vendor/reflexio/reflexio/server/llm/tools.py +699 -0
- package/plugin/vendor/reflexio/reflexio/server/operation_limiter.py +179 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/_dispatchers.py +54 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/README.md +121 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/agent_success_evaluation/v1.0.0.prompt.md +58 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/agent_success_evaluation_with_comparison/v1.0.0.prompt.md +76 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/answer_synthesis/v1.5.2.prompt.md +88 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/compress_session_for_query/v1.3.0.prompt.md +31 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/document_expansion/v1.0.0.prompt.md +20 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.0.0.prompt.md +53 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.1.0.prompt.md +57 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.2.0.prompt.md +68 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.3.0.prompt.md +70 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.4.0.prompt.md +77 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.5.0.prompt.md +82 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/memory_reflection/v1.6.0.prompt.md +83 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.1.0.prompt.md +193 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_aggregation/v2.2.0.prompt.md +206 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v1.0.0-deprecated.prompt.md +66 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v1.0.0.prompt.md +43 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v1.1.0.prompt.md +46 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.0.0-deprecated.prompt.md +64 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.0.0.prompt.md +39 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.1.0.prompt.md +39 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.2.0.prompt.md +47 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_consolidation/v2.3.0.prompt.md +58 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.0.2.prompt.md +254 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.1.0.prompt.md +274 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context/v4.2.0.prompt.md +279 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v1.0.0.prompt.md +73 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v2.0.0.prompt.md +86 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.0.0.prompt.md +97 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.1.0.prompt.md +119 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.2.0.prompt.md +123 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_context_expert/v3.3.0.prompt.md +127 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.0.0.prompt.md +14 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.1.0.prompt.md +24 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main/v1.2.0.prompt.md +29 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.0.0.prompt.md +11 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.1.0.prompt.md +21 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_extraction_main_expert/v1.2.0.prompt.md +25 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.0.0.prompt.md +37 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.1.0.prompt.md +40 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_optimizer_judge/v1.2.0.prompt.md +36 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v1.0.0.prompt.md +45 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v2.0.0.prompt.md +81 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate/v3.0.0.prompt.md +80 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/playbook_should_generate_expert/v1.0.0.prompt.md +34 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_deduplication/v1.0.0.prompt.md +116 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_should_generate/v1.0.0.prompt.md +33 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_should_generate_override/v1.0.0.prompt.md +16 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.0.0.prompt.md +140 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_instruction_start/v1.1.0.prompt.md +160 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/profile_update_main/v1.0.0.prompt.md +14 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/query_reformulation/v1.0.0.prompt.md +19 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/rerank_relevance/v1.1.0.prompt.md +44 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/shadow_comparison/v1.0.0.prompt.md +43 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_bank/shadow_content_evaluation/v1.0.0.prompt.md +33 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_evaluation/prompt_evaluation_dataset/feedback_extraction_main_v1.jsonl +10 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_evaluation/prompt_evaluation_dataset/profile_update_main_v1.jsonl +10 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_manager.py +280 -0
- package/plugin/vendor/reflexio/reflexio/server/prompt/prompt_schema.py +11 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/_eval_health.py +131 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_constants.py +60 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_service.py +228 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluation_utils.py +87 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/agent_success_evaluator.py +372 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/delayed_group_evaluator.py +156 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/group_evaluation_runner.py +340 -0
- package/plugin/vendor/reflexio/reflexio/server/services/agent_success_evaluation/regen_jobs.py +471 -0
- package/plugin/vendor/reflexio/reflexio/server/services/base_generation_service.py +1626 -0
- package/plugin/vendor/reflexio/reflexio/server/services/braintrust/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/braintrust/_cron.py +196 -0
- package/plugin/vendor/reflexio/reflexio/server/services/braintrust/_encryption.py +101 -0
- package/plugin/vendor/reflexio/reflexio/server/services/braintrust/client.py +167 -0
- package/plugin/vendor/reflexio/reflexio/server/services/braintrust/service.py +281 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/base_configurator.py +179 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/config_storage.py +62 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/configurator.py +87 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/local_file_config_storage.py +187 -0
- package/plugin/vendor/reflexio/reflexio/server/services/configurator/test_config_storage.py +162 -0
- package/plugin/vendor/reflexio/reflexio/server/services/deduplication_utils.py +112 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/distribution.py +33 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/eval_sampler.py +126 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/group_aggregation.py +192 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/hero_state.py +75 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/rule_attribution.py +97 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/service.py +515 -0
- package/plugin/vendor/reflexio/reflexio/server/services/evaluation_overview/shadow_aggregation.py +90 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/agent_run_records.py +91 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/invariants.py +303 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/outcome.py +25 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/pending_tool_call_dispatch.py +351 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/plan.py +138 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/prior_answer_search.py +217 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/resumable_agent.py +468 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/resume_scheduler.py +171 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/resume_worker.py +777 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extraction/tools.py +1125 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extractor_config_utils.py +91 -0
- package/plugin/vendor/reflexio/reflexio/server/services/extractor_interaction_utils.py +251 -0
- package/plugin/vendor/reflexio/reflexio/server/services/generation_service.py +689 -0
- package/plugin/vendor/reflexio/reflexio/server/services/operation_state_utils.py +835 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/README.md +89 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_aggregator.py +1388 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_consolidator.py +960 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_extractor.py +436 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_generation_service.py +808 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_service_constants.py +28 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook/playbook_service_utils.py +362 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/__init__.py +24 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/assistant_webhook.py +246 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/gepa_adapter.py +291 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/judge.py +97 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/models.py +96 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/optimizer.py +645 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/rollout.py +35 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/scenario_resolver.py +93 -0
- package/plugin/vendor/reflexio/reflexio/server/services/playbook_optimizer/scheduler.py +174 -0
- package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/__init__.py +26 -0
- package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/_document_expander.py +179 -0
- package/plugin/vendor/reflexio/reflexio/server/services/pre_retrieval/_query_reformulator.py +297 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_deduplicator.py +741 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_extractor.py +462 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_generation_service.py +734 -0
- package/plugin/vendor/reflexio/reflexio/server/services/profile/profile_generation_service_utils.py +290 -0
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/__init__.py +17 -0
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_extractor.py +247 -0
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_service.py +800 -0
- package/plugin/vendor/reflexio/reflexio/server/services/reflection/reflection_service_utils.py +146 -0
- package/plugin/vendor/reflexio/reflexio/server/services/retrieval/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/retrieval/relevance_floor.py +70 -0
- package/plugin/vendor/reflexio/reflexio/server/services/search/__init__.py +0 -0
- package/plugin/vendor/reflexio/reflexio/server/services/service_utils.py +671 -0
- package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/judge.py +184 -0
- package/plugin/vendor/reflexio/reflexio/server/services/shadow_comparison/outcome.py +81 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/constants.py +2 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/error.py +11 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/retention.py +154 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/retention_mixin.py +155 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/__init__.py +59 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_agent_run.py +1253 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_base.py +1945 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_extras.py +600 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_operations.py +346 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_playbook.py +1378 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_profiles.py +747 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_requests.py +263 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_shadow_verdicts.py +193 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_share_links.py +166 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/sqlite_storage/_stall_state.py +217 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/__init__.py +153 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_agent_run.py +372 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_base.py +71 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_extras.py +235 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_operations.py +170 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_playbook.py +677 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_profiles.py +250 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_requests.py +154 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_shadow_verdicts.py +130 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_share_links.py +93 -0
- package/plugin/vendor/reflexio/reflexio/server/services/storage/storage_base/_stall_state.py +76 -0
- package/plugin/vendor/reflexio/reflexio/server/services/unified_search_service.py +568 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/README.md +77 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/feature_flags.py +116 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_manager.py +263 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/feature_flags.json +13 -0
- package/plugin/vendor/reflexio/reflexio/server/site_var/site_var_sources/llm_model_setting.json +7 -0
- package/plugin/vendor/reflexio/reflexio/server/tracing.py +158 -0
- package/plugin/vendor/reflexio/reflexio/server/usage_metrics.py +113 -0
- package/plugin/vendor/reflexio/reflexio/server/uvicorn_logging.py +76 -0
- package/plugin/vendor/reflexio/reflexio/test_support/__init__.py +1 -0
- package/plugin/vendor/reflexio/reflexio/test_support/llm_fixtures.py +62 -0
- package/plugin/vendor/reflexio/reflexio/test_support/llm_mock.py +242 -0
- package/plugin/vendor/reflexio/reflexio/test_support/llm_model_registry.py +129 -0
- package/plugin/vendor/reflexio/reflexio/test_support/skip_decorators.py +43 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: false
|
|
3
|
+
description: "Main prompt for extracting playbook entries from user interactions"
|
|
4
|
+
changelog: "v1.1.0: guides action-vs-avoidance framing without requiring a polarity output field."
|
|
5
|
+
variables:
|
|
6
|
+
- interactions
|
|
7
|
+
---
|
|
8
|
+
## Conversation
|
|
9
|
+
{interactions}
|
|
10
|
+
|
|
11
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
12
|
+
## Action vs avoidance framing
|
|
13
|
+
|
|
14
|
+
Write each playbook in the form that best matches its evidence:
|
|
15
|
+
|
|
16
|
+
- Use direct action language for successful, neutral, or ambiguous evidence. This is the default and covers most entries.
|
|
17
|
+
- Use avoidance language only when the specific rule is grounded in a clear failure pattern: user pushback, self-correction away from an approach, external refutation, or explicit dislike.
|
|
18
|
+
|
|
19
|
+
When writing an avoidance rule, start `content` with `Avoid`, `Do not`, `Don't`, or `Never`, and make the `rationale` name the observed failure pattern. Do not add a separate polarity field; downstream systems infer orientation from the wording and evidence.
|
|
20
|
+
|
|
21
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
22
|
+
## Output
|
|
23
|
+
|
|
24
|
+
Return ONLY the JSON object.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: true
|
|
3
|
+
description: "Main prompt for extracting playbook entries from user interactions"
|
|
4
|
+
changelog: "v1.2.0: adds emergent skill-convention guidance for structuring multi-aspect playbook content as a small set of grouped do/avoid rules (no schema change). v1.1.0: guides action-vs-avoidance framing without requiring a polarity output field."
|
|
5
|
+
variables:
|
|
6
|
+
- interactions
|
|
7
|
+
---
|
|
8
|
+
## Conversation
|
|
9
|
+
{interactions}
|
|
10
|
+
|
|
11
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
12
|
+
## Action vs avoidance framing
|
|
13
|
+
|
|
14
|
+
Write each playbook in the form that best matches its evidence:
|
|
15
|
+
|
|
16
|
+
- Use direct action language for successful, neutral, or ambiguous evidence. This is the default and covers most entries.
|
|
17
|
+
- Use avoidance language only when the specific rule is grounded in a clear failure pattern: user pushback, self-correction away from an approach, external refutation, or explicit dislike.
|
|
18
|
+
|
|
19
|
+
When writing an avoidance rule, start `content` with `Avoid`, `Do not`, `Don't`, or `Never`, and make the `rationale` name the observed failure pattern. Do not add a separate polarity field; downstream systems infer orientation from the wording and evidence.
|
|
20
|
+
|
|
21
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
22
|
+
## Structuring multi-aspect content
|
|
23
|
+
|
|
24
|
+
When the guidance for a playbook covers multiple steps or sub-aspects of a task, write `content` as a short set of rules grouped by sub-goal, rather than one dense sentence. Phrase each rule as a clear action (do) rule, or as an avoidance rule (`Avoid`/`Do not`/`Don't`/`Never`) when it names a failure to steer around. Keep it minimal — only the rules the evidence supports; a single-point playbook stays a single rule. Do not force structure where the guidance is atomic.
|
|
25
|
+
|
|
26
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
27
|
+
## Output
|
|
28
|
+
|
|
29
|
+
Return ONLY the JSON object.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: false
|
|
3
|
+
description: "User prompt for expert-content playbook extraction, provides agent-vs-expert comparison pairs"
|
|
4
|
+
variables:
|
|
5
|
+
- comparison_pairs
|
|
6
|
+
---
|
|
7
|
+
Below are comparisons between the agent's actual response and an expert's ideal response for the same user questions.
|
|
8
|
+
|
|
9
|
+
{comparison_pairs}
|
|
10
|
+
|
|
11
|
+
Analyze the differences and extract generalizable SOPs following the JSON format specified in your instructions. Return ONLY valid JSON, no other text.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: false
|
|
3
|
+
description: "User prompt for expert-content playbook extraction, provides agent-vs-expert comparison pairs"
|
|
4
|
+
changelog: "v1.1.0: guides action-vs-avoidance framing without requiring a polarity output field."
|
|
5
|
+
variables:
|
|
6
|
+
- comparison_pairs
|
|
7
|
+
---
|
|
8
|
+
Below are comparisons between the agent's actual response and an expert's ideal response for the same user questions.
|
|
9
|
+
|
|
10
|
+
{comparison_pairs}
|
|
11
|
+
|
|
12
|
+
## Action vs avoidance framing
|
|
13
|
+
|
|
14
|
+
Write each playbook in the form that best matches its evidence:
|
|
15
|
+
|
|
16
|
+
- Use direct action language for successful, neutral, or ambiguous evidence. This is the default and covers most entries.
|
|
17
|
+
- Use avoidance language only when the specific rule is grounded in a clear failure pattern: the agent's approach failed relative to the expert response, the expert avoided a risky path the agent took, an external check refuted the agent, or the user explicitly disliked the outcome.
|
|
18
|
+
|
|
19
|
+
When writing an avoidance rule, start `content` with `Avoid`, `Do not`, `Don't`, or `Never`, and make the `rationale` name the observed failure pattern. Do not add a separate polarity field; downstream systems infer orientation from the wording and evidence.
|
|
20
|
+
|
|
21
|
+
Analyze the differences and extract generalizable SOPs following the JSON format specified in your instructions. Return ONLY valid JSON, no other text.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: true
|
|
3
|
+
description: "User prompt for expert-content playbook extraction, provides agent-vs-expert comparison pairs"
|
|
4
|
+
changelog: "v1.2.0: adds emergent skill-convention guidance for structuring multi-aspect playbook content as a small set of grouped do/avoid rules (no schema change). v1.1.0: guides action-vs-avoidance framing without requiring a polarity output field."
|
|
5
|
+
variables:
|
|
6
|
+
- comparison_pairs
|
|
7
|
+
---
|
|
8
|
+
Below are comparisons between the agent's actual response and an expert's ideal response for the same user questions.
|
|
9
|
+
|
|
10
|
+
{comparison_pairs}
|
|
11
|
+
|
|
12
|
+
## Action vs avoidance framing
|
|
13
|
+
|
|
14
|
+
Write each playbook in the form that best matches its evidence:
|
|
15
|
+
|
|
16
|
+
- Use direct action language for successful, neutral, or ambiguous evidence. This is the default and covers most entries.
|
|
17
|
+
- Use avoidance language only when the specific rule is grounded in a clear failure pattern: the agent's approach failed relative to the expert response, the expert avoided a risky path the agent took, an external check refuted the agent, or the user explicitly disliked the outcome.
|
|
18
|
+
|
|
19
|
+
When writing an avoidance rule, start `content` with `Avoid`, `Do not`, `Don't`, or `Never`, and make the `rationale` name the observed failure pattern. Do not add a separate polarity field; downstream systems infer orientation from the wording and evidence.
|
|
20
|
+
|
|
21
|
+
## Structuring multi-aspect content
|
|
22
|
+
|
|
23
|
+
When the guidance for a playbook covers multiple steps or sub-aspects of a task, write `content` as a short set of rules grouped by sub-goal, rather than one dense sentence. Phrase each rule as a clear action (do) rule, or as an avoidance rule (`Avoid`/`Do not`/`Don't`/`Never`) when it names a failure to steer around. Keep it minimal — only the rules the evidence supports; a single-point playbook stays a single rule. Do not force structure where the guidance is atomic.
|
|
24
|
+
|
|
25
|
+
Analyze the differences and extract generalizable SOPs following the JSON format specified in your instructions. Return ONLY valid JSON, no other text.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: playbook_optimizer_judge
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
active: false
|
|
5
|
+
description: Judge paired real-assistant rollouts for playbook optimization
|
|
6
|
+
variables:
|
|
7
|
+
- source_window_json
|
|
8
|
+
- incumbent_playbook_json
|
|
9
|
+
- candidate_playbook_json
|
|
10
|
+
- incumbent_rollout_json
|
|
11
|
+
- candidate_rollout_json
|
|
12
|
+
---
|
|
13
|
+
You are judging whether a candidate playbook content change improves the real assistant's behavior.
|
|
14
|
+
|
|
15
|
+
Use the source window as the ground-truth scenario context. Compare the incumbent rollout and candidate rollout. The user turns were held constant; only the injected playbook content changed.
|
|
16
|
+
|
|
17
|
+
Source window:
|
|
18
|
+
{source_window_json}
|
|
19
|
+
|
|
20
|
+
Incumbent playbook:
|
|
21
|
+
{incumbent_playbook_json}
|
|
22
|
+
|
|
23
|
+
Candidate playbook:
|
|
24
|
+
{candidate_playbook_json}
|
|
25
|
+
|
|
26
|
+
Incumbent rollout:
|
|
27
|
+
{incumbent_rollout_json}
|
|
28
|
+
|
|
29
|
+
Candidate rollout:
|
|
30
|
+
{candidate_rollout_json}
|
|
31
|
+
|
|
32
|
+
Return structured JSON matching the requested schema:
|
|
33
|
+
- verdict: "candidate", "incumbent", or "tie"
|
|
34
|
+
- score: 1.0 for clear candidate win, 0.5 for tie, 0.0 for clear incumbent win; use intermediate values only for weak wins
|
|
35
|
+
- likert: 1 to 5 quality score for candidate behavior
|
|
36
|
+
- rationale: concise explanation
|
|
37
|
+
- asi: actionable side information with failure_modes, regressions, winning_behaviors, missing_instruction, recommended_mutation
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: false
|
|
3
|
+
description: Judge paired real-assistant rollouts for playbook optimization
|
|
4
|
+
changelog: "v1.1.0: polarity-aware like-with-like comparison — opposing-polarity candidates trigger evidence re-examination instead of eloquence-based winner selection. Deprecated in v1.2.0: the polarity branch was inert (the judge payload never sent a polarity field) and removed under Option B."
|
|
5
|
+
variables:
|
|
6
|
+
- source_window_json
|
|
7
|
+
- incumbent_playbook_json
|
|
8
|
+
- candidate_playbook_json
|
|
9
|
+
- incumbent_rollout_json
|
|
10
|
+
- candidate_rollout_json
|
|
11
|
+
---
|
|
12
|
+
You are judging whether a candidate playbook content change improves the real assistant's behavior.
|
|
13
|
+
|
|
14
|
+
Use the source window as the ground-truth scenario context. Compare the incumbent rollout and candidate rollout. The user turns were held constant; only the injected playbook content changed.
|
|
15
|
+
|
|
16
|
+
Source window:
|
|
17
|
+
{source_window_json}
|
|
18
|
+
|
|
19
|
+
Incumbent playbook:
|
|
20
|
+
{incumbent_playbook_json}
|
|
21
|
+
|
|
22
|
+
Candidate playbook:
|
|
23
|
+
{candidate_playbook_json}
|
|
24
|
+
|
|
25
|
+
Incumbent rollout:
|
|
26
|
+
{incumbent_rollout_json}
|
|
27
|
+
|
|
28
|
+
Candidate rollout:
|
|
29
|
+
{candidate_rollout_json}
|
|
30
|
+
|
|
31
|
+
Return structured JSON matching the requested schema:
|
|
32
|
+
- verdict: "candidate", "incumbent", or "tie"
|
|
33
|
+
- score: 1.0 for clear candidate win, 0.5 for tie, 0.0 for clear incumbent win; use intermediate values only for weak wins
|
|
34
|
+
- likert: 1 to 5 quality score for candidate behavior
|
|
35
|
+
- rationale: concise explanation
|
|
36
|
+
- asi: actionable side information with failure_modes, regressions, winning_behaviors, missing_instruction, recommended_mutation
|
|
37
|
+
|
|
38
|
+
## Polarity-aware judgment
|
|
39
|
+
|
|
40
|
+
If the candidates differ in their `polarity` field (one positive, one negative), do not pick the more eloquent one. Re-examine the source evidence to determine which polarity is correct; then pick the best candidate of that polarity. If you cannot determine the correct polarity from the evidence, return `verdict = "tie"` (no winner) with `score = 0.5`.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: true
|
|
3
|
+
description: Judge paired real-assistant rollouts for playbook optimization
|
|
4
|
+
changelog: "v1.2.0: removed the dead Polarity-aware judgment section. Under Option B, production no longer derives polarity mechanically and the judge payload (_playbook_payload) never sends a `polarity` field, so that branch was inert."
|
|
5
|
+
variables:
|
|
6
|
+
- source_window_json
|
|
7
|
+
- incumbent_playbook_json
|
|
8
|
+
- candidate_playbook_json
|
|
9
|
+
- incumbent_rollout_json
|
|
10
|
+
- candidate_rollout_json
|
|
11
|
+
---
|
|
12
|
+
You are judging whether a candidate playbook content change improves the real assistant's behavior.
|
|
13
|
+
|
|
14
|
+
Use the source window as the ground-truth scenario context. Compare the incumbent rollout and candidate rollout. The user turns were held constant; only the injected playbook content changed.
|
|
15
|
+
|
|
16
|
+
Source window:
|
|
17
|
+
{source_window_json}
|
|
18
|
+
|
|
19
|
+
Incumbent playbook:
|
|
20
|
+
{incumbent_playbook_json}
|
|
21
|
+
|
|
22
|
+
Candidate playbook:
|
|
23
|
+
{candidate_playbook_json}
|
|
24
|
+
|
|
25
|
+
Incumbent rollout:
|
|
26
|
+
{incumbent_rollout_json}
|
|
27
|
+
|
|
28
|
+
Candidate rollout:
|
|
29
|
+
{candidate_rollout_json}
|
|
30
|
+
|
|
31
|
+
Return structured JSON matching the requested schema:
|
|
32
|
+
- verdict: "candidate", "incumbent", or "tie"
|
|
33
|
+
- score: 1.0 for clear candidate win, 0.5 for tie, 0.0 for clear incumbent win; use intermediate values only for weak wins
|
|
34
|
+
- likert: 1 to 5 quality score for candidate behavior
|
|
35
|
+
- rationale: concise explanation
|
|
36
|
+
- asi: actionable side information with failure_modes, regressions, winning_behaviors, missing_instruction, recommended_mutation
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: false
|
|
3
|
+
description: "Determines if playbook extraction should occur based on user interactions (deactivated by v2 which adds Success Path Recipe signal detection to match v3 playbook_extraction_context)"
|
|
4
|
+
variables:
|
|
5
|
+
- agent_context_prompt
|
|
6
|
+
- extraction_definition_prompt
|
|
7
|
+
- new_interactions
|
|
8
|
+
- tool_can_use
|
|
9
|
+
---
|
|
10
|
+
You are a detector for GLOBAL AGENT LEARNING SIGNALS.
|
|
11
|
+
|
|
12
|
+
Decide whether the conversation contains ANY signal that could justify
|
|
13
|
+
changing permanent agent behavior for ALL users.
|
|
14
|
+
|
|
15
|
+
Count as signal if the conversation or the agent's behavior reveals:
|
|
16
|
+
• correction or criticism of agent behavior
|
|
17
|
+
• re-steering of how the agent should respond
|
|
18
|
+
• dissatisfaction, confusion, or friction
|
|
19
|
+
• evidence of a better universal interaction default
|
|
20
|
+
• an avoidable interaction mistake or inefficiency
|
|
21
|
+
• agent had a relevant tool available but never used it when doing so could have improved the outcome (e.g., looking up options, gathering context, or checking information before responding)
|
|
22
|
+
• agent addressed the surface request without using tools to explore whether a better solution exists for the user's stated underlying need
|
|
23
|
+
• agent used suboptimal tool parameters (retry patterns, vague inputs)
|
|
24
|
+
|
|
25
|
+
Ignore:
|
|
26
|
+
• normal task content
|
|
27
|
+
• factual corrections
|
|
28
|
+
• personal preferences
|
|
29
|
+
• domain-specific tips
|
|
30
|
+
• task-local guidance
|
|
31
|
+
|
|
32
|
+
AGENT CONTEXT
|
|
33
|
+
{agent_context_prompt}
|
|
34
|
+
|
|
35
|
+
PLAYBOOK DEFINITION
|
|
36
|
+
{extraction_definition_prompt}
|
|
37
|
+
|
|
38
|
+
[Available Tools]
|
|
39
|
+
{tool_can_use}
|
|
40
|
+
|
|
41
|
+
CONVERSATION
|
|
42
|
+
{new_interactions}
|
|
43
|
+
|
|
44
|
+
OUTPUT
|
|
45
|
+
Return only true or false.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: false
|
|
3
|
+
description: "Determines if playbook extraction should occur. v2 adds Success Path Recipe signal detection alongside the v1 correction signals — keeps the gate narrow enough to reject trivial content but wide enough to let clean successful trajectories through to the extractor."
|
|
4
|
+
changelog: "v2: v1 explicitly told the LLM to IGNORE normal task content and task-local guidance, which blocked the v3 Success Path Recipe extractor (playbook_extraction_context/v3) from ever running. v2 adds a second accept-track for trajectories that completed a substantive domain task successfully, so the v3 extractor can produce a reusable recipe. Trivial chit-chat and no-op interactions still get rejected."
|
|
5
|
+
variables:
|
|
6
|
+
- agent_context_prompt
|
|
7
|
+
- extraction_definition_prompt
|
|
8
|
+
- new_interactions
|
|
9
|
+
- tool_can_use
|
|
10
|
+
---
|
|
11
|
+
You are a detector for AGENT LEARNING SIGNALS. You accept a conversation
|
|
12
|
+
for playbook extraction if it contains EITHER of two kinds of signal.
|
|
13
|
+
|
|
14
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
15
|
+
## Track 1 — Correction / Friction signal
|
|
16
|
+
|
|
17
|
+
Accept if the conversation reveals any of:
|
|
18
|
+
• correction or criticism of agent behavior
|
|
19
|
+
• re-steering of how the agent should respond
|
|
20
|
+
• dissatisfaction, confusion, or friction
|
|
21
|
+
• evidence of a better universal interaction default
|
|
22
|
+
• an avoidable interaction mistake or inefficiency
|
|
23
|
+
• agent had a relevant tool available but never used it when doing so
|
|
24
|
+
could have improved the outcome (e.g., looking up options, gathering
|
|
25
|
+
context, or checking information before responding)
|
|
26
|
+
• agent addressed the surface request without using tools to explore
|
|
27
|
+
whether a better solution exists for the user's stated underlying need
|
|
28
|
+
• agent used suboptimal tool parameters (retry patterns, vague inputs)
|
|
29
|
+
|
|
30
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
31
|
+
## Track 2 — Success Path Recipe signal
|
|
32
|
+
|
|
33
|
+
Also accept if the conversation shows the agent **successfully
|
|
34
|
+
completed a substantive domain task** end-to-end. This is the signal
|
|
35
|
+
the v3 Success Path Recipe extractor needs to produce a reusable
|
|
36
|
+
solution cache that a future run of the same task can shortcut with.
|
|
37
|
+
|
|
38
|
+
Accept when ALL of the following hold:
|
|
39
|
+
1. The agent produced a concrete deliverable (file written, dataset
|
|
40
|
+
computed, report generated, problem solved with a final answer),
|
|
41
|
+
OR reached an explicit completion signal (`<COMPLETE>`, `Task
|
|
42
|
+
done`, final summary message).
|
|
43
|
+
2. The work involved at least 3 meaningful steps — tool calls, file
|
|
44
|
+
reads/writes, shell commands, or substantive analytical turns. A
|
|
45
|
+
single-message response with no tool use is NOT enough.
|
|
46
|
+
3. The trajectory contains ANY of these reusable artifacts:
|
|
47
|
+
- Domain-specific constants, formulas, or parameter values the
|
|
48
|
+
agent relied on (e.g. tax rates, sample size formulas,
|
|
49
|
+
acceptance thresholds, column schemas)
|
|
50
|
+
- A specific tool / shell command sequence that worked
|
|
51
|
+
- A file-format or output-layout decision that satisfied the task
|
|
52
|
+
- A computed final answer or discrete result
|
|
53
|
+
- Key decisions the agent made with clear rationale
|
|
54
|
+
|
|
55
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
56
|
+
## Reject when
|
|
57
|
+
|
|
58
|
+
Reject (return false) if NEITHER track fires, specifically:
|
|
59
|
+
• The conversation is chit-chat / trivially short (fewer than 3
|
|
60
|
+
meaningful interactions) with no deliverable produced
|
|
61
|
+
• The agent made no tool calls AND produced no concrete artifact
|
|
62
|
+
• The content is pure social acknowledgment or one-off factual Q&A
|
|
63
|
+
with no downstream reusable structure
|
|
64
|
+
• The agent failed to reach any end state and left nothing useful
|
|
65
|
+
behind
|
|
66
|
+
|
|
67
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
68
|
+
AGENT CONTEXT
|
|
69
|
+
{agent_context_prompt}
|
|
70
|
+
|
|
71
|
+
PLAYBOOK DEFINITION
|
|
72
|
+
{extraction_definition_prompt}
|
|
73
|
+
|
|
74
|
+
[Available Tools]
|
|
75
|
+
{tool_can_use}
|
|
76
|
+
|
|
77
|
+
CONVERSATION
|
|
78
|
+
{new_interactions}
|
|
79
|
+
|
|
80
|
+
OUTPUT
|
|
81
|
+
Return only true or false.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: true
|
|
3
|
+
description: "Determines if playbook extraction should occur. v3 broadens the v2 success-path track so that non-quantitative deliverables (articles, legal memos, SOAP notes, editorial content) also pass when the agent actually produced the deliverable. v2's 'reusable artifacts' list biased toward quantitative tasks (constants, formulas) and rejected clean narrative-task successes."
|
|
4
|
+
changelog: "v3: v2 Track 2 required a 'domain-specific constant, formula, or parameter value' among its reusable-artifact options, which skewed acceptance toward data / finance / compliance tasks and rejected clean narrative successes like news articles (17 iter, 0.9 score) and pediatric SOAP notes. v3 rewrites the reusable-artifact list to also count produced document structure, quoted sources / citations, argumentative framing, or concrete editorial / clinical decisions. It also simplifies the success-path test to a single pass-condition (rather than v2's ALL-of-3) so the LLM gate is less likely to over-reject on technicalities. Trivial chit-chat, no-op interactions, and failed trajectories still get rejected."
|
|
5
|
+
variables:
|
|
6
|
+
- agent_context_prompt
|
|
7
|
+
- extraction_definition_prompt
|
|
8
|
+
- new_interactions
|
|
9
|
+
- tool_can_use
|
|
10
|
+
---
|
|
11
|
+
You are a detector for AGENT LEARNING SIGNALS. You accept a conversation
|
|
12
|
+
for playbook extraction if it contains EITHER of two kinds of signal.
|
|
13
|
+
|
|
14
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
15
|
+
## Track 1 — Correction / Friction signal
|
|
16
|
+
|
|
17
|
+
Accept if the conversation reveals any of:
|
|
18
|
+
• correction or criticism of agent behavior
|
|
19
|
+
• re-steering of how the agent should respond
|
|
20
|
+
• dissatisfaction, confusion, or friction
|
|
21
|
+
• evidence of a better universal interaction default
|
|
22
|
+
• an avoidable interaction mistake or inefficiency
|
|
23
|
+
• agent had a relevant tool available but never used it when doing so
|
|
24
|
+
could have improved the outcome (e.g., looking up options, gathering
|
|
25
|
+
context, or checking information before responding)
|
|
26
|
+
• agent addressed the surface request without using tools to explore
|
|
27
|
+
whether a better solution exists for the user's stated underlying need
|
|
28
|
+
• agent used suboptimal tool parameters (retry patterns, vague inputs)
|
|
29
|
+
|
|
30
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
31
|
+
## Track 2 — Success Path Recipe signal
|
|
32
|
+
|
|
33
|
+
Accept if the agent meaningfully worked a task, reached an end
|
|
34
|
+
state, AND the trajectory contains something non-obvious worth
|
|
35
|
+
learning:
|
|
36
|
+
|
|
37
|
+
> ≥3 meaningful actions (tool calls, file ops, analytical steps)
|
|
38
|
+
> AND the agent produced, decided, or resolved something the user
|
|
39
|
+
> asked for (deliverable, answer, decision, recommendation, plan,
|
|
40
|
+
> or completion signal)
|
|
41
|
+
> AND the trajectory contains at least one non-obvious element a
|
|
42
|
+
> future run could reuse: a specific decision with rationale, a
|
|
43
|
+
> command / approach / sequence that isn't the first thing to try,
|
|
44
|
+
> a domain fact the agent looked up or relied on, a structural or
|
|
45
|
+
> format choice the agent committed to, or a recovery move after
|
|
46
|
+
> a wrong turn.
|
|
47
|
+
|
|
48
|
+
A purely routine completion — agent did the obvious thing, made
|
|
49
|
+
no judgment calls, discovered nothing — does NOT pass. The bar
|
|
50
|
+
is "a future run of a similar task could shortcut by remembering
|
|
51
|
+
this," not just "the agent finished."
|
|
52
|
+
|
|
53
|
+
Deliverable type is not restricted: quantitative, narrative,
|
|
54
|
+
analytical, advisory, procedural, creative — all qualify, as long
|
|
55
|
+
as the non-obvious element is present.
|
|
56
|
+
|
|
57
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
58
|
+
## Reject when
|
|
59
|
+
|
|
60
|
+
Reject if neither Track 1 nor Track 2 fires. One explicit case to
|
|
61
|
+
call out on top of that: reject infrastructure-failure loops
|
|
62
|
+
(repeated tool / auth / sandbox / lookup errors with no actual task
|
|
63
|
+
progress) even if the action count is high — a failure-recovery
|
|
64
|
+
recipe is not worth caching.
|
|
65
|
+
|
|
66
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
67
|
+
AGENT CONTEXT
|
|
68
|
+
{agent_context_prompt}
|
|
69
|
+
|
|
70
|
+
PLAYBOOK DEFINITION
|
|
71
|
+
{extraction_definition_prompt}
|
|
72
|
+
|
|
73
|
+
[Available Tools]
|
|
74
|
+
{tool_can_use}
|
|
75
|
+
|
|
76
|
+
CONVERSATION
|
|
77
|
+
{new_interactions}
|
|
78
|
+
|
|
79
|
+
OUTPUT
|
|
80
|
+
Return only true or false.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: true
|
|
3
|
+
description: "Determines if expert-content playbook extraction should occur by checking for meaningful divergence between agent and expert responses"
|
|
4
|
+
variables:
|
|
5
|
+
- agent_context_prompt
|
|
6
|
+
- comparison_pairs
|
|
7
|
+
---
|
|
8
|
+
You are a detector for MEANINGFUL DIVERGENCE between an agent's response and an expert's ideal response.
|
|
9
|
+
|
|
10
|
+
Decide whether there is a substantive difference worth learning from.
|
|
11
|
+
|
|
12
|
+
Count as signal (return true) if:
|
|
13
|
+
- Expert uses a fundamentally different approach, reasoning, or methodology
|
|
14
|
+
- Expert includes important information or steps the agent missed
|
|
15
|
+
- Agent response contains inaccuracies or incorrect information that the expert avoids
|
|
16
|
+
- Expert demonstrates better tool usage, prioritization, or completeness
|
|
17
|
+
- Expert response addresses the user's underlying need more effectively
|
|
18
|
+
- Agent's response could lead to suboptimal or incorrect outcomes compared to expert
|
|
19
|
+
|
|
20
|
+
Do NOT count as signal (return false) if:
|
|
21
|
+
- Agent and expert responses are substantively equivalent (same approach, same conclusions)
|
|
22
|
+
- Differences are only stylistic or cosmetic (formatting, word choice, phrasing)
|
|
23
|
+
- Both responses would lead to the same practical outcome
|
|
24
|
+
- Differences are in level of detail but core content is the same
|
|
25
|
+
- Expert simply uses different examples to illustrate the same point
|
|
26
|
+
|
|
27
|
+
AGENT CONTEXT
|
|
28
|
+
{agent_context_prompt}
|
|
29
|
+
|
|
30
|
+
AGENT VS EXPERT COMPARISONS
|
|
31
|
+
{comparison_pairs}
|
|
32
|
+
|
|
33
|
+
OUTPUT
|
|
34
|
+
Return only true or false.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: true
|
|
3
|
+
description: "Identifies and merges duplicate profiles across NEW extractions and EXISTING profiles in the database"
|
|
4
|
+
changelog: "Added Last Modified date to profile format and temporal conflict resolution guidance — prefer newer information when profiles contradict."
|
|
5
|
+
variables:
|
|
6
|
+
- new_profile_count
|
|
7
|
+
- new_profiles
|
|
8
|
+
- existing_profile_count
|
|
9
|
+
- existing_profiles
|
|
10
|
+
---
|
|
11
|
+
[Goal]
|
|
12
|
+
You are a profile deduplication assistant. Your job is to identify and merge duplicate profiles across NEW extractions and EXISTING profiles in the database.
|
|
13
|
+
|
|
14
|
+
[Input]
|
|
15
|
+
You will receive two groups of profiles:
|
|
16
|
+
- {new_profile_count} NEW profiles (just extracted, not yet saved)
|
|
17
|
+
- {existing_profile_count} EXISTING profiles (already in the database)
|
|
18
|
+
|
|
19
|
+
Each profile includes: Content, TTL, Source, and Last Modified date.
|
|
20
|
+
|
|
21
|
+
[NEW Profiles]
|
|
22
|
+
{new_profiles}
|
|
23
|
+
|
|
24
|
+
[EXISTING Profiles]
|
|
25
|
+
{existing_profiles}
|
|
26
|
+
|
|
27
|
+
[Your Task]
|
|
28
|
+
1. Analyze ALL profiles (both NEW and EXISTING) and identify groups of duplicates
|
|
29
|
+
2. A duplicate group can contain ANY mix of NEW and EXISTING items — when a NEW profile is about the same topic as an EXISTING one, they should be grouped together
|
|
30
|
+
3. For each duplicate group:
|
|
31
|
+
- List the item_ids (e.g., "NEW-0", "EXISTING-1") of all items in this group
|
|
32
|
+
- Create a merged_content that combines the best/most specific information from all members
|
|
33
|
+
- Choose an appropriate merged_time_to_live (prefer the longest to preserve information)
|
|
34
|
+
4. List unique_ids of NEW profiles that are truly unique (no duplicates found in either NEW or EXISTING)
|
|
35
|
+
5. Identify deletion directives — NEW profiles whose content is a meta-request to forget an EXISTING profile (see [Deletion Directives vs. Fact Updates] below) — and emit them in `deletions` instead of `duplicate_groups` or `unique_ids`
|
|
36
|
+
|
|
37
|
+
[Guidelines for Identifying Duplicates]
|
|
38
|
+
- Profiles about the SAME topic/entity/preference are duplicates even if worded differently
|
|
39
|
+
- Example: "User likes Python" and "User prefers Python programming" are duplicates
|
|
40
|
+
- Example: "User's name is John" and "The user is called John Smith" are duplicates (merge to include full name)
|
|
41
|
+
- A NEW profile that refines or updates an EXISTING profile should be grouped with it
|
|
42
|
+
- Profiles about DIFFERENT topics are NOT duplicates even if similar in structure
|
|
43
|
+
- Example: "User likes pizza" and "User likes sushi" are NOT duplicates
|
|
44
|
+
|
|
45
|
+
[Guidelines for Merging]
|
|
46
|
+
- Combine all unique information from duplicates
|
|
47
|
+
- Remove redundancy but keep all facts
|
|
48
|
+
- Use clear, concise language
|
|
49
|
+
- Choose the most specific/detailed wording when there's overlap
|
|
50
|
+
- The merged result should be the best version combining insights from all group members
|
|
51
|
+
- Each profile includes a "Last Modified" date. When NEW and EXISTING profiles conflict (e.g., "likes beef" vs "is vegetarian"), prefer the more recent information as it reflects the user's latest state
|
|
52
|
+
- When merging conflicting profiles, use the newer profile's content as the primary basis and supplement with non-contradictory details from the older profile
|
|
53
|
+
|
|
54
|
+
[Time to Live Selection]
|
|
55
|
+
When merging, choose the longest TTL from the group:
|
|
56
|
+
- infinity > one_year > one_quarter > one_month > one_week > one_day
|
|
57
|
+
|
|
58
|
+
[Deletion Directives vs. Fact Updates]
|
|
59
|
+
A NEW profile is a **deletion directive** when its content is about the ACT of
|
|
60
|
+
forgetting, removing, or no-longer-storing an existing fact — not a new fact
|
|
61
|
+
about the user. Signals:
|
|
62
|
+
- Content begins with (or contains) the literal phrase **"Requested removal of"** — the upstream extractor emits this marker for every deletion request, so its presence is the strongest signal
|
|
63
|
+
- Content refers to the profile-storage system itself: "Asked to forget X", "Wants us to stop remembering X"
|
|
64
|
+
- Verbs like "removal", "forget", "delete", "stop storing" applied to an existing topic
|
|
65
|
+
- Content describes an intention about the stored memory rather than the user's own state
|
|
66
|
+
|
|
67
|
+
When a NEW profile is a deletion directive AND it matches an EXISTING profile
|
|
68
|
+
on the same topic:
|
|
69
|
+
- Emit it in `deletions` with `new_id` and the matched `existing_ids`
|
|
70
|
+
- Do NOT include it in `duplicate_groups` or `unique_ids`
|
|
71
|
+
- Do NOT create a merged profile like "Previously interested in X, but requested
|
|
72
|
+
removal of this interest" — that is a zombie profile. The correct outcome is:
|
|
73
|
+
the EXISTING profile is gone and no replacement is written.
|
|
74
|
+
|
|
75
|
+
Contrast with **fact updates** (keep existing merge behavior):
|
|
76
|
+
- "User is now vegetarian" (previously "likes beef") → duplicate_group, merge with newest-wins. This is a replacement of one fact with another.
|
|
77
|
+
- "User no longer works at Acme" (previously "works at Acme") → duplicate_group. The user is stating a new fact about themselves.
|
|
78
|
+
|
|
79
|
+
If a NEW deletion directive does not match any EXISTING profile, still emit it
|
|
80
|
+
in `deletions` with an empty `existing_ids: []` — do not add it to `unique_ids`,
|
|
81
|
+
because it is not a fact worth storing on its own.
|
|
82
|
+
|
|
83
|
+
Example — deletion directive:
|
|
84
|
+
- NEW-0: "Requested removal of interest in self-improving agents from stored profiles"
|
|
85
|
+
- EXISTING-0: "User is interested in self-improving agents"
|
|
86
|
+
```json
|
|
87
|
+
{{
|
|
88
|
+
"duplicate_groups": [],
|
|
89
|
+
"unique_ids": [],
|
|
90
|
+
"deletions": [
|
|
91
|
+
{{
|
|
92
|
+
"new_id": "NEW-0",
|
|
93
|
+
"existing_ids": ["EXISTING-0"],
|
|
94
|
+
"reasoning": "NEW-0 is a meta-request to forget the stored fact in EXISTING-0, not a new fact about the user. Delete EXISTING-0 without writing a replacement."
|
|
95
|
+
}}
|
|
96
|
+
]
|
|
97
|
+
}}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
[Output Format]
|
|
101
|
+
Return a JSON object with:
|
|
102
|
+
- duplicate_groups: Array of objects, each containing:
|
|
103
|
+
- item_ids: Array of strings (IDs matching the [PREFIX-N] format, e.g., "NEW-0", "EXISTING-2")
|
|
104
|
+
- merged_content: String (the merged profile text)
|
|
105
|
+
- merged_time_to_live: String (one of: one_day, one_week, one_month, one_quarter, one_year, infinity)
|
|
106
|
+
- unique_ids: Array of strings (IDs of unique NEW profiles, e.g., "NEW-2")
|
|
107
|
+
- deletions: Array of objects, each containing:
|
|
108
|
+
- new_id: String (ID of the NEW profile that is a deletion directive, e.g., "NEW-0")
|
|
109
|
+
- existing_ids: Array of strings (IDs of EXISTING profiles to delete, e.g., ["EXISTING-0"]; may be empty)
|
|
110
|
+
- reasoning: String (why this was classified as a deletion directive)
|
|
111
|
+
|
|
112
|
+
[Important]
|
|
113
|
+
- Every NEW profile must appear EXACTLY ONCE — either in a duplicate_group's item_ids, in unique_ids, or as the new_id of a deletion directive
|
|
114
|
+
- EXISTING profiles appear in duplicate_groups when superseded by a merge, or in a deletion directive's existing_ids when erased without replacement
|
|
115
|
+
- Be conservative — only group true duplicates, and only classify as a deletion directive when the NEW is clearly a memory-erasure request rather than a fact update
|
|
116
|
+
- If there are no EXISTING profiles, just deduplicate among the NEW profiles
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: true
|
|
3
|
+
description: "Determines if profile extraction should occur based on user interactions"
|
|
4
|
+
variables:
|
|
5
|
+
- agent_context_prompt
|
|
6
|
+
- should_extract_profile_prompt
|
|
7
|
+
- new_interactions
|
|
8
|
+
---
|
|
9
|
+
You are an user signal detection filter.
|
|
10
|
+
|
|
11
|
+
Determine whether the following user interactions contain ANY user profile signal
|
|
12
|
+
as defined below. A profile signal includes explicit facts, preferences, constraints,
|
|
13
|
+
corrections, feedback, dislikes, habitual behaviors, or inferred patterns that could
|
|
14
|
+
reasonably personalize future responses.
|
|
15
|
+
|
|
16
|
+
AGENT CONTEXT
|
|
17
|
+
{agent_context_prompt}
|
|
18
|
+
|
|
19
|
+
[Profile Signal Definition]
|
|
20
|
+
{should_extract_profile_prompt}
|
|
21
|
+
|
|
22
|
+
[User Interactions]
|
|
23
|
+
{new_interactions}
|
|
24
|
+
|
|
25
|
+
Decision rules:
|
|
26
|
+
- Return true if there is any signal about how the user prefers, behaves, thinks,
|
|
27
|
+
corrects the agent, or should be treated differently in the future.
|
|
28
|
+
- Return true even if the signal is implicit, partial or inferred.
|
|
29
|
+
- Return false if the content is only about completing the current task with no reusable
|
|
30
|
+
user-level signal (such as one-off formatting, situational details, generic chit-chat).
|
|
31
|
+
|
|
32
|
+
Output:
|
|
33
|
+
true or false only.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
active: true
|
|
3
|
+
description: "Override prompt for profile extraction decision with custom instructions"
|
|
4
|
+
variables:
|
|
5
|
+
- instruction_override
|
|
6
|
+
- new_interactions
|
|
7
|
+
---
|
|
8
|
+
[INSTRUCTION]
|
|
9
|
+
{instruction_override}
|
|
10
|
+
|
|
11
|
+
[User interactions start]
|
|
12
|
+
{new_interactions}
|
|
13
|
+
[User interactions end]
|
|
14
|
+
|
|
15
|
+
[Output]
|
|
16
|
+
Output just a boolean value, true if it contains any information based on the definition, false otherwise.
|