agent-lyra 0.7.0 → 0.10.0

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.
Files changed (126) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +301 -276
  3. package/bin/agent-lyra.js +51 -51
  4. package/bin/lyra-oss-preview.js +16 -16
  5. package/package.json +60 -60
  6. package/src/app-builder/export.js +109 -109
  7. package/src/app-builder/gateway.js +62 -62
  8. package/src/app-builder/init.js +115 -72
  9. package/src/app-builder/manifest-contract.js +46 -46
  10. package/src/app-builder/native-adapter.js +29 -29
  11. package/src/app-builder/preview.js +35 -31
  12. package/src/app-builder/publish.js +14 -14
  13. package/src/app-builder/saved-app.js +70 -70
  14. package/src/app-builder/saved-preview-browser.js +33 -33
  15. package/src/app-builder/saved-preview.html +24 -24
  16. package/src/app-builder/saved-preview.js +61 -61
  17. package/src/app-builder/support-manifest.js +50 -50
  18. package/src/app-builder/support-template/manifest.json +55 -55
  19. package/src/app-builder/support-template/support-preview.html +56 -56
  20. package/src/app-builder/support-template/support-preview.js +37 -37
  21. package/src/app-builder/support-template/support-preview.mjs +67 -67
  22. package/src/app-builder/support-template/support-workflow.mjs +36 -36
  23. package/src/app-builder/use.js +37 -37
  24. package/src/app-builder/validate.js +31 -21
  25. package/src/app-builder/value-schema.js +37 -37
  26. package/src/catalog.js +147 -147
  27. package/src/coding/catalog.js +56 -56
  28. package/src/coding/cloud-catalog.js +64 -64
  29. package/src/coding/detect-stack.mjs +110 -110
  30. package/src/coding/export.js +133 -133
  31. package/src/coding/setup.js +175 -175
  32. package/src/coding/skills/lyra-android/SKILL.md +37 -37
  33. package/src/coding/skills/lyra-angular/SKILL.md +37 -37
  34. package/src/coding/skills/lyra-cucumber/SKILL.md +37 -37
  35. package/src/coding/skills/lyra-dbt/SKILL.md +37 -37
  36. package/src/coding/skills/lyra-django/SKILL.md +37 -37
  37. package/src/coding/skills/lyra-docker/SKILL.md +37 -37
  38. package/src/coding/skills/lyra-dotnet/SKILL.md +37 -37
  39. package/src/coding/skills/lyra-express/SKILL.md +37 -37
  40. package/src/coding/skills/lyra-fastapi/SKILL.md +37 -37
  41. package/src/coding/skills/lyra-flutter/SKILL.md +37 -37
  42. package/src/coding/skills/lyra-github-actions/SKILL.md +37 -37
  43. package/src/coding/skills/lyra-gitlab-ci/SKILL.md +37 -37
  44. package/src/coding/skills/lyra-go/SKILL.md +37 -37
  45. package/src/coding/skills/lyra-ios/SKILL.md +37 -37
  46. package/src/coding/skills/lyra-kubernetes/SKILL.md +37 -37
  47. package/src/coding/skills/lyra-mongodb/SKILL.md +37 -37
  48. package/src/coding/skills/lyra-mysql/SKILL.md +37 -37
  49. package/src/coding/skills/lyra-nextjs/SKILL.md +37 -37
  50. package/src/coding/skills/lyra-node/SKILL.md +37 -37
  51. package/src/coding/skills/lyra-playwright/SKILL.md +37 -37
  52. package/src/coding/skills/lyra-postgresql/SKILL.md +37 -37
  53. package/src/coding/skills/lyra-python/SKILL.md +37 -37
  54. package/src/coding/skills/lyra-react/SKILL.md +37 -37
  55. package/src/coding/skills/lyra-react-native/SKILL.md +37 -37
  56. package/src/coding/skills/lyra-redis/SKILL.md +37 -37
  57. package/src/coding/skills/lyra-rust/SKILL.md +37 -37
  58. package/src/coding/skills/lyra-spark/SKILL.md +37 -37
  59. package/src/coding/skills/lyra-spring-boot/SKILL.md +37 -37
  60. package/src/coding/skills/lyra-svelte/SKILL.md +37 -37
  61. package/src/coding/skills/lyra-terraform/SKILL.md +37 -37
  62. package/src/coding/skills/lyra-typescript/SKILL.md +37 -37
  63. package/src/coding/skills/lyra-vue/SKILL.md +37 -37
  64. package/src/framework/agent.js +181 -173
  65. package/src/framework/mda.js +65 -0
  66. package/src/framework/run.py +111 -111
  67. package/src/gated/hostedAgents.js +56 -56
  68. package/src/gated/index.d.ts +25 -25
  69. package/src/gated/index.js +5 -5
  70. package/src/index.d.ts +2 -2
  71. package/src/index.js +2 -2
  72. package/src/init.js +960 -960
  73. package/src/intelligence/graphsnip-provider.d.ts +5 -5
  74. package/src/intelligence/graphsnip-provider.js +57 -57
  75. package/src/intelligence/lifecycle.js +25 -0
  76. package/src/memory/LICENSE +21 -21
  77. package/src/memory/README.md +5 -5
  78. package/src/memory/UPSTREAM.json +24 -14
  79. package/src/memory/bridge-cli.js +16 -16
  80. package/src/memory/bridge.js +18 -18
  81. package/src/memory/cli.js +21 -21
  82. package/src/memory/cloud-sync-actions.js +61 -61
  83. package/src/memory/contract.json +45 -45
  84. package/src/memory/index.d.ts +50 -49
  85. package/src/memory/index.js +7 -7
  86. package/src/memory/lifecycle.js +29 -29
  87. package/src/memory/local-cli.js +34 -34
  88. package/src/memory/local-store.js +209 -209
  89. package/src/memory/package.json +33 -33
  90. package/src/memory/proposals.js +90 -90
  91. package/src/memory/skills-cli.js +26 -26
  92. package/src/memory/standalone.d.ts +50 -50
  93. package/src/memory/standalone.js +1 -1
  94. package/src/memory/sync.js +89 -89
  95. package/src/memory/validation.js +25 -25
  96. package/src/onboardingAgents.js +532 -532
  97. package/src/promptTemplates.js +178 -178
  98. package/src/resource-files.js +18 -18
  99. package/src/runtime/contracts.d.ts +47 -47
  100. package/src/runtime/local-cli.js +161 -160
  101. package/src/runtime/mcp-stdio.js +111 -111
  102. package/src/runtime/orchestration.js +59 -59
  103. package/src/runtime/run-agent.js +54 -53
  104. package/src/standalone/index.d.ts +45 -45
  105. package/src/standalone/index.js +13 -13
  106. package/src/standalone/init.js +12 -12
  107. package/src/standalone/orchestration.js +6 -6
  108. package/src/standalone/rag.js +113 -113
  109. package/src/studio/agent-ui.css +43 -43
  110. package/src/studio/agent-ui.js +32 -32
  111. package/src/studio/browser.js +542 -345
  112. package/src/studio/export.js +83 -85
  113. package/src/studio/index.html +74 -37
  114. package/src/studio/memory-actions.js +37 -37
  115. package/src/studio/memory-panel.js +200 -200
  116. package/src/studio/project.js +308 -240
  117. package/src/studio/pull-agent.js +72 -72
  118. package/src/studio/push.js +54 -54
  119. package/src/studio/python-agent.js +47 -47
  120. package/src/studio/python-agent.py +25 -25
  121. package/src/studio/server.js +164 -150
  122. package/src/studio/session.js +83 -83
  123. package/src/studio/studio.css +257 -10
  124. package/src/studio/sync.js +42 -42
  125. package/src/studio/workflow-editor.js +240 -0
  126. package/src/studio/workflow-sync.js +229 -157
