feat(examples): modernize all 26 existing examples to current framework majors and the 0.6.0-dev API - #252
Merged
Conversation
… majors and the 0.6.0-dev API One commit for all 26 existing examples (21 Python, 5 TypeScript), their smoke tests, and the docs pages that pair with them. New examples land separately. Dependencies: pydantic-ai 2.x (full-stack-chat-agent, lennys-memory, pydantic_ai_agent.py), google-adk 2.x + google-genai (google_adk_demo, google_cloud_integration, FSA google-cloud), agent-framework-core 1.13+ (microsoft retail assistant), strands-agents 1.52+ (FSA aws, strands examples), langchain 1.x (langchain_agent.py, nams-langchain), fastmcp 4 (mcp_server_demo), ai 7 / @ai-sdk/openai 4 (ts vercel-ai), @strands-agents/sdk 1.16, @modelcontextprotocol/sdk 1.30, @langchain/core 1.2 and @mastra/core 1.66 (ts langchain and mastra are now runnable, not shape-only). Frontends on Next 16 / React 19 (three apps) and Vite 8 / react-router 7 / motion 13 (two apps); NVL 1.2, Chakra 3.37. Library pinned >=0.5.0,<0.7 everywhere with the editable path source; duplicate requirements.txt files removed. Memory usage: examples use the library adapters instead of hand-rolled glue, read back what they write (search_entities, get_context, get_similar_traces), record reasoning traces with triggered_by_message_id, touched_entities and TraceOutcome, use client.query.cypher instead of client._client.execute_*, and exercise the features their READMEs advertise (MemoryIntegration, DeduplicationConfig, extraction, buffered-write measurement, all three eval dimensions). The NAMS trio showcases workspace addressing, bulk_add_messages, wait_for_extraction/get_extraction_status, observations/reflections and expand_graph. Safety: seed scripts no longer DETACH DELETE the whole database (existing-graph, FSA loader); the Microsoft backend validates relationship types instead of interpolating them into Cypher; the chat backend's read-only guard is fixed. Structure: domain-schemas collapses eight near-identical scripts into one parametrized runner with thin wrappers; shared examples/_env.py and examples/.env.example replace copy-pasted env loading; retired model ids (gpt-4o, claude-3-*, text-embedding-004) replaced by env-driven ids with current defaults; Neo4j images standardized on 5.26-community with APOC. Tests: every example has an executing smoke test (new modules for nams-quickstart, nams-fastapi, nams-langchain, lennys-memory); NAMS paths run against respx-mocked transports; the phantom-method guard now resolves against both bolt and NAMS classes and additionally rejects private client reach-through and adapter phantoms. READMEs carry Labs badges, disclaimer, expected output, and a "verified against" footer (0.6.0-dev, 2026-09-10).
…f sensitive information' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…f sensitive information' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…f sensitive information' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…alues in logs - microsoft retail frontend: generate the shopping session id with crypto.randomUUID() instead of Math.random() (js/insecure-randomness). - ts mastra / strands / vercel-ai: stop echoing DEMO_USER_ID and the Mastra resourceId in log output (js/clear-text-logging); the re-run hint names the variable without its value. Strands test updated to assert the id is not printed.
…t-memory into update-existing-examples
…ce id On the bridge transport the adapter synthesizes thread ids from the resource id, which the example reads from DEMO_USER_ID, so CodeQL (js/clear-text-logging) traced the environment value into the log.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
One PR for every existing example (21 Python, 5 TypeScript), their smoke tests, and the docs pages that pair with them. This is Phase 2 of the examples review (
examples-review-and-improvement-plan.md). The seven new examples, the examples index, the CI/Makefile gates, and the nav entries follow in two separate PRs.492 files, +107,270 / −38,867. Most of the volume is regenerated lockfiles in the app backends and frontends and the domain-schemas consolidation; the per-example logic changes are listed below.
Dependencies
pydantic_ai_agent.py)>=0.0.39>=2.0,<3via the library adapter>=0.3.0>=2.0,<3/>=1.66agent-framework-core>=1.13,<2>=0.1.0>=1.52,<2langchain_agent.py, nams-langchain)>=0.2.0>=1.0,<2with the newcreate_agentmiddleware adapterai ^4ai ^7+@ai-sdk/openai ^4, V4 middleware@strands-agents/sdk/@modelcontextprotocol/sdk^1.2/^1.0^1.16/^1.30@langchain/core ^1.2and@mastra/core ^1.66neo4j-agent-memoryin every manifest>=0.1.0orgit+main>=0.5.0,<0.7with the editable path source; duplicaterequirements.txtremovedMemory usage
search_entities,get_context,get_similar_traces) so each demo proves its claim.triggered_by_message_id,touched_entities, t.query.cypherreplaces ~80client.client.execute*` reach-throughs.MemoryIntegrationin the chat backend,DeduplicationConfigin the retail assistant, long-term memory inthe FSA aws backend, a measured speedup in buffered-writes, all three evble preference case.
bulk_add_messages,wait_for_extraction/get_extraction_status, observations and reflections, andexpand_graph.Safety fixes
existing-graphseed and the FSA loader no longerMATCH (n) DETACH Ddatabase they are pointed at (explicit--reset`, scoped to seededlabels).Structure and hygiene
domain-schemas: eight near-identical scripts become one parametrizedsamples; the old filenames remain as thin wrappers for one release.examples/_env.py(loadsexamples/.env.example) replaces copy-pasted env loading; retired model ids (gpt-4o,claude-3-*,text-embedding-004) replaced byenv-driven ids with current defaults; Neo4j images standardized on `neo4C.
tsconfig.tsbuildinfo); Lenny'sdata/README.mddocuments transcript acquisition and a synthetic sample.adk_memory_service.pyis reduced to a pointer rather than deleted.Tests
nams-quickams-langchain(respx-mocked NAMS) andlennys-memory(loader dry-run on the synthetic sample).test_no_phantom_methods.pyresolves calls against both the bolt and rejects privateclient._clientreach-through and adapter phantoms inexamples/.Verification
Applied on top of
mainin a clean worktree:make checkclean;tests/unit1,794 passed;tests/examplesagainst Neo4j 5.26 693 passed, 31 skipped, 1 expected xfail(pin sweep, cleared by this PR's manifests once the wiring PR removes thuick selection 681 passed. All nine TypeScript examplestypecheck/test/build and all five frontends build (verified on the full tree in the final round; this PR's copies are identical).
Fires
ci-python.ymlonexamples/**,tests/**,docs/**;ci-typescript.es/**. The frontend build job and theruff/mypy coverage ofexamples/arrive in the wiring PR; one file (aws-financial-services-advisor/backend/handler.py:6) has an import-sort finding under that future gate.