@bluefly/openstandardagents 0.4.0 → 0.4.1
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/CHANGELOG.md +117 -0
- package/DEMO.md +212 -0
- package/README.md +75 -15
- package/dist/adapters/drupal/generator.d.ts +149 -0
- package/dist/adapters/drupal/generator.d.ts.map +1 -0
- package/dist/adapters/drupal/generator.js +1760 -0
- package/dist/adapters/drupal/generator.js.map +1 -0
- package/dist/adapters/drupal/index.d.ts +2 -0
- package/dist/adapters/drupal/index.d.ts.map +1 -1
- package/dist/adapters/drupal/index.js +3 -0
- package/dist/adapters/drupal/index.js.map +1 -1
- package/dist/adapters/npm/adapter.js +2 -2
- package/dist/adapters/npm/converter.js +3 -3
- package/dist/cli/banner.d.ts +21 -0
- package/dist/cli/banner.d.ts.map +1 -0
- package/dist/cli/banner.js +128 -0
- package/dist/cli/banner.js.map +1 -0
- package/dist/cli/commands/dev.command.d.ts +20 -0
- package/dist/cli/commands/dev.command.d.ts.map +1 -0
- package/dist/cli/commands/dev.command.js +78 -0
- package/dist/cli/commands/dev.command.js.map +1 -0
- package/dist/cli/commands/estimate.command.d.ts +12 -0
- package/dist/cli/commands/estimate.command.d.ts.map +1 -0
- package/dist/cli/commands/estimate.command.js +226 -0
- package/dist/cli/commands/estimate.command.js.map +1 -0
- package/dist/cli/commands/export-enhanced.command.d.ts +7 -0
- package/dist/cli/commands/export-enhanced.command.d.ts.map +1 -0
- package/dist/cli/commands/{export-v2.command.js → export-enhanced.command.js} +3 -3
- package/dist/cli/commands/export-enhanced.command.js.map +1 -0
- package/dist/cli/commands/export.command.d.ts.map +1 -1
- package/dist/cli/commands/export.command.js +82 -4
- package/dist/cli/commands/export.command.js.map +1 -1
- package/dist/cli/commands/init.command.d.ts.map +1 -1
- package/dist/cli/commands/init.command.js +2 -0
- package/dist/cli/commands/init.command.js.map +1 -1
- package/dist/cli/commands/test.command.d.ts +1 -0
- package/dist/cli/commands/test.command.d.ts.map +1 -1
- package/dist/cli/commands/test.command.js +172 -105
- package/dist/cli/commands/test.command.js.map +1 -1
- package/dist/cli/commands/types/wizard-config.types.d.ts +59 -0
- package/dist/cli/commands/types/wizard-config.types.d.ts.map +1 -0
- package/dist/cli/commands/types/wizard-config.types.js +34 -0
- package/dist/cli/commands/types/wizard-config.types.js.map +1 -0
- package/dist/cli/commands/upgrade.command.d.ts +9 -0
- package/dist/cli/commands/upgrade.command.d.ts.map +1 -0
- package/dist/cli/commands/upgrade.command.js +167 -0
- package/dist/cli/commands/upgrade.command.js.map +1 -0
- package/dist/cli/commands/wizard-api-first.command.d.ts +18 -0
- package/dist/cli/commands/wizard-api-first.command.d.ts.map +1 -0
- package/dist/cli/commands/wizard-api-first.command.js +854 -0
- package/dist/cli/commands/wizard-api-first.command.js.map +1 -0
- package/dist/cli/commands/wizard-interactive.command.d.ts +25 -0
- package/dist/cli/commands/wizard-interactive.command.d.ts.map +1 -0
- package/dist/cli/commands/wizard-interactive.command.js +1875 -0
- package/dist/cli/commands/wizard-interactive.command.js.map +1 -0
- package/dist/cli/commands/workspace.command.js +1 -1
- package/dist/cli/commands/workspace.command.js.map +1 -1
- package/dist/cli/index.js +9 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/schema-driven/index.d.ts +27 -0
- package/dist/cli/schema-driven/index.d.ts.map +1 -0
- package/dist/cli/schema-driven/index.js +34 -0
- package/dist/cli/schema-driven/index.js.map +1 -0
- package/dist/cli/schema-driven/schema-loader.d.ts +115 -0
- package/dist/cli/schema-driven/schema-loader.d.ts.map +1 -0
- package/dist/cli/schema-driven/schema-loader.js +270 -0
- package/dist/cli/schema-driven/schema-loader.js.map +1 -0
- package/dist/cli/schema-driven/ui-generator.d.ts +88 -0
- package/dist/cli/schema-driven/ui-generator.d.ts.map +1 -0
- package/dist/cli/schema-driven/ui-generator.js +326 -0
- package/dist/cli/schema-driven/ui-generator.js.map +1 -0
- package/dist/cli/wizard/interactive-wizard.d.ts +26 -0
- package/dist/cli/wizard/interactive-wizard.d.ts.map +1 -0
- package/dist/cli/wizard/interactive-wizard.js +296 -0
- package/dist/cli/wizard/interactive-wizard.js.map +1 -0
- package/dist/cli/wizard/template-catalog.d.ts +32 -0
- package/dist/cli/wizard/template-catalog.d.ts.map +1 -0
- package/dist/cli/wizard/template-catalog.js +99 -0
- package/dist/cli/wizard/template-catalog.js.map +1 -0
- package/dist/cli/wizard/use-cases.d.ts +37 -0
- package/dist/cli/wizard/use-cases.d.ts.map +1 -0
- package/dist/cli/wizard/use-cases.js +157 -0
- package/dist/cli/wizard/use-cases.js.map +1 -0
- package/dist/di-container.d.ts.map +1 -1
- package/dist/di-container.js +2 -0
- package/dist/di-container.js.map +1 -1
- package/dist/package.json +19 -9
- package/dist/runtime/agent-runner.d.ts +46 -0
- package/dist/runtime/agent-runner.d.ts.map +1 -0
- package/dist/runtime/agent-runner.js +346 -0
- package/dist/runtime/agent-runner.js.map +1 -0
- package/dist/sdks/kagent/crd-generator.d.ts +4 -0
- package/dist/sdks/kagent/crd-generator.d.ts.map +1 -1
- package/dist/sdks/kagent/crd-generator.js +83 -2
- package/dist/sdks/kagent/crd-generator.js.map +1 -1
- package/dist/sdks/kagent/k8s-resources-generator.d.ts +73 -0
- package/dist/sdks/kagent/k8s-resources-generator.d.ts.map +1 -0
- package/dist/sdks/kagent/k8s-resources-generator.js +286 -0
- package/dist/sdks/kagent/k8s-resources-generator.js.map +1 -0
- package/dist/sdks/kagent/types.d.ts +79 -0
- package/dist/sdks/kagent/types.d.ts.map +1 -1
- package/dist/sdks/shared/validation.d.ts +2 -2
- package/dist/services/cost-estimation/optimization-patterns.d.ts +23 -0
- package/dist/services/cost-estimation/optimization-patterns.d.ts.map +1 -0
- package/dist/services/cost-estimation/optimization-patterns.js +147 -0
- package/dist/services/cost-estimation/optimization-patterns.js.map +1 -0
- package/dist/services/cost-estimation/pricing.d.ts +29 -0
- package/dist/services/cost-estimation/pricing.d.ts.map +1 -0
- package/dist/services/cost-estimation/pricing.js +225 -0
- package/dist/services/cost-estimation/pricing.js.map +1 -0
- package/dist/services/cost-estimation/scenario-estimator.d.ts +59 -0
- package/dist/services/cost-estimation/scenario-estimator.d.ts.map +1 -0
- package/dist/services/cost-estimation/scenario-estimator.js +145 -0
- package/dist/services/cost-estimation/scenario-estimator.js.map +1 -0
- package/dist/services/cost-estimation/token-counter.service.d.ts +51 -0
- package/dist/services/cost-estimation/token-counter.service.d.ts.map +1 -0
- package/dist/services/cost-estimation/token-counter.service.js +125 -0
- package/dist/services/cost-estimation/token-counter.service.js.map +1 -0
- package/dist/services/dev-server/dev-server.service.d.ts +121 -0
- package/dist/services/dev-server/dev-server.service.d.ts.map +1 -0
- package/dist/services/dev-server/dev-server.service.js +290 -0
- package/dist/services/dev-server/dev-server.service.js.map +1 -0
- package/dist/services/dev-server/file-watcher.d.ts +101 -0
- package/dist/services/dev-server/file-watcher.d.ts.map +1 -0
- package/dist/services/dev-server/file-watcher.js +190 -0
- package/dist/services/dev-server/file-watcher.js.map +1 -0
- package/dist/services/dev-server/live-validator.d.ts +157 -0
- package/dist/services/dev-server/live-validator.d.ts.map +1 -0
- package/dist/services/dev-server/live-validator.js +301 -0
- package/dist/services/dev-server/live-validator.js.map +1 -0
- package/dist/services/dev-server/websocket-server.d.ts +137 -0
- package/dist/services/dev-server/websocket-server.d.ts.map +1 -0
- package/dist/services/dev-server/websocket-server.js +229 -0
- package/dist/services/dev-server/websocket-server.js.map +1 -0
- package/dist/services/export/anthropic/anthropic-exporter.d.ts +70 -0
- package/dist/services/export/anthropic/anthropic-exporter.d.ts.map +1 -0
- package/dist/services/export/anthropic/anthropic-exporter.js +576 -0
- package/dist/services/export/anthropic/anthropic-exporter.js.map +1 -0
- package/dist/services/export/anthropic/api-generator.d.ts +39 -0
- package/dist/services/export/anthropic/api-generator.d.ts.map +1 -0
- package/dist/services/export/anthropic/api-generator.js +395 -0
- package/dist/services/export/anthropic/api-generator.js.map +1 -0
- package/dist/services/export/anthropic/index.d.ts +18 -0
- package/dist/services/export/anthropic/index.d.ts.map +1 -0
- package/dist/services/export/anthropic/index.js +16 -0
- package/dist/services/export/anthropic/index.js.map +1 -0
- package/dist/services/export/anthropic/tools-generator.d.ts +35 -0
- package/dist/services/export/anthropic/tools-generator.d.ts.map +1 -0
- package/dist/services/export/anthropic/tools-generator.js +260 -0
- package/dist/services/export/anthropic/tools-generator.js.map +1 -0
- package/dist/services/export/langchain/api-generator.d.ts +17 -0
- package/dist/services/export/langchain/api-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/api-generator.js +375 -0
- package/dist/services/export/langchain/api-generator.js.map +1 -0
- package/dist/services/export/langchain/callbacks-generator.d.ts +63 -0
- package/dist/services/export/langchain/callbacks-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/callbacks-generator.js +408 -0
- package/dist/services/export/langchain/callbacks-generator.js.map +1 -0
- package/dist/services/export/langchain/error-handling-generator.d.ts +76 -0
- package/dist/services/export/langchain/error-handling-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/error-handling-generator.js +522 -0
- package/dist/services/export/langchain/error-handling-generator.js.map +1 -0
- package/dist/services/export/langchain/index.d.ts +17 -0
- package/dist/services/export/langchain/index.d.ts.map +1 -0
- package/dist/services/export/langchain/index.js +13 -0
- package/dist/services/export/langchain/index.js.map +1 -0
- package/dist/services/export/langchain/langchain-exporter.d.ts +174 -0
- package/dist/services/export/langchain/langchain-exporter.d.ts.map +1 -0
- package/dist/services/export/langchain/langchain-exporter.js +953 -0
- package/dist/services/export/langchain/langchain-exporter.js.map +1 -0
- package/dist/services/export/langchain/langgraph-generator.d.ts +86 -0
- package/dist/services/export/langchain/langgraph-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/langgraph-generator.js +473 -0
- package/dist/services/export/langchain/langgraph-generator.js.map +1 -0
- package/dist/services/export/langchain/langserve-generator.d.ts +95 -0
- package/dist/services/export/langchain/langserve-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/langserve-generator.js +807 -0
- package/dist/services/export/langchain/langserve-generator.js.map +1 -0
- package/dist/services/export/langchain/memory-generator.d.ts +71 -0
- package/dist/services/export/langchain/memory-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/memory-generator.js +1182 -0
- package/dist/services/export/langchain/memory-generator.js.map +1 -0
- package/dist/services/export/langchain/openapi-generator.d.ts +20 -0
- package/dist/services/export/langchain/openapi-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/openapi-generator.js +364 -0
- package/dist/services/export/langchain/openapi-generator.js.map +1 -0
- package/dist/services/export/langchain/plan-execute-generator.d.ts +60 -0
- package/dist/services/export/langchain/plan-execute-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/plan-execute-generator.js +679 -0
- package/dist/services/export/langchain/plan-execute-generator.js.map +1 -0
- package/dist/services/export/langchain/streaming-generator.d.ts +66 -0
- package/dist/services/export/langchain/streaming-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/streaming-generator.js +749 -0
- package/dist/services/export/langchain/streaming-generator.js.map +1 -0
- package/dist/services/export/langchain/tools-generator.d.ts +67 -0
- package/dist/services/export/langchain/tools-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/tools-generator.js +543 -0
- package/dist/services/export/langchain/tools-generator.js.map +1 -0
- package/dist/services/export/npm/express-generator.d.ts +23 -0
- package/dist/services/export/npm/express-generator.d.ts.map +1 -0
- package/dist/services/export/npm/express-generator.js +296 -0
- package/dist/services/export/npm/express-generator.js.map +1 -0
- package/dist/services/export/npm/index.d.ts +13 -0
- package/dist/services/export/npm/index.d.ts.map +1 -0
- package/dist/services/export/npm/index.js +11 -0
- package/dist/services/export/npm/index.js.map +1 -0
- package/dist/services/export/npm/npm-exporter.d.ts +142 -0
- package/dist/services/export/npm/npm-exporter.d.ts.map +1 -0
- package/dist/services/export/npm/npm-exporter.js +480 -0
- package/dist/services/export/npm/npm-exporter.js.map +1 -0
- package/dist/services/export/npm/openapi-generator.d.ts +19 -0
- package/dist/services/export/npm/openapi-generator.d.ts.map +1 -0
- package/dist/services/export/npm/openapi-generator.js +428 -0
- package/dist/services/export/npm/openapi-generator.js.map +1 -0
- package/dist/services/export/npm/package-json-generator.d.ts +31 -0
- package/dist/services/export/npm/package-json-generator.d.ts.map +1 -0
- package/dist/services/export/npm/package-json-generator.js +153 -0
- package/dist/services/export/npm/package-json-generator.js.map +1 -0
- package/dist/services/export/npm/typescript-generator.d.ts +69 -0
- package/dist/services/export/npm/typescript-generator.d.ts.map +1 -0
- package/dist/services/export/npm/typescript-generator.js +437 -0
- package/dist/services/export/npm/typescript-generator.js.map +1 -0
- package/dist/services/export/testing/index.d.ts +8 -0
- package/dist/services/export/testing/index.d.ts.map +1 -0
- package/dist/services/export/testing/index.js +7 -0
- package/dist/services/export/testing/index.js.map +1 -0
- package/dist/services/export/testing/test-generator.d.ts +178 -0
- package/dist/services/export/testing/test-generator.d.ts.map +1 -0
- package/dist/services/export/testing/test-generator.js +2542 -0
- package/dist/services/export/testing/test-generator.js.map +1 -0
- package/dist/services/test-runner/mock-llm.service.d.ts +77 -0
- package/dist/services/test-runner/mock-llm.service.d.ts.map +1 -0
- package/dist/services/test-runner/mock-llm.service.js +173 -0
- package/dist/services/test-runner/mock-llm.service.js.map +1 -0
- package/dist/services/test-runner/scenarios.d.ts +36 -0
- package/dist/services/test-runner/scenarios.d.ts.map +1 -0
- package/dist/services/test-runner/scenarios.js +196 -0
- package/dist/services/test-runner/scenarios.js.map +1 -0
- package/dist/services/test-runner/test-runner.service.d.ts +19 -1
- package/dist/services/test-runner/test-runner.service.d.ts.map +1 -1
- package/dist/services/test-runner/test-runner.service.js +72 -6
- package/dist/services/test-runner/test-runner.service.js.map +1 -1
- package/dist/services/validation/best-practices-validator.d.ts +84 -0
- package/dist/services/validation/best-practices-validator.d.ts.map +1 -0
- package/dist/services/validation/best-practices-validator.js +499 -0
- package/dist/services/validation/best-practices-validator.js.map +1 -0
- package/dist/services/validation/cost-estimator.d.ts +69 -0
- package/dist/services/validation/cost-estimator.d.ts.map +1 -0
- package/dist/services/validation/cost-estimator.js +221 -0
- package/dist/services/validation/cost-estimator.js.map +1 -0
- package/dist/services/validation/enhanced-validator.d.ts +78 -0
- package/dist/services/validation/enhanced-validator.d.ts.map +1 -0
- package/dist/services/validation/enhanced-validator.js +212 -0
- package/dist/services/validation/enhanced-validator.js.map +1 -0
- package/dist/services/validation/index.d.ts +13 -0
- package/dist/services/validation/index.d.ts.map +1 -0
- package/dist/services/validation/index.js +9 -0
- package/dist/services/validation/index.js.map +1 -0
- package/dist/services/validation/security-validator.d.ts +81 -0
- package/dist/services/validation/security-validator.d.ts.map +1 -0
- package/dist/services/validation/security-validator.js +328 -0
- package/dist/services/validation/security-validator.js.map +1 -0
- package/dist/services/wizard/prompts.d.ts +71 -0
- package/dist/services/wizard/prompts.d.ts.map +1 -0
- package/dist/services/wizard/prompts.js +322 -0
- package/dist/services/wizard/prompts.js.map +1 -0
- package/dist/services/wizard/wizard.service.d.ts +60 -0
- package/dist/services/wizard/wizard.service.d.ts.map +1 -0
- package/dist/services/wizard/wizard.service.js +261 -0
- package/dist/services/wizard/wizard.service.js.map +1 -0
- package/dist/types/personality.zod.d.ts +23 -23
- package/dist/utils/version.d.ts +1 -1
- package/dist/utils/version.js +1 -1
- package/dist/version-management/core/version-manager.test.js.map +1 -1
- package/dist/version.d.ts +62 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +73 -0
- package/dist/version.js.map +1 -0
- package/examples/a2a/agent-handoff.ossa.yaml +1 -1
- package/examples/a2a/service-discovery.ossa.yaml +1 -1
- package/examples/adapters/drupal-eca-mapping.yaml +1 -1
- package/examples/adapters/drupal-eca-task.yaml +1 -1
- package/examples/adapters/drupal-flowdrop-mapping.yaml +1 -1
- package/examples/adapters/drupal-maestro-mapping.yaml +1 -1
- package/examples/adapters/mistral-agent.yaml +1 -1
- package/examples/adapters/symfony-messenger-task.yaml +1 -1
- package/examples/adapters/symfony-messenger-workflow.yaml +1 -1
- package/examples/adk-integration/code-review-workflow.yml +1 -1
- package/examples/adk-integration/customer-support.yml +1 -1
- package/examples/adk-integration/data-pipeline.yml +1 -1
- package/examples/advanced/reasoning-agent.yaml +1 -1
- package/examples/advanced/workflows/hybrid-model-strategy.yaml +1 -1
- package/examples/agent-manifests/critics/critic-agent.yaml +1 -1
- package/examples/agent-manifests/governors/governor-agent.yaml +1 -1
- package/examples/agent-manifests/integrators/integrator-agent.yaml +1 -1
- package/examples/agent-manifests/judges/judge-agent.yaml +1 -1
- package/examples/agent-manifests/monitors/monitor-agent.yaml +1 -1
- package/examples/agent-manifests/orchestrators/orchestrator-agent.yaml +1 -1
- package/examples/agent-manifests/sample-compliant-agent.yaml +1 -1
- package/examples/agent-manifests/workers/worker-agent.yaml +1 -1
- package/examples/agents/01-customer-support-bot/.env.example +32 -0
- package/examples/agents/01-customer-support-bot/Dockerfile +30 -0
- package/examples/agents/01-customer-support-bot/README.md +295 -0
- package/examples/agents/01-customer-support-bot/agent.ossa.yaml +172 -0
- package/examples/agents/01-customer-support-bot/docker-compose.yml +55 -0
- package/examples/agents/01-customer-support-bot/openapi.yaml +238 -0
- package/examples/agents/01-customer-support-bot/package.json +48 -0
- package/examples/agents/02-code-review-agent/README.md +72 -0
- package/examples/agents/02-code-review-agent/agent.ossa.yaml +239 -0
- package/examples/agents/02-code-review-agent/docker-compose.yml +22 -0
- package/examples/agents/02-code-review-agent/openapi.yaml +150 -0
- package/examples/agents/03-data-analysis-agent/README.md +51 -0
- package/examples/agents/03-data-analysis-agent/agent.ossa.yaml +97 -0
- package/examples/agents/03-data-analysis-agent/openapi.yaml +74 -0
- package/examples/agents/04-content-moderator/README.md +55 -0
- package/examples/agents/04-content-moderator/agent.ossa.yaml +131 -0
- package/examples/agents/04-content-moderator/openapi.yaml +50 -0
- package/examples/agents/05-sales-assistant/README.md +37 -0
- package/examples/agents/05-sales-assistant/agent.ossa.yaml +146 -0
- package/examples/agents/05-sales-assistant/openapi.yaml +59 -0
- package/examples/agents/06-devops-agent/README.md +39 -0
- package/examples/agents/06-devops-agent/agent.ossa.yaml +141 -0
- package/examples/agents/06-devops-agent/openapi.yaml +51 -0
- package/examples/agents/07-research-assistant/README.md +31 -0
- package/examples/agents/07-research-assistant/agent.ossa.yaml +119 -0
- package/examples/agents/07-research-assistant/openapi.yaml +56 -0
- package/examples/agents/08-email-triage-agent/README.md +33 -0
- package/examples/agents/08-email-triage-agent/agent.ossa.yaml +133 -0
- package/examples/agents/08-email-triage-agent/openapi.yaml +41 -0
- package/examples/agents/09-security-scanner/README.md +49 -0
- package/examples/agents/09-security-scanner/agent.ossa.yaml +174 -0
- package/examples/agents/09-security-scanner/openapi.yaml +46 -0
- package/examples/agents/10-meeting-assistant/README.md +53 -0
- package/examples/agents/10-meeting-assistant/agent.ossa.yaml +211 -0
- package/examples/agents/10-meeting-assistant/docker-compose.yml +27 -0
- package/examples/agents/10-meeting-assistant/openapi.yaml +131 -0
- package/examples/agents/COMPLETION_REPORT.txt +272 -0
- package/examples/agents/INDEX.md +296 -0
- package/examples/agents/README.md +452 -0
- package/examples/agents/SUMMARY.md +362 -0
- package/examples/agents/TEST_RESULTS.md +458 -0
- package/examples/agents/architecture-healer-enterprise.yaml +1 -1
- package/examples/agents/dependency-healer-npm.yaml +1 -1
- package/examples/agents/spec-healer-openapi.yaml +1 -1
- package/examples/agents/wiki-healer-production.yaml +1 -1
- package/examples/agents-md/code-agent.ossa.json +1 -1
- package/examples/agents-md/monorepo-agent.ossa.yaml +1 -1
- package/examples/anthropic/claude-assistant.ossa.json +1 -1
- package/examples/autogen/multi-agent.ossa.json +1 -1
- package/examples/autonomous-evolution/self-evolving-agent.ossa.yaml +1 -1
- package/examples/build-once-use-everywhere/agent.ossa.yaml +1 -1
- package/examples/claude-code/code-reviewer.ossa.yaml +1 -1
- package/examples/claude-code/ossa-validator.ossa.yaml +1 -1
- package/examples/common_npm/agent-router.ossa.yaml +2 -2
- package/examples/contracts/data-consumer.ossa.yaml +1 -1
- package/examples/contracts/data-producer-v2.ossa.yaml +1 -1
- package/examples/contracts/data-producer.ossa.yaml +1 -1
- package/examples/crewai/research-team.ossa.json +1 -1
- package/examples/cursor/code-review-agent.ossa.json +1 -1
- package/examples/drupal/QUICKSTART.md +439 -0
- package/examples/drupal/ai_agents_ossa-module/.agents/example-agent/agent.ossa.yaml +1 -1
- package/examples/drupal/content-moderator.ossa.yaml +107 -0
- package/examples/drupal/gitlab-ml-recommender.ossa.yaml +2 -2
- package/examples/economics/marketplace-agent.ossa.json +1 -1
- package/examples/export/langchain/production-agent-with-memory/README.md +373 -0
- package/examples/export/langchain/production-agent-with-memory/agent.ossa.yaml +97 -0
- package/examples/export/langchain/production-agent-with-streaming/README.md +617 -0
- package/examples/export/langchain/production-agent-with-streaming/agent.ossa.yaml +100 -0
- package/examples/export/langchain/production-agent-with-streaming/client-example.py +263 -0
- package/examples/export/langchain/production-agent-with-tools/README.md +296 -0
- package/examples/export/langchain/production-agent-with-tools/agent.ossa.yaml +216 -0
- package/examples/export/langchain-export-example.ts +246 -0
- package/examples/export/langserve-export-example.ts +246 -0
- package/examples/export/test-generation-example.ts +457 -0
- package/examples/extensions/agents-md-advanced.yml +1 -1
- package/examples/extensions/agents-md-basic.yml +1 -1
- package/examples/extensions/agents-md-sync.yml +1 -1
- package/examples/extensions/agents-md-v1.yml +1 -1
- package/examples/extensions/drupal-v1.yml +1 -1
- package/examples/extensions/encryption-multi-provider.yaml +4 -4
- package/examples/extensions/kagent-v1.yml +1 -1
- package/examples/extensions/knowledge-sources.yaml +1 -1
- package/examples/extensions/mcp-full-featured.yaml +1 -1
- package/examples/genetics/breeding-agent.ossa.json +1 -1
- package/examples/getting-started/01-minimal-agent.ossa.yaml +1 -1
- package/examples/getting-started/02-agent-with-tools.ossa.yaml +1 -1
- package/examples/getting-started/03-agent-with-safety.ossa.yaml +1 -1
- package/examples/getting-started/04-agent-with-messaging.ossa.yaml +1 -1
- package/examples/getting-started/05-workflow-composition.ossa.yaml +1 -1
- package/examples/getting-started/hello-world-complete.ossa.yaml +1 -1
- package/examples/integration-patterns/agent-to-agent-orchestration.ossa.yaml +1 -1
- package/examples/kagent/compliance-validator.ossa.yaml +1 -1
- package/examples/kagent/cost-optimizer.ossa.yaml +1 -1
- package/examples/kagent/documentation-agent.ossa.yaml +1 -1
- package/examples/kagent/k8s-troubleshooter-v1.ossa.yaml +2 -2
- package/examples/kagent/k8s-troubleshooter.ossa.yaml +1 -1
- package/examples/kagent/security-scanner.ossa.yaml +1 -1
- package/examples/langchain/chain-agent.ossa.json +1 -1
- package/examples/langflow/workflow-agent.ossa.json +1 -1
- package/examples/langgraph/state-machine-agent.ossa.json +1 -1
- package/examples/lifecycle/mentoring-agent.ossa.json +1 -1
- package/examples/llamaindex/rag-agent.ossa.json +1 -1
- package/examples/mcp/database-mcp.ossa.yaml +1 -1
- package/examples/mcp/filesystem-mcp.ossa.yaml +1 -1
- package/examples/messaging/dependency-healer.ossa.yaml +1 -1
- package/examples/messaging/incident-responder.ossa.yaml +1 -1
- package/examples/messaging/routing-rules.ossa.yaml +1 -1
- package/examples/messaging/security-scanner.ossa.yaml +1 -1
- package/examples/migration-guides/from-langchain-to-ossa.yaml +4 -4
- package/examples/migrations/langchain/01-python-react-agent-after.ossa.yaml +1 -1
- package/examples/migrations/langchain/02-typescript-conversational-after.ossa.yaml +1 -1
- package/examples/migrations/langchain/03-sequential-chain-after.ossa.yaml +1 -1
- package/examples/migrations/langchain/04-config-based-after.ossa.yaml +1 -1
- package/examples/migrations/swarm-to-ossa/after-handoffs.ossa.yaml +6 -6
- package/examples/migrations/swarm-to-ossa/after-triage-agent.ossa.yaml +3 -3
- package/examples/multi-agent/conditional-router.ossa.yaml +1 -1
- package/examples/multi-agent/parallel-execution.ossa.yaml +1 -1
- package/examples/multi-agent/sequential-pipeline.ossa.yaml +1 -1
- package/examples/multi-agent-research-workflow.ossa.yaml +133 -0
- package/examples/multi-platform/single-manifest/agent.ossa.yaml +1 -1
- package/examples/npm-export-example.ts +150 -0
- package/examples/observability/activity-stream-full.yaml +1 -1
- package/examples/openai/basic-agent.ossa.yaml +1 -1
- package/examples/openai/multi-tool-agent.ossa.json +1 -1
- package/examples/openai/swarm-agent.ossa.json +1 -1
- package/examples/ossa-templates/01-code-assistant.ossa.yaml +1 -1
- package/examples/ossa-templates/02-security-scanner.ossa.yaml +1 -1
- package/examples/ossa-templates/03-ci-pipeline.ossa.yaml +1 -1
- package/examples/ossa-templates/04-code-reviewer.ossa.yaml +1 -1
- package/examples/ossa-templates/05-doc-generator.ossa.yaml +1 -1
- package/examples/ossa-templates/06-compliance-validator.ossa.yaml +1 -1
- package/examples/ossa-templates/07-workflow-orchestrator.ossa.yaml +1 -1
- package/examples/ossa-templates/08-content-writer.ossa.yaml +1 -1
- package/examples/ossa-templates/09-test-generator.ossa.yaml +1 -1
- package/examples/ossa-templates/10-data-transformer.ossa.yaml +1 -1
- package/examples/ossa-templates/11-react-performance-expert.ossa.yaml +1 -1
- package/examples/ossa-templates/12-typescript-type-safety-expert.ossa.yaml +1 -1
- package/examples/ossa-templates/13-accessibility-champion.ossa.yaml +1 -1
- package/examples/ossa-templates/14-security-hardening-agent.ossa.yaml +1 -1
- package/examples/production/document-analyzer-openai.yml +1 -1
- package/examples/production-ready/01-customer-support-bot/.env.example +32 -0
- package/examples/production-ready/01-customer-support-bot/Dockerfile +30 -0
- package/examples/production-ready/01-customer-support-bot/README.md +295 -0
- package/examples/production-ready/01-customer-support-bot/agent.ossa.yaml +172 -0
- package/examples/production-ready/01-customer-support-bot/docker-compose.yml +55 -0
- package/examples/production-ready/01-customer-support-bot/openapi.yaml +238 -0
- package/examples/production-ready/01-customer-support-bot/package.json +48 -0
- package/examples/production-ready/02-code-review-agent/README.md +72 -0
- package/examples/production-ready/02-code-review-agent/agent.ossa.yaml +239 -0
- package/examples/production-ready/02-code-review-agent/docker-compose.yml +22 -0
- package/examples/production-ready/02-code-review-agent/openapi.yaml +150 -0
- package/examples/production-ready/03-data-analysis-agent/README.md +51 -0
- package/examples/production-ready/03-data-analysis-agent/agent.ossa.yaml +97 -0
- package/examples/production-ready/03-data-analysis-agent/openapi.yaml +74 -0
- package/examples/production-ready/04-content-moderator/README.md +55 -0
- package/examples/production-ready/04-content-moderator/agent.ossa.yaml +131 -0
- package/examples/production-ready/04-content-moderator/openapi.yaml +50 -0
- package/examples/production-ready/05-sales-assistant/README.md +37 -0
- package/examples/production-ready/05-sales-assistant/agent.ossa.yaml +146 -0
- package/examples/production-ready/05-sales-assistant/openapi.yaml +59 -0
- package/examples/production-ready/06-devops-agent/README.md +39 -0
- package/examples/production-ready/06-devops-agent/agent.ossa.yaml +141 -0
- package/examples/production-ready/06-devops-agent/openapi.yaml +51 -0
- package/examples/production-ready/07-research-assistant/README.md +31 -0
- package/examples/production-ready/07-research-assistant/agent.ossa.yaml +119 -0
- package/examples/production-ready/07-research-assistant/openapi.yaml +56 -0
- package/examples/production-ready/08-email-triage-agent/README.md +33 -0
- package/examples/production-ready/08-email-triage-agent/agent.ossa.yaml +133 -0
- package/examples/production-ready/08-email-triage-agent/openapi.yaml +41 -0
- package/examples/production-ready/09-security-scanner/README.md +49 -0
- package/examples/production-ready/09-security-scanner/agent.ossa.yaml +174 -0
- package/examples/production-ready/09-security-scanner/openapi.yaml +46 -0
- package/examples/production-ready/10-meeting-assistant/README.md +53 -0
- package/examples/production-ready/10-meeting-assistant/agent.ossa.yaml +211 -0
- package/examples/production-ready/10-meeting-assistant/docker-compose.yml +27 -0
- package/examples/production-ready/10-meeting-assistant/openapi.yaml +131 -0
- package/examples/production-ready/COMPLETION_REPORT.txt +272 -0
- package/examples/production-ready/INDEX.md +296 -0
- package/examples/production-ready/README.md +452 -0
- package/examples/production-ready/SUMMARY.md +362 -0
- package/examples/production-ready/TEST_RESULTS.md +458 -0
- package/examples/quickstart/support-agent.ossa.yaml +1 -1
- package/examples/real-world/gitlab-cicd-optimizer.ossa.yaml +1 -1
- package/examples/real-world/rag-documentation-assistant.ossa.yaml +1 -1
- package/examples/registry/agents/code-reviewer/agent.yaml +1 -1
- package/examples/registry/agents/security-scanner/agent.yaml +1 -1
- package/examples/runtime-adapters/bedrock-claude-example.ossa.yaml +1 -1
- package/examples/schema/reusable-components.yaml +1 -1
- package/examples/showcase/ci-pipeline.ossa.yaml +1 -1
- package/examples/showcase/code-assistant.ossa.yaml +1 -1
- package/examples/showcase/code-reviewer.ossa.yaml +1 -1
- package/examples/showcase/compliance-validator.ossa.yaml +1 -1
- package/examples/showcase/content-writer.ossa.yaml +1 -1
- package/examples/showcase/data-transformer.ossa.yaml +1 -1
- package/examples/showcase/doc-generator.ossa.yaml +1 -1
- package/examples/showcase/security-scanner.ossa.yaml +1 -1
- package/examples/showcase/test-generator.ossa.yaml +1 -1
- package/examples/showcase/workflow-orchestrator.ossa.yaml +1 -1
- package/examples/skills-example.ossa.yaml +140 -0
- package/examples/swarm/pso-optimizer.ossa.json +1 -1
- package/examples/tasks/batch-email-sender.yaml +1 -1
- package/examples/tasks/data-transform.yaml +1 -1
- package/examples/tasks/publish-content.yaml +1 -1
- package/examples/templates/ossa-compliance.yaml +1 -1
- package/examples/unified/security-scanner.ossa.yaml +1 -1
- package/examples/v0.3.6-features/genetics-breeding-advanced.ossa.yaml +1 -1
- package/examples/v0.3.6-features/genetics-breeding-simple.ossa.yaml +1 -1
- package/examples/v0.3.6-features/genetics-fitness-scoring.ossa.yaml +1 -1
- package/examples/vercel/edge-agent.ossa.json +1 -1
- package/examples/workflows/batch-email-campaign.yaml +1 -1
- package/examples/workflows/content-review-publish.yaml +1 -1
- package/examples/workflows/simple-etl.yaml +1 -1
- package/openapi/cli/openapi.yaml +221 -5
- package/package.json +17 -7
- package/dist/cli/commands/export-v2.command.d.ts +0 -7
- package/dist/cli/commands/export-v2.command.d.ts.map +0 -1
- package/dist/cli/commands/export-v2.command.js.map +0 -1
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
# Production Agent with Memory - LangChain Export (v0.4.1)
|
|
2
|
+
|
|
3
|
+
**Showcase Example for OSSA v0.4.1 LangChain Memory Features**
|
|
4
|
+
|
|
5
|
+
This example demonstrates all v0.4.1 production-quality memory features for LangChain exports:
|
|
6
|
+
|
|
7
|
+
## ✨ Features Demonstrated
|
|
8
|
+
|
|
9
|
+
### 1. **Conversation Buffer Memory** 💬
|
|
10
|
+
- Window management (configurable message history)
|
|
11
|
+
- Memory statistics and monitoring
|
|
12
|
+
- Structured logging
|
|
13
|
+
- Production-ready error handling
|
|
14
|
+
|
|
15
|
+
### 2. **Conversation Summary Memory** 📝
|
|
16
|
+
- Automatic summarization when token limit reached
|
|
17
|
+
- Configurable token limits
|
|
18
|
+
- Summary regeneration
|
|
19
|
+
- Cost-effective model (gpt-4o-mini) for summarization
|
|
20
|
+
|
|
21
|
+
### 3. **Entity Memory** 🏷️
|
|
22
|
+
- Automatic entity extraction and tracking
|
|
23
|
+
- Entity context retrieval
|
|
24
|
+
- Relationship mapping
|
|
25
|
+
- Entity listing and management
|
|
26
|
+
|
|
27
|
+
### 4. **Redis Persistence** 🔴
|
|
28
|
+
- Connection pooling with automatic retry
|
|
29
|
+
- Exponential backoff on connection failures
|
|
30
|
+
- Health checks and monitoring
|
|
31
|
+
- Session management (list, delete, get stats)
|
|
32
|
+
- TTL configuration per session
|
|
33
|
+
|
|
34
|
+
### 5. **PostgreSQL Persistence** 🐘
|
|
35
|
+
- Connection pooling (ThreadedConnectionPool)
|
|
36
|
+
- Automatic schema initialization
|
|
37
|
+
- Session analytics and statistics
|
|
38
|
+
- Export functionality (JSON, CSV)
|
|
39
|
+
- Health checks and monitoring
|
|
40
|
+
- Long-term storage for compliance
|
|
41
|
+
|
|
42
|
+
## 🎯 Memory Backends
|
|
43
|
+
|
|
44
|
+
| Backend | Type | Persistence | Best For |
|
|
45
|
+
|---------|------|-------------|----------|
|
|
46
|
+
| **buffer** | In-Memory | No | Development, short conversations |
|
|
47
|
+
| **summary** | In-Memory | No | Long conversations, token efficiency |
|
|
48
|
+
| **entity** | In-Memory | No | Entity-focused interactions |
|
|
49
|
+
| **redis** | Persistent | Yes | Production, multi-instance, session persistence |
|
|
50
|
+
| **postgres** | Persistent | Yes | Analytics, compliance, long-term storage |
|
|
51
|
+
|
|
52
|
+
## 📋 Export Command
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Export with different memory backends
|
|
56
|
+
|
|
57
|
+
# Buffer memory (in-memory)
|
|
58
|
+
ossa export agent.ossa.yaml -p langchain -o ./buffer-agent
|
|
59
|
+
# Memory generated: memory.py with ConversationBufferWindowMemory
|
|
60
|
+
|
|
61
|
+
# Summary memory (token-efficient)
|
|
62
|
+
ossa export agent.ossa.yaml -p langchain --memory-backend summary -o ./summary-agent
|
|
63
|
+
# Memory generated: memory.py with ConversationSummaryBufferMemory
|
|
64
|
+
|
|
65
|
+
# Entity memory (entity tracking)
|
|
66
|
+
ossa export agent.ossa.yaml -p langchain --memory-backend entity -o ./entity-agent
|
|
67
|
+
# Memory generated: memory.py with ConversationEntityMemory
|
|
68
|
+
|
|
69
|
+
# Redis persistence (production)
|
|
70
|
+
ossa export agent.ossa.yaml -p langchain --memory-backend redis -o ./redis-agent
|
|
71
|
+
# Memory generated: memory.py with Redis-backed persistence
|
|
72
|
+
|
|
73
|
+
# PostgreSQL persistence (analytics)
|
|
74
|
+
ossa export agent.ossa.yaml -p langchain --memory-backend postgres -o ./postgres-agent
|
|
75
|
+
# Memory generated: memory.py with PostgreSQL-backed persistence
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 📦 Generated Memory Features
|
|
79
|
+
|
|
80
|
+
All memory backends include:
|
|
81
|
+
- ✅ **get_memory()** - Create memory instance
|
|
82
|
+
- ✅ **clear_memory()** - Clear conversation history
|
|
83
|
+
- ✅ **get_memory_stats()** - Get usage statistics
|
|
84
|
+
- ✅ **Logging** - Structured logging with context
|
|
85
|
+
- ✅ **Error Handling** - Comprehensive try/except with exc_info
|
|
86
|
+
|
|
87
|
+
Persistent backends (Redis, PostgreSQL) additionally include:
|
|
88
|
+
- ✅ **validate_connection()** - Connection validation with retry
|
|
89
|
+
- ✅ **health_check()** - Health monitoring
|
|
90
|
+
- ✅ **get_all_sessions()** - List all sessions
|
|
91
|
+
- ✅ **delete_session()** - Delete specific session
|
|
92
|
+
|
|
93
|
+
## 🎯 Configuration Options
|
|
94
|
+
|
|
95
|
+
### OSSA Manifest Configuration
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
spec:
|
|
99
|
+
memory:
|
|
100
|
+
enabled: true
|
|
101
|
+
type: conversation_buffer # or: conversation_summary, entity
|
|
102
|
+
window_size: 20 # Number of messages to keep
|
|
103
|
+
max_token_limit: 4000 # Token limit for summary
|
|
104
|
+
return_messages: true # Return as Message objects
|
|
105
|
+
|
|
106
|
+
# Persistence (optional)
|
|
107
|
+
persistence:
|
|
108
|
+
enabled: true
|
|
109
|
+
backend: redis # or: postgres
|
|
110
|
+
ttl: 86400 # Time-to-live (seconds)
|
|
111
|
+
connection:
|
|
112
|
+
url: ${REDIS_URL} # Connection URL from env
|
|
113
|
+
pool_size: 10 # Connection pool size
|
|
114
|
+
timeout: 30 # Connection timeout (seconds)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## 📊 Code Examples
|
|
118
|
+
|
|
119
|
+
### Buffer Memory with Window
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
import logging
|
|
123
|
+
from memory import get_memory, clear_memory, get_memory_stats
|
|
124
|
+
|
|
125
|
+
logger = logging.getLogger(__name__)
|
|
126
|
+
|
|
127
|
+
# Create memory (keeps last 20 messages)
|
|
128
|
+
memory = get_memory()
|
|
129
|
+
|
|
130
|
+
# Use with agent
|
|
131
|
+
agent = create_agent(memory=memory)
|
|
132
|
+
response = agent.run("Hello!")
|
|
133
|
+
|
|
134
|
+
# Get statistics
|
|
135
|
+
stats = get_memory_stats(memory)
|
|
136
|
+
# {
|
|
137
|
+
# "type": "buffer_window",
|
|
138
|
+
# "window_size": 20,
|
|
139
|
+
# "message_count": 5,
|
|
140
|
+
# "messages": [...]
|
|
141
|
+
# }
|
|
142
|
+
|
|
143
|
+
# Clear when done
|
|
144
|
+
clear_memory(memory)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Summary Memory
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
from memory import get_memory, regenerate_summary, get_memory_stats
|
|
151
|
+
|
|
152
|
+
# Create summary memory (auto-summarizes at 4000 tokens)
|
|
153
|
+
memory = get_memory()
|
|
154
|
+
|
|
155
|
+
# Use with agent
|
|
156
|
+
agent = create_agent(memory=memory)
|
|
157
|
+
|
|
158
|
+
# Get statistics
|
|
159
|
+
stats = get_memory_stats(memory)
|
|
160
|
+
# {
|
|
161
|
+
# "type": "summary_buffer",
|
|
162
|
+
# "max_token_limit": 4000,
|
|
163
|
+
# "message_count": 10,
|
|
164
|
+
# "has_summary": true
|
|
165
|
+
# }
|
|
166
|
+
|
|
167
|
+
# Force summary regeneration
|
|
168
|
+
summary = regenerate_summary(memory)
|
|
169
|
+
print(f"Summary: {summary}")
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Entity Memory
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
from memory import (
|
|
176
|
+
get_memory,
|
|
177
|
+
get_entity_context,
|
|
178
|
+
list_entities,
|
|
179
|
+
get_memory_stats
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
# Create entity memory
|
|
183
|
+
memory = get_memory()
|
|
184
|
+
|
|
185
|
+
# Use with agent
|
|
186
|
+
agent = create_agent(memory=memory)
|
|
187
|
+
agent.run("John Smith is the CEO of TechCorp")
|
|
188
|
+
|
|
189
|
+
# List tracked entities
|
|
190
|
+
entities = list_entities(memory)
|
|
191
|
+
# ["John Smith", "TechCorp"]
|
|
192
|
+
|
|
193
|
+
# Get entity context
|
|
194
|
+
context = get_entity_context(memory, "John Smith")
|
|
195
|
+
# "John Smith is the CEO of TechCorp"
|
|
196
|
+
|
|
197
|
+
# Get statistics
|
|
198
|
+
stats = get_memory_stats(memory)
|
|
199
|
+
# {
|
|
200
|
+
# "type": "entity",
|
|
201
|
+
# "entity_count": 2,
|
|
202
|
+
# "entities": ["John Smith", "TechCorp"],
|
|
203
|
+
# "entity_details": {...}
|
|
204
|
+
# }
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Redis Persistence
|
|
208
|
+
|
|
209
|
+
```python
|
|
210
|
+
from memory import (
|
|
211
|
+
get_memory,
|
|
212
|
+
validate_redis_connection,
|
|
213
|
+
health_check,
|
|
214
|
+
get_all_sessions,
|
|
215
|
+
delete_session,
|
|
216
|
+
get_memory_stats
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
# Validate connection first (with retry)
|
|
220
|
+
if not validate_redis_connection(max_retries=3):
|
|
221
|
+
raise ConnectionError("Failed to connect to Redis")
|
|
222
|
+
|
|
223
|
+
# Create memory for session
|
|
224
|
+
memory = get_memory(session_id="user-123")
|
|
225
|
+
|
|
226
|
+
# Use with agent
|
|
227
|
+
agent = create_agent(memory=memory)
|
|
228
|
+
|
|
229
|
+
# Get session statistics
|
|
230
|
+
stats = get_memory_stats(session_id="user-123")
|
|
231
|
+
# {
|
|
232
|
+
# "type": "redis",
|
|
233
|
+
# "session_id": "user-123",
|
|
234
|
+
# "message_count": 42,
|
|
235
|
+
# "ttl_remaining": 82800, # seconds
|
|
236
|
+
# "key": "langchain:chat:user-123"
|
|
237
|
+
# }
|
|
238
|
+
|
|
239
|
+
# Health check
|
|
240
|
+
health = health_check()
|
|
241
|
+
# {
|
|
242
|
+
# "healthy": true,
|
|
243
|
+
# "latency_ms": 2.5,
|
|
244
|
+
# "redis_version": "7.0.0",
|
|
245
|
+
# "uptime_seconds": 86400
|
|
246
|
+
# }
|
|
247
|
+
|
|
248
|
+
# List all sessions
|
|
249
|
+
sessions = get_all_sessions()
|
|
250
|
+
# ["user-123", "user-456", ...]
|
|
251
|
+
|
|
252
|
+
# Delete session
|
|
253
|
+
success = delete_session("user-123")
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### PostgreSQL Persistence
|
|
257
|
+
|
|
258
|
+
```python
|
|
259
|
+
from memory import (
|
|
260
|
+
get_memory,
|
|
261
|
+
validate_postgres_connection,
|
|
262
|
+
initialize_schema,
|
|
263
|
+
health_check,
|
|
264
|
+
get_all_sessions,
|
|
265
|
+
export_session_history,
|
|
266
|
+
get_memory_stats
|
|
267
|
+
)
|
|
268
|
+
|
|
269
|
+
# Validate connection and initialize schema
|
|
270
|
+
if not validate_postgres_connection(max_retries=3):
|
|
271
|
+
raise ConnectionError("Failed to connect to PostgreSQL")
|
|
272
|
+
|
|
273
|
+
initialize_schema()
|
|
274
|
+
|
|
275
|
+
# Create memory for session
|
|
276
|
+
memory = get_memory(session_id="user-123")
|
|
277
|
+
|
|
278
|
+
# Use with agent
|
|
279
|
+
agent = create_agent(memory=memory)
|
|
280
|
+
|
|
281
|
+
# Get session statistics
|
|
282
|
+
stats = get_memory_stats(session_id="user-123")
|
|
283
|
+
# {
|
|
284
|
+
# "type": "postgres",
|
|
285
|
+
# "session_id": "user-123",
|
|
286
|
+
# "message_count": 42,
|
|
287
|
+
# "first_message_at": "2026-02-03T10:00:00",
|
|
288
|
+
# "last_message_at": "2026-02-03T11:30:00"
|
|
289
|
+
# }
|
|
290
|
+
|
|
291
|
+
# Health check
|
|
292
|
+
health = health_check()
|
|
293
|
+
# {
|
|
294
|
+
# "healthy": true,
|
|
295
|
+
# "latency_ms": 5.2,
|
|
296
|
+
# "postgres_version": "PostgreSQL 15.1",
|
|
297
|
+
# "schema_initialized": true
|
|
298
|
+
# }
|
|
299
|
+
|
|
300
|
+
# Export session history
|
|
301
|
+
messages_json = export_session_history("user-123", format="json")
|
|
302
|
+
messages_csv = export_session_history("user-123", format="csv")
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## 🧪 Testing
|
|
306
|
+
|
|
307
|
+
All features are tested with 18 comprehensive unit tests:
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
npm test tests/unit/services/export/langchain/memory-generator.test.ts
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
**Test Coverage:**
|
|
314
|
+
- ✅ Configuration parsing (3 tests)
|
|
315
|
+
- ✅ Buffer memory (2 tests)
|
|
316
|
+
- ✅ Summary memory (2 tests)
|
|
317
|
+
- ✅ Entity memory (2 tests)
|
|
318
|
+
- ✅ Redis persistence (3 tests)
|
|
319
|
+
- ✅ PostgreSQL persistence (3 tests)
|
|
320
|
+
- ✅ Production features (3 tests)
|
|
321
|
+
|
|
322
|
+
## 🔧 Environment Variables
|
|
323
|
+
|
|
324
|
+
**Redis Backend:**
|
|
325
|
+
```bash
|
|
326
|
+
REDIS_URL=redis://localhost:6379
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
**PostgreSQL Backend:**
|
|
330
|
+
```bash
|
|
331
|
+
POSTGRES_URL=postgresql://postgres:postgres@localhost:5432/agent_memory
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
**OpenAI API (for Summary/Entity Memory):**
|
|
335
|
+
```bash
|
|
336
|
+
OPENAI_API_KEY=sk-...
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## 📊 Version Information
|
|
340
|
+
|
|
341
|
+
- **OSSA Version**: v0.4.1+
|
|
342
|
+
- **Release**: v0.4.1 (Feb 14, 2026)
|
|
343
|
+
- **Feature Set**: LangChain Memory Support
|
|
344
|
+
- **Status**: ✅ Complete
|
|
345
|
+
|
|
346
|
+
## 🎓 What's Next
|
|
347
|
+
|
|
348
|
+
This is the **Week 2 deliverable** of v0.4.1 (part 1). Next feature:
|
|
349
|
+
|
|
350
|
+
- **Week 2 (part 2)**: Streaming Support (SSE, WebSocket, a2a integration)
|
|
351
|
+
|
|
352
|
+
## 📚 Documentation
|
|
353
|
+
|
|
354
|
+
- [v0.4.1-v0.4.8 Release Plan](../../../../../wikis/technical-docs.wiki/action-items/Ossa-PLAN/v0.4.1-v0.4.8-release-plan.md)
|
|
355
|
+
- [LangChain Export Guide](../../../../../docs/export/langchain.md)
|
|
356
|
+
- [Memory Configuration Guide](../../../../../docs/memory/configuration.md)
|
|
357
|
+
- [OSSA Specification](https://openstandardagents.org/spec)
|
|
358
|
+
|
|
359
|
+
## 🤝 Contributing
|
|
360
|
+
|
|
361
|
+
This example demonstrates production quality standards for memory implementations:
|
|
362
|
+
|
|
363
|
+
1. **Connection Management**: Use connection pooling
|
|
364
|
+
2. **Error Handling**: Comprehensive try/except with logging
|
|
365
|
+
3. **Retry Logic**: Exponential backoff for failed connections
|
|
366
|
+
4. **Health Checks**: Monitoring and diagnostics
|
|
367
|
+
5. **Statistics**: Usage tracking and analytics
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
**Generated by**: OSSA v0.4.1 LangChain Memory Generator
|
|
372
|
+
**Date**: 2026-02-03
|
|
373
|
+
**Status**: Production Ready ✅
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
apiVersion: ossa/v0.4.1
|
|
2
|
+
kind: Agent
|
|
3
|
+
metadata:
|
|
4
|
+
name: production-agent-with-memory
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
description: |
|
|
7
|
+
Production-ready agent with advanced memory features showcasing v0.4.1:
|
|
8
|
+
- Conversation buffer with window management
|
|
9
|
+
- Conversation summary with token limits
|
|
10
|
+
- Entity memory for entity tracking
|
|
11
|
+
- Redis persistence for multi-instance deployments
|
|
12
|
+
- PostgreSQL persistence for analytics and compliance
|
|
13
|
+
labels:
|
|
14
|
+
platform: langchain
|
|
15
|
+
export: langchain
|
|
16
|
+
use-case: production-showcase
|
|
17
|
+
tier: production
|
|
18
|
+
version: v0.4.1
|
|
19
|
+
|
|
20
|
+
spec:
|
|
21
|
+
role: |
|
|
22
|
+
You are a production assistant with advanced memory capabilities.
|
|
23
|
+
You maintain conversation context across sessions and track entities.
|
|
24
|
+
|
|
25
|
+
llm:
|
|
26
|
+
provider: openai
|
|
27
|
+
model: gpt-4o
|
|
28
|
+
temperature: 0.7
|
|
29
|
+
maxTokens: 2000
|
|
30
|
+
|
|
31
|
+
# Memory Configuration (Full OSSA spec)
|
|
32
|
+
memory:
|
|
33
|
+
enabled: true
|
|
34
|
+
type: conversation_buffer
|
|
35
|
+
window_size: 20
|
|
36
|
+
max_token_limit: 4000
|
|
37
|
+
return_messages: true
|
|
38
|
+
|
|
39
|
+
# Persistence Configuration
|
|
40
|
+
persistence:
|
|
41
|
+
enabled: true
|
|
42
|
+
backend: redis # or: postgres
|
|
43
|
+
ttl: 86400 # 24 hours
|
|
44
|
+
connection:
|
|
45
|
+
url: ${REDIS_URL} # or ${POSTGRES_URL}
|
|
46
|
+
pool_size: 10
|
|
47
|
+
timeout: 30
|
|
48
|
+
|
|
49
|
+
tools:
|
|
50
|
+
- type: function
|
|
51
|
+
name: remember_fact
|
|
52
|
+
description: Remember an important fact
|
|
53
|
+
parameters:
|
|
54
|
+
type: object
|
|
55
|
+
properties:
|
|
56
|
+
fact:
|
|
57
|
+
type: string
|
|
58
|
+
description: Fact to remember
|
|
59
|
+
required:
|
|
60
|
+
- fact
|
|
61
|
+
|
|
62
|
+
- type: function
|
|
63
|
+
name: recall_conversation
|
|
64
|
+
description: Recall previous conversation
|
|
65
|
+
parameters:
|
|
66
|
+
type: object
|
|
67
|
+
properties:
|
|
68
|
+
query:
|
|
69
|
+
type: string
|
|
70
|
+
description: What to recall
|
|
71
|
+
required:
|
|
72
|
+
- query
|
|
73
|
+
|
|
74
|
+
autonomy:
|
|
75
|
+
level: supervised
|
|
76
|
+
approval_required: false
|
|
77
|
+
|
|
78
|
+
observability:
|
|
79
|
+
logging:
|
|
80
|
+
level: info
|
|
81
|
+
format: json
|
|
82
|
+
metrics:
|
|
83
|
+
enabled: true
|
|
84
|
+
tracing:
|
|
85
|
+
enabled: true
|
|
86
|
+
provider: opentelemetry
|
|
87
|
+
|
|
88
|
+
extensions:
|
|
89
|
+
langchain:
|
|
90
|
+
agent_type: react
|
|
91
|
+
memory_type: conversation_buffer # buffer, summary, entity
|
|
92
|
+
export_config:
|
|
93
|
+
format: python
|
|
94
|
+
include_dependencies: true
|
|
95
|
+
include_api_server: true
|
|
96
|
+
api_port: 8000
|
|
97
|
+
memory_backend: redis # buffer, summary, entity, redis, postgres
|