package/README.md CHANGED
@@ -1,276 +1,301 @@
1
- <img src="https://agentlyra.in/images/logo.png" width="80" height="80" alt="AgentLyra constellation mark">
2
-
3
- # AgentLyra SDK
4
-
5
- **Build agent workflows, design apps, and set up coding assistants from your project.**
6
-
7
- [Get started](#get-started) · [SDK](#sdk-library) · [Coding setup](#coding-setup) · [Studio](#lyra-studio) · [App Builder](#lyra-app-builder) · [Memory](#project-memory-and-skill-proposals) · [Cloud](#agentlyra-cloud-and-marketplace)
8
-
9
- [Website](https://agentlyra.in/) · [Cloud console](https://console.agentlyra.in/) · [GitHub](https://github.com/agentlyra-labs/agent-lyra-sdk) · [npm](https://www.npmjs.com/package/agent-lyra) · [PyPI](https://pypi.org/project/agent-lyra/)
10
-
11
- ## Choose your starting point
12
-
13
- | | What you get |
14
- | --- | --- |
15
- | **GitHub source edition** | MIT-licensed JavaScript workflow and retrieval primitives, local execution and run history, evidence-based memory, manifest validation, and [technology skill guides](https://github.com/agentlyra-labs/agent-lyra-sdk/tree/main/src/coding/skills). |
16
- | **SDK from npm or PyPI** | Coding stack detection, agent and skill generation, assistant exports, Studio, App Builder, and optional Cloud access. The Python package also provides native Python workflow and memory APIs. |
17
- | **AgentLyra Cloud** | A signed-in workspace for hosted agents, syncing selected project resources, and browsing the Marketplace. |
18
-
19
- ## Get started
20
-
21
- **JavaScript · Node.js 22.13 or newer**
22
-
23
- ```sh
24
- npm install agent-lyra
25
- npx agent-lyra --help
26
- npx agent-lyra setup coding --detect --preview
27
- ```
28
-
29
- **Python · Python 3.9 or newer**
30
-
31
- ```sh
32
- python -m pip install agent-lyra
33
- python -m lyra --help
34
- python -m lyra setup coding --detect --preview
35
- ```
36
-
37
- Coding setup, Studio, App Builder, Cloud commands, and skill proposals require Node.js 22.13 or newer. Native Python workflows and local Memory commands run with Python alone.
38
-
39
- **GitHub source edition · Node.js 22.13 or newer**
40
-
41
- ```sh
42
- git clone https://github.com/agentlyra-labs/agent-lyra-sdk.git
43
- cd agent-lyra-sdk
44
- node bin/agent-lyra.js --help
45
- ```
46
-
47
- Run project commands from your own project folder using the absolute path to the cloned CLI. Use the npm or PyPI install below to try Studio, App Builder, coding setup, or Cloud commands.
48
-
49
- **Command prefixes used below**
50
-
51
- | Edition | Prefix |
52
- | --- | --- |
53
- | JavaScript | `npx agent-lyra` |
54
- | Python | `python -m lyra` |
55
- | GitHub source | `node /absolute/path/to/agent-lyra-sdk/bin/agent-lyra.js` |
56
-
57
- Values in angle brackets are placeholders. Use `--help` to check arguments for the command you’re running. On Windows PowerShell, use `npm.cmd` and `npx.cmd` if PowerShell blocks the script shims.
58
-
59
- | Command | Availability | Purpose |
60
- | --- | --- | --- |
61
- | `--help` | All editions | Show the CLI entry points |
62
- | `init [--mode standalone] [--dir <folder>]` | All editions | Initialize a local workspace |
63
- | `init --domains <ids> [--stack <names> or --detect]` | npm, Python | Select domains and optionally configure a coding stack. The registry wizard also supports hosted setup |
64
-
65
- The registry wizard supports `--mode`, `--domains`, `--stack`, `--detect`, `--dir`, `--force`, `--api-key`, and `--api-base-url`. For account credentials, prefer the hidden prompt in `connect-cloud`.
66
-
67
- ## SDK library
68
-
69
- Use the SDK directly in your own code to compose workflows, run agents, and work with retrieval. Choose the runtime and provider that fit your app.
70
-
71
- **JavaScript**
72
-
73
- ```js
74
- import { standalone } from 'agent-lyra';
75
-
76
- const workflow = standalone.createLinearWorkflow(() => 'Draft ready');
77
- console.log(await standalone.runWorkflow(workflow));
78
- ```
79
-
80
- **Python**
81
-
82
- ```python
83
- import asyncio
84
- from lyra.standalone import create_linear_workflow, run_workflow
85
-
86
- async def draft(context):
87
- return "Draft ready"
88
-
89
- print(asyncio.run(run_workflow(create_linear_workflow(draft))))
90
- ```
91
-
92
- From the GitHub source edition, import the JavaScript primitives from `./src/standalone/index.js`. That edition also includes the [v1 manifest contract](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/src/app-builder/manifest-contract.js).
93
-
94
- | Command | Availability | Purpose |
95
- | --- | --- | --- |
96
- | `agent run --model <model> --prompt <text>` | Source, npm | Run the local assistant with an OpenAI model |
97
- | `team run draft-review --model <model> --prompt <text>` | Source, npm | Run the built-in drafting and review sequence |
98
- | `run status <run-id>` | Source, npm | Read the latest saved run event |
99
- | `mcp serve --dir <absolute-project-directory>` | Source, npm | Expose `get_saved_run` over read-only stdio MCP |
100
-
101
- Model-backed runs require `OPENAI_API_KEY`. The provider receives the prompt and any retrieved project memory included with it. AgentLyra records local run history in SQLite. The MCP tool can read saved run output by UUID.
102
-
103
- ## Coding setup
104
-
105
- Generate editable agents and skills in `.lyra/` for the technology you use. Choose packs manually or let Lyra detect your stack from local project files. Review the preview before applying it. Existing files are preserved.
106
-
107
- ```sh
108
- npx agent-lyra setup coding --detect --preview
109
- npx agent-lyra setup coding --stack playwright-cucumber --yes
110
- npx agent-lyra setup coding export --to claude,codex,copilot --preview
111
- ```
112
-
113
- | Command | Purpose |
114
- | --- | --- |
115
- | `setup coding` | Choose technologies interactively |
116
- | `setup coding --stack <names>` | Choose packs or presets such as `mern`, `python-fastapi`, and `playwright-cucumber` |
117
- | `setup coding --detect` | Review detected technologies and the files that support each recommendation |
118
- | `setup coding --stack <names> --catalog-version <number> --preview` | Preview a published Cloud catalog version. Without this option, setup uses the bundled catalog offline |
119
- | `setup coding export --to claude,codex,copilot --preview` | Preview assistant-specific instructions. Replace `--preview` with `--yes` to write the files |
120
-
121
- These commands are available in npm and Python. Both setup commands accept `--dir <folder>`. After setup, you can run `node .lyra/scripts/detect-stack.mjs` for a read-only JSON report. The GitHub source edition includes the guide files for reading and reuse.
122
-
123
- ## Run a registered agent from Cloud
124
-
125
- A private IDE agent card runs in Studio by default. To enable **Run now** in Cloud, deploy your own HTTPS endpoint and have the AgentLyra Cloud operator associate it with your account and registration ID. Keep model credentials and agent code in your runtime. The operator configures `LYRA_FRAMEWORK_ENDPOINTS` as a JSON array of objects with `ownerId`, `agentId`, `url`, and a dedicated `token` of at least 32 URL-safe characters.
126
-
127
- The endpoint handles an authenticated JSON POST. Verify the bearer token before running code. The request carries `schemaVersion: 1`, `agentId`, `traceId`, and `input`. Return JSON with the same `traceId` and an `output` matching the registered text or JSON type. The endpoint has 25 seconds to respond. Use the incoming trace ID in your runtime logs. Cloud retains status, timing and failure category for 30 days. The trace history excludes prompts and replies.
128
-
129
- ## Register an existing Python agent
130
-
131
- Keep the agent in its existing repository and install its framework in the Python environment Studio uses. Set `LYRA_PYTHON` to that interpreter if needed.
132
-
133
- | Framework in the descriptor | Python object to register |
134
- | --- | --- |
135
- | `langchain` | A LangChain agent with async `ainvoke` that accepts a messages state |
136
- | `langgraph` | A compiled LangGraph graph with async `ainvoke` that accepts a messages state |
137
- | `google-adk` | A Google ADK agent. Studio creates a fresh in-memory session per run |
138
- | `openai-agents` | An OpenAI Agents SDK agent |
139
- | `custom` | A sync or async callable with signature `invoke(payload, context)` |
140
-
141
- The named framework adapters receive text and return the final text. For a custom callable, set `"input": "json"` or `"output": "json"` in the descriptor to use structured values on that side. For example, an async callable can return `{"text": payload["text"].strip()}` with JSON input and output. In Studio, provide a JSON value in the input component or pass valid JSON from the preceding step. The callable receives the Lyra trace ID as `context["trace_id"]`. Framework packages and model credentials stay in your project environment.
142
-
143
- Create `agent-registration.json` in your project with a relative Python file and the name of an exported object:
144
-
145
- ```json
146
- {
147
- "name": "Research agent",
148
- "framework": "langgraph",
149
- "entry": "agents/research.py:graph"
150
- }
151
- ```
152
-
153
- | Command | Purpose |
154
- | --- | --- |
155
- | `agent discover` | Read candidates from `langgraph.json` without importing project code |
156
- | `agent register <descriptor.json>` | Save a stable registration under `.lyra/agents/coding/` |
157
- | `agent trace <run-id>` | Inspect the local run timeline and trace ID |
158
- | `agent sync <registration-id>` | Preview the private registration |
159
- | `agent sync <registration-id> --yes` | Sync the preview to **Cloud → Agents** as a local-only card |
160
- | `app init --local <registration-id>` | Create a local Studio manifest with input, agent, and output bindings |
161
-
162
- These commands work in the npm and Python distributions. Launch Studio and reload its catalog after registering. Run only code you trust and use text inputs and outputs for this adapter. Studio returns run and trace IDs, and local run history stores status and duration for framework runs. Sync sends registration metadata. Agent code, local paths, and run contents remain in the project environment. The framework controls any external telemetry it emits.
163
-
164
- ## Lyra Studio
165
-
166
- Studio is a **local browser canvas** that you launch from your IDE terminal. Add a text input, agent card or run button, and an output. Use the Inspector to bind inputs and outputs, then run an agent or workflow from the canvas.
167
-
168
- ```sh
169
- npx agent-lyra studio
170
- ```
171
-
172
- Run `python -m lyra studio` from a Python project. Start from the project root so Studio can find your `.lyra` agents, workflows, and skills. See [Cloud sync](#agentlyra-cloud-and-marketplace) for importing or pushing selected resources.
173
-
174
- ## Lyra App Builder
175
-
176
- App Builder turns an **app manifest** into a browser preview or editable application source. Use `app init` to start with saved Cloud agents, then validate, preview, and export.
177
-
178
- | Command | Purpose |
179
- | --- | --- |
180
- | `app init [manifest.json]` | Create a manifest using saved Cloud agents. Connect to Cloud first |
181
- | `app validate <manifest.json>` | Check the manifest |
182
- | `app preview <manifest.json>` | Open a local browser preview. Framework agents run from their source project. Set `LYRA_PREVIEW_PORT` if you need a different port |
183
- | `app export <manifest.json> <new-directory>` | Export editable source to a new directory |
184
-
185
- These commands are available in npm and Python. To import an app or preview a public listing, see [Marketplace](#marketplace).
186
-
187
- ## Project Memory and Skill Proposals
188
-
189
- Project Memory uses SQLite on your machine. Record a lesson, verify it against evidence, and retrieve it for later runs. The runtimes provide SQLite, so there is no separate database server to install.
190
-
191
- ### Local memory
192
-
193
- Local memory commands work in Source, npm, and Python. `consolidate` uses the shared Node CLI from Python.
194
-
195
- | Command | Purpose |
196
- | --- | --- |
197
- | `memory --help` | List memory commands |
198
- | `memory init` | Initialize the SQLite memory store |
199
- | `memory record <json-file>` | Record a candidate lesson |
200
- | `memory list` | List project memories |
201
- | `memory search <query>` | Search project memory |
202
- | `memory inspect <id>` | Read a record and its evidence references |
203
- | `memory verify <id> <evidence.json>` | Verify a candidate against reviewed evidence |
204
- | `memory archive <id>` | Archive a memory |
205
- | `memory consolidate <context>` | Find recurring lessons for a context |
206
- | `memory stats` | Show store counts and search mode |
207
- | `memory forget <id> --yes` | Permanently remove a local record |
208
-
209
- See [memory types](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/src/memory/index.d.ts) and [evidence validation](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/src/memory/validation.js). Store evidence references and reusable lessons. Keep secrets and sensitive data in appropriate stores. Use `LYRA_MEMORY_CONTEXT=off` to disable historical retrieval for model-backed runs.
210
-
211
- ### Skill proposals
212
-
213
- These commands work in Source, npm, and Python. Approving a proposal requires independent regression evidence.
214
-
215
- | Command | Purpose |
216
- | --- | --- |
217
- | `skills --help` | List skill proposal commands |
218
- | `skills evolve <context> <memory-id>` | Draft an improvement from verified memory |
219
- | `skills proposals` | List proposals |
220
- | `skills proposal <id>` | Inspect a proposal and its sources |
221
- | `skills approve <id> <regression.json>` | Approve a proposal with evidence |
222
- | `skills reject <id>` | Reject a pending proposal |
223
- | `skills withdraw <id>` | Withdraw an approval |
224
-
225
- ## AgentLyra Cloud and Marketplace
226
-
227
- [Open the AgentLyra console](https://console.agentlyra.in/) to run hosted agents, manage a workspace, and view synced records. Create one AgentLyra API key under [API Keys](https://console.agentlyra.in/mcp-servers). Enable the permissions you need for hosted runs, resource sync, and verified memory sync.
228
-
229
- | Command | Purpose |
230
- | --- | --- |
231
- | `connect-cloud [--replace-key]` | Connect once from the IDE. Use `--replace-key` to enter a new key |
232
- | `work-locally` | Pause Cloud actions while keeping project files |
233
-
234
- These commands are available in npm and Python. The compatibility names `gated` and `standalone` still work for switching modes. Provider credentials are configured separately where a hosted run requires them.
235
-
236
- ### Sync project resources
237
-
238
- These commands work in the npm and Python distributions with a key that has Cloud resource sync permission.
239
-
240
- | Command | Purpose |
241
- | --- | --- |
242
- | `studio pull` | Pull the workspace catalog from Cloud |
243
- | `studio push <agent-id>` | Push a local agent to Cloud |
244
- | `studio pull-agent <agent-id>` | Pull changes to a linked agent |
245
- | `studio push-workflow <workflow-id>` | Push a local workflow |
246
- | `studio pull-workflow <workflow-id>` | Pull changes to a linked workflow |
247
- | `studio push-team <team-id>` | Push a local team |
248
- | `studio pull-team <team-id>` | Pull changes to a linked team |
249
- | `studio push-skill <skill-id>` | Push a local text skill |
250
- | `studio pull-skill <skill-id>` | Pull changes to a linked text skill |
251
-
252
- ### Sync verified memories
253
-
254
- Cloud memory commands work in the npm and Python distributions. They require an AgentLyra API key with Memory sync permission.
255
-
256
- | Command | Purpose |
257
- | --- | --- |
258
- | `memory cloud list [cursor]` | List your synced records |
259
- | `memory cloud preview <id>` | Review what would be sent |
260
- | `memory cloud push <id> --yes` | Upload the reviewed record |
261
- | `memory cloud pull <id>` | Import a Cloud copy for local review |
262
-
263
- A verified record stays local until you choose to upload it. Preview the payload before confirming a push. The Cloud copy is private to your account.
264
-
265
- ### Marketplace
266
-
267
- Browse [published apps](https://agentlyra.in/marketplace/apps). Sign in to import or submit an app.
268
-
269
- | Command | Purpose |
270
- | --- | --- |
271
- | `app use <listing-id> [new-manifest.json]` | Import a published app manifest. Requires `LYRA_SESSION_TOKEN` |
272
- | `app publish <manifest.json> --dry-run` | Preview the listing payload. Submit the listing through Cloud |
273
-
274
- ## License
275
-
276
- The public source edition is available under the [MIT License](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/LICENSE). For questions and reproducible bugs, use [GitHub Issues](https://github.com/agentlyra-labs/agent-lyra-sdk/issues). Report security issues privately and keep credentials out of issue reports.
1
+ <img src="https://agentlyra.in/images/logo.png" width="80" height="80" alt="AgentLyra constellation mark">
2
+
3
+ # AgentLyra SDK
4
+
5
+ **Build agent workflows, design apps, and set up coding assistants from your project.**
6
+
7
+ [Get started](#get-started) · [SDK](#sdk-library) · [Coding setup](#coding-setup) · [Studio](#lyra-studio) · [App Builder](#lyra-app-builder) · [Memory](#project-memory-and-skill-proposals) · [Cloud](#agentlyra-cloud-and-marketplace)
8
+
9
+ [Website](https://agentlyra.in/) · [Cloud console](https://console.agentlyra.in/) · [GitHub](https://github.com/agentlyra-labs/agent-lyra-sdk) · [npm](https://www.npmjs.com/package/agent-lyra) · [PyPI](https://pypi.org/project/agent-lyra/)
10
+
11
+ ## Choose your starting point
12
+
13
+ | | What you get |
14
+ | --- | --- |
15
+ | **GitHub source edition** | MIT-licensed JavaScript workflow and retrieval primitives, local execution and run history, evidence-based memory, manifest validation, and [technology skill guides](https://github.com/agentlyra-labs/agent-lyra-sdk/tree/main/src/coding/skills). |
16
+ | **SDK from npm or PyPI** | Coding stack detection, agent and skill generation, assistant exports, Studio, App Builder, and optional Cloud access. The Python package also provides native Python workflow and memory APIs. |
17
+ | **AgentLyra Cloud** | A signed-in workspace for hosted agents, syncing selected project resources, and browsing the Marketplace. |
18
+
19
+ ## Get started
20
+
21
+ **JavaScript · Node.js 22.13 or newer**
22
+
23
+ ```sh
24
+ npm install agent-lyra
25
+ npx agent-lyra --help
26
+ npx agent-lyra setup coding --detect --preview
27
+ ```
28
+
29
+ **Python · Python 3.9 or newer**
30
+
31
+ ```sh
32
+ python -m pip install agent-lyra
33
+ python -m lyra --help
34
+ python -m lyra setup coding --detect --preview
35
+ ```
36
+
37
+ Coding setup, Studio, App Builder, Cloud commands, and skill proposals require Node.js 22.13 or newer. Native Python workflows and local Memory commands run with Python alone.
38
+
39
+ **GitHub source edition · Node.js 22.13 or newer**
40
+
41
+ ```sh
42
+ git clone https://github.com/agentlyra-labs/agent-lyra-sdk.git
43
+ cd agent-lyra-sdk
44
+ node bin/agent-lyra.js --help
45
+ ```
46
+
47
+ Run project commands from your own project folder using the absolute path to the cloned CLI. Use the npm or PyPI install below to try Studio, App Builder, coding setup, or Cloud commands.
48
+
49
+ **Command prefixes used below**
50
+
51
+ | Edition | Prefix |
52
+ | --- | --- |
53
+ | JavaScript | `npx agent-lyra` |
54
+ | Python | `python -m lyra` |
55
+ | GitHub source | `node /absolute/path/to/agent-lyra-sdk/bin/agent-lyra.js` |
56
+
57
+ Values in angle brackets are placeholders. Use `--help` to check arguments for the command you’re running. On Windows PowerShell, use `npm.cmd` and `npx.cmd` if PowerShell blocks the script shims.
58
+
59
+ | Command | Availability | Purpose |
60
+ | --- | --- | --- |
61
+ | `--help` | All editions | Show the CLI entry points |
62
+ | `init [--mode standalone] [--dir <folder>]` | All editions | Initialize a local workspace |
63
+ | `init --domains <ids> [--stack <names> or --detect]` | npm, Python | Select domains and optionally configure a coding stack. The registry wizard also supports hosted setup |
64
+
65
+ The registry wizard supports `--mode`, `--domains`, `--stack`, `--detect`, `--dir`, `--force`, `--api-key`, and `--api-base-url`. For account credentials, prefer the hidden prompt in `connect-cloud`.
66
+
67
+ ## SDK library
68
+
69
+ Use the SDK directly in your own code to compose workflows, run agents, and work with retrieval. Choose the runtime and provider that fit your app.
70
+
71
+ **JavaScript**
72
+
73
+ ```js
74
+ import { standalone } from 'agent-lyra';
75
+
76
+ const workflow = standalone.createLinearWorkflow(() => 'Draft ready');
77
+ console.log(await standalone.runWorkflow(workflow));
78
+ ```
79
+
80
+ **Python**
81
+
82
+ ```python
83
+ import asyncio
84
+ from lyra.standalone import create_linear_workflow, run_workflow
85
+
86
+ async def draft(context):
87
+ return "Draft ready"
88
+
89
+ print(asyncio.run(run_workflow(create_linear_workflow(draft))))
90
+ ```
91
+
92
+ From the GitHub source edition, import the JavaScript primitives from `./src/standalone/index.js`. That edition also includes the [v1 manifest contract](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/src/app-builder/manifest-contract.js).
93
+
94
+ | Command | Availability | Purpose |
95
+ | --- | --- | --- |
96
+ | `agent run --model <model> --prompt <text>` | Source, npm | Run the local assistant with an OpenAI model |
97
+ | `team run draft-review --model <model> --prompt <text>` | Source, npm | Run the built-in drafting and review sequence |
98
+ | `run status <run-id>` | Source, npm | Read the latest saved run event |
99
+ | `mcp serve --dir <absolute-project-directory>` | Source, npm | Expose `get_saved_run` over read-only stdio MCP |
100
+
101
+ Model-backed runs require `OPENAI_API_KEY`. The provider receives the prompt and any retrieved project memory included with it. AgentLyra records local run history in SQLite. The MCP tool can read saved run output by UUID.
102
+
103
+ ## Coding setup
104
+
105
+ Generate editable agents and skills in `.lyra/` for the technology you use. Choose packs manually or let Lyra detect your stack from local project files. Review the preview before applying it. Existing files are preserved.
106
+
107
+ ```sh
108
+ npx agent-lyra setup coding --detect --preview
109
+ npx agent-lyra setup coding --stack playwright-cucumber --yes
110
+ npx agent-lyra setup coding export --to claude,codex,copilot --preview
111
+ ```
112
+
113
+ | Command | Purpose |
114
+ | --- | --- |
115
+ | `setup coding` | Choose technologies interactively |
116
+ | `setup coding --stack <names>` | Choose packs or presets such as `mern`, `python-fastapi`, and `playwright-cucumber` |
117
+ | `setup coding --detect` | Review detected technologies and the files that support each recommendation |
118
+ | `setup coding --stack <names> --catalog-version <number> --preview` | Preview a published Cloud catalog version. Without this option, setup uses the bundled catalog offline |
119
+ | `setup coding export --to claude,codex,copilot --preview` | Preview assistant-specific instructions. Replace `--preview` with `--yes` to write the files |
120
+
121
+ These commands are available in npm and Python. Both setup commands accept `--dir <folder>`. After setup, you can run `node .lyra/scripts/detect-stack.mjs` for a read-only JSON report. The GitHub source edition includes the guide files for reading and reuse.
122
+
123
+ ## Run a registered agent from Cloud
124
+
125
+ A private IDE agent card runs in Studio by default. To enable **Run now** in Cloud, deploy your own HTTPS endpoint and have the AgentLyra Cloud operator associate it with your account and registration ID. Keep model credentials and agent code in your runtime. The operator configures `LYRA_FRAMEWORK_ENDPOINTS` as a JSON array of objects with `ownerId`, `agentId`, `url`, and a dedicated `token` of at least 32 URL-safe characters.
126
+
127
+ The endpoint handles an authenticated JSON POST. Verify the bearer token before running code. The request carries `schemaVersion: 1`, `agentId`, `traceId`, and `input`. Return JSON with the same `traceId` and an `output` matching the registered text or JSON type. The endpoint has 25 seconds to respond. Use the incoming trace ID in your runtime logs. Cloud retains status, timing and failure category for 30 days. The trace history excludes prompts and replies.
128
+
129
+ ## Register a TypeScript Managed Deep Agent
130
+
131
+ Start your existing Managed Deep Agents project with `npx mda dev` and leave that terminal running. In a second terminal in the same project, save `mda-registration.json` with the source export and the assistant or graph ID shown by the MDA dev server.
132
+
133
+ ```json
134
+ {
135
+ "name": "My Managed Deep Agent",
136
+ "framework": "managed-deepagents",
137
+ "entry": "agent.ts:agent",
138
+ "assistantId": "my-agent"
139
+ }
140
+ ```
141
+
142
+ Run `agent register mda-registration.json` using either SDK CLI, then open Studio or click **Reload agents**. Select the new card and use **Run now**. Studio sends a text run to the local MDA server. Set `LYRA_MDA_PORT` before launching Studio if your server uses a port other than 2024. If the dev server requires an API key, set `LYRA_MDA_API_KEY` in Studio's terminal environment for that trusted local server. The MDA server owns provider credentials and agent behavior. Studio records the Lyra trace ID and sends it in run metadata. Continue any approval prompts in the MDA interface.
143
+
144
+ ## Register an existing Python agent
145
+
146
+ Keep the agent in its existing repository and install its framework in the Python environment Studio uses. Set `LYRA_PYTHON` to that interpreter if needed.
147
+
148
+ | Framework in the descriptor | Python object to register |
149
+ | --- | --- |
150
+ | `langchain` | A LangChain agent with async `ainvoke` that accepts a messages state |
151
+ | `langgraph` | A compiled LangGraph graph with async `ainvoke` that accepts a messages state |
152
+ | `google-adk` | A Google ADK agent. Studio creates a fresh in-memory session per run |
153
+ | `openai-agents` | An OpenAI Agents SDK agent |
154
+ | `custom` | A sync or async callable with signature `invoke(payload, context)` |
155
+
156
+ The named framework adapters receive text and return the final text. For a custom callable, set `"input": "json"` or `"output": "json"` in the descriptor to use structured values on that side. For example, an async callable can return `{"text": payload["text"].strip()}` with JSON input and output. In Studio, provide a JSON value in the input component or pass valid JSON from the preceding step. The callable receives the Lyra trace ID as `context["trace_id"]`. Framework packages and model credentials stay in your project environment.
157
+
158
+ Create `agent-registration.json` in your project with a relative Python file and the name of an exported object:
159
+
160
+ ```json
161
+ {
162
+ "name": "Research agent",
163
+ "framework": "langgraph",
164
+ "entry": "agents/research.py:graph"
165
+ }
166
+ ```
167
+
168
+ | Command | Purpose |
169
+ | --- | --- |
170
+ | `agent discover` | Read candidates from `langgraph.json` without importing project code |
171
+ | `agent register <descriptor.json>` | Save a stable registration under `.lyra/agents/coding/` |
172
+ | `agent trace <run-id>` | Inspect the local run timeline and trace ID |
173
+ | `agent sync <registration-id>` | Preview the private registration |
174
+ | `agent sync <registration-id> --yes` | Sync the preview to **Cloud → Agents** as a local-only card |
175
+ | `app init --local <registration-id>` | Create a local Studio manifest with input, agent, and output bindings |
176
+
177
+ These commands work in the npm and Python distributions. Launch Studio and reload its catalog after registering. Run only code you trust and use text inputs and outputs for this adapter. Studio returns run and trace IDs, and local run history stores status and duration for framework runs. Sync sends registration metadata. Agent code, local paths, and run contents remain in the project environment. The framework controls any external telemetry it emits.
178
+
179
+ ## Lyra Studio
180
+
181
+ Studio is a **local browser canvas** that you launch from your IDE terminal. Add a text input, agent card or run button, and an output. Use the Inspector to bind inputs and outputs, then run an agent or workflow from the canvas.
182
+
183
+ ```sh
184
+ npx agent-lyra studio
185
+ ```
186
+
187
+ Run `python -m lyra studio` from a Python project. Start from the project root so Studio can find your `.lyra` agents, workflows, and skills. See [Cloud sync](#agentlyra-cloud-and-marketplace) for importing or pushing selected resources.
188
+
189
+ When you open a run, **Execution steps** shows where each agent will run and which runtime controls its model. If a workflow includes a local Markdown agent, select its OpenAI model in Studio and set `OPENAI_API_KEY` in the terminal that starts Studio. Saved Cloud agents use the provider configured in AgentLyra Cloud. Python and registered framework agents use their own runtime configuration. Studio does not inherit an IDE assistant's sign-in or model.
190
+
191
+ In **Workflow**, create a sequence of agents between **Trigger** and **Output**. Give each step a task and optionally name its output so a later step can read it. Save to \`.lyra/workflows\`, test the sequence, then use **Layout** to bind a run button to the saved workflow. The run drawer shows each step's result, status, duration, and Studio trace ID. Cloud-only workflows open for inspection and run in the Cloud console. Use **Duplicate locally** to customize a pulled workflow that can run in Studio.
192
+
193
+ To sync a workflow through the existing Cloud commands, use two to eight steps with enabled Cloud text agents or local text agents already linked to Cloud.
194
+
195
+ Use **Test action** in the editor to try a bound action, or `app preview` to run the saved layout as an app user.
196
+
197
+ ## Lyra App Builder
198
+
199
+ Use `app init --name "My app"` in your project, then open `studio` to build its interface. Add components, drag to reorder, or set component widths in the inspector. Bind agent cards and run buttons to agents or runnable workflows from your project. Save to `manifest.json`, then preview or export the same layout.
200
+
201
+ | Command | Purpose |
202
+ | --- | --- |
203
+ | `app init [manifest.json] [--name "My app"]` | Create a blank visual app and edit it in Studio |
204
+ | `app init --template agent` | Start with a side-by-side input and result and a run button ready to bind |
205
+ | `app init --saved-agents [manifest.json]` | Create the guided Cloud chat using two saved agents |
206
+ | `app validate <manifest.json>` | Check the manifest |
207
+ | `app preview [manifest.json]` | Run the saved layout in a local browser. Set `LYRA_PREVIEW_PORT` to choose a port |
208
+ | `app export <manifest.json> <new-directory>` | Export editable source to a new directory |
209
+
210
+ These commands are available in npm and Python. To import an app or preview a public listing, see [Marketplace](#marketplace).
211
+
212
+ ## Project Memory and Skill Proposals
213
+
214
+ Project Memory uses SQLite on your machine. Record a lesson, verify it against evidence, and retrieve it for later runs. The runtimes provide SQLite, so there is no separate database server to install.
215
+
216
+ ### Local memory
217
+
218
+ Local memory commands work in Source, npm, and Python. `consolidate` uses the shared Node CLI from Python.
219
+
220
+ | Command | Purpose |
221
+ | --- | --- |
222
+ | `memory --help` | List memory commands |
223
+ | `memory init` | Initialize the SQLite memory store |
224
+ | `memory record <json-file>` | Record a candidate lesson |
225
+ | `memory list` | List project memories |
226
+ | `memory search <query>` | Search project memory |
227
+ | `memory inspect <id>` | Read a record and its evidence references |
228
+ | `memory verify <id> <evidence.json>` | Verify a candidate against reviewed evidence |
229
+ | `memory archive <id>` | Archive a memory |
230
+ | `memory consolidate <context>` | Find recurring lessons for a context |
231
+ | `memory stats` | Show store counts and search mode |
232
+ | `memory forget <id> --yes` | Permanently remove a local record |
233
+
234
+ See [memory types](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/src/memory/index.d.ts) and [evidence validation](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/src/memory/validation.js). Store evidence references and reusable lessons. Keep secrets and sensitive data in appropriate stores. Use `LYRA_MEMORY_CONTEXT=off` to disable historical retrieval for model-backed runs.
235
+
236
+ ### Skill proposals
237
+
238
+ These commands work in Source, npm, and Python. Approving a proposal requires independent regression evidence.
239
+
240
+ | Command | Purpose |
241
+ | --- | --- |
242
+ | `skills --help` | List skill proposal commands |
243
+ | `skills evolve <context> <memory-id>` | Draft an improvement from verified memory |
244
+ | `skills proposals` | List proposals |
245
+ | `skills proposal <id>` | Inspect a proposal and its sources |
246
+ | `skills approve <id> <regression.json>` | Approve a proposal with evidence |
247
+ | `skills reject <id>` | Reject a pending proposal |
248
+ | `skills withdraw <id>` | Withdraw an approval |
249
+
250
+ ## AgentLyra Cloud and Marketplace
251
+
252
+ [Open the AgentLyra console](https://console.agentlyra.in/) to run hosted agents, manage a workspace, and view synced records. Create one AgentLyra API key under [API Keys](https://console.agentlyra.in/mcp-servers). Enable the permissions you need for hosted runs, resource sync, and verified memory sync.
253
+
254
+ | Command | Purpose |
255
+ | --- | --- |
256
+ | `connect-cloud [--replace-key]` | Connect once from the IDE. Use `--replace-key` to enter a new key |
257
+ | `work-locally` | Pause Cloud actions while keeping project files |
258
+
259
+ These commands are available in npm and Python. The compatibility names `gated` and `standalone` still work for switching modes. Provider credentials are configured separately where a hosted run requires them.
260
+
261
+ ### Sync project resources
262
+
263
+ These commands work in the npm and Python distributions with a key that has Cloud resource sync permission.
264
+
265
+ | Command | Purpose |
266
+ | --- | --- |
267
+ | `studio pull` | Pull the workspace catalog from Cloud |
268
+ | `studio push <agent-id>` | Push a local agent to Cloud |
269
+ | `studio pull-agent <agent-id>` | Pull changes to a linked agent |
270
+ | `studio push-workflow <workflow-id>` | Push a local workflow |
271
+ | `studio pull-workflow <workflow-id>` | Pull changes to a linked workflow |
272
+ | `studio push-team <team-id>` | Push a local team |
273
+ | `studio pull-team <team-id>` | Pull changes to a linked team |
274
+ | `studio push-skill <skill-id>` | Push a local text skill |
275
+ | `studio pull-skill <skill-id>` | Pull changes to a linked text skill |
276
+
277
+ ### Sync verified memories
278
+
279
+ Cloud memory commands work in the npm and Python distributions. They require an AgentLyra API key with Memory sync permission.
280
+
281
+ | Command | Purpose |
282
+ | --- | --- |
283
+ | `memory cloud list [cursor]` | List your synced records |
284
+ | `memory cloud preview <id>` | Review what would be sent |
285
+ | `memory cloud push <id> --yes` | Upload the reviewed record |
286
+ | `memory cloud pull <id>` | Import a Cloud copy for local review |
287
+
288
+ A verified record stays local until you choose to upload it. Preview the payload before confirming a push. The Cloud copy is private to your account.
289
+
290
+ ### Marketplace
291
+
292
+ Browse [published apps](https://agentlyra.in/marketplace/apps). Sign in to import or submit an app.
293
+
294
+ | Command | Purpose |
295
+ | --- | --- |
296
+ | `app use <listing-id> [new-manifest.json]` | Import a published app manifest. Requires `LYRA_SESSION_TOKEN` |
297
+ | `app publish <manifest.json> --dry-run` | Preview the listing payload. Submit the listing through Cloud |
298
+
299
+ ## License
300
+
301
+ The public source edition is available under the [MIT License](https://github.com/agentlyra-labs/agent-lyra-sdk/blob/main/LICENSE). For questions and reproducible bugs, use [GitHub Issues](https://github.com/agentlyra-labs/agent-lyra-sdk/issues). Report security issues privately and keep credentials out of issue reports.