sessions-memory
Choose and configure session memory, server-managed continuation, backends, compaction, and multi-turn history for openai-agents-python.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- sessions-memory
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Choose and configure session memory, server-managed continuation, backends, compaction, and multi-turn history for openai-agents-python.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/backends.md6.1 KB
- 参考文档references/troubleshooting.md5.2 KB
- 参考文档references/workflows.md7.9 KB
- 脚本scripts/check_session_backend.py6.0 KB
03 SKILL.md 正文
Sessions and Memory
Use this sub-skill when a task mentions session, memory, SQLiteSession, RedisSession, SQLAlchemySession, conversation_id, previous_response_id, compaction, or multi-turn history.
Route First
| Need | Use | Details |
|---|---|---|
| SDK-managed client-side history | session=... with a Session backend |
See backends and workflows. |
| OpenAI server-managed continuation | conversation_id, previous_response_id, or auto_previous_response_id |
Do not combine with session; see workflows. |
| Basic agent loop behavior | Core runtime | Route to core-runtime. |
| Provider auth, model defaults, transport selection | Models/providers | Route to models-providers. |
| Sandbox filesystem/process memory | Sandbox agents | Route to sandbox-agents unless normal SDK sessions are involved. |
What To Configure
- Pick one history owner: either an SDK
Sessionbackend or OpenAI server-managed continuation, never both in the same run. - For local or simple persistent memory, start with
SQLiteSession(session_id, db_path=...). - For production storage, choose an extension backend by deployment constraints, required extras, and lifecycle ownership in backends.
- For long conversations, use
SessionSettings(limit=...),RunConfig.session_input_callback, or compaction depending on whether you need retrieval limiting, custom merge logic, or stored-history replacement. - For approval or interruption resumes, pass the same
sessionobject or another instance pointing at the same backing store when callingRunner.run(agent, state, session=session).
Required Safety Checks
- Before recommending a backend, run or adapt the bundled no-network helper:
python scripts/check_session_backend.py --backend sqlite --json. - When optional backends fail to import, report the missing extra and avoid constructing network clients unless the user explicitly asks.
- When behavior is surprising, consult troubleshooting before changing runtime code.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).