{"id":26090618,"url":"https://github.com/gensx-inc/gensx","last_synced_at":"2025-05-15T04:05:13.403Z","repository":{"id":271981065,"uuid":"899766976","full_name":"gensx-inc/gensx","owner":"gensx-inc","description":"The TypeScript framework for agents \u0026 workflows with react-like components. Lightning fast dev loop. Easy to learn. Easy to extend.","archived":false,"fork":false,"pushed_at":"2025-05-12T23:56:36.000Z","size":20045,"stargazers_count":460,"open_issues_count":103,"forks_count":21,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-13T00:32:07.169Z","etag":null,"topics":["generative-ai","llm-framework","llms","workflow"],"latest_commit_sha":null,"homepage":"https://gensx.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gensx-inc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-07T01:08:18.000Z","updated_at":"2025-05-12T18:03:19.000Z","dependencies_parsed_at":"2025-02-21T21:29:01.850Z","dependency_job_id":"ba642cab-2dd0-47bf-880b-1bdff61af5ef","html_url":"https://github.com/gensx-inc/gensx","commit_stats":null,"previous_names":["cortexclick/gensx","gensx-inc/gensx"],"tags_count":259,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gensx-inc%2Fgensx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gensx-inc%2Fgensx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gensx-inc%2Fgensx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gensx-inc%2Fgensx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gensx-inc","download_url":"https://codeload.github.com/gensx-inc/gensx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253851080,"owners_count":21973674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generative-ai","llm-framework","llms","workflow"],"created_at":"2025-03-09T09:40:39.982Z","updated_at":"2025-05-15T04:05:08.389Z","avatar_url":"https://github.com/gensx-inc.png","language":"TypeScript","funding_links":[],"categories":["Type-Safe Prompting \u0026 Declarative DSLs","Agent SDK / framework"],"sub_categories":[],"readme":"# GenSX ⚡️\n\n[![npm version](https://badge.fury.io/js/gensx.svg)](https://badge.fury.io/js/gensx)\n[![Website](https://img.shields.io/badge/Visit-gensx.com-orange)](https://gensx.com)\n[![Discord](https://img.shields.io/badge/Join-Discord-blue)](https://discord.gg/wRmwfz5tCy)\n[![X](https://img.shields.io/badge/Follow-X-blue)](https://x.com/gensx_inc)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n[GenSX](https://gensx.com/) is a simple typescript framework for building agents and workflows with reusable React-like components.\n\nGenSX takes a lot of inspiration from React, but the programming model is very different - it’s a Node.js framework designed for data flow.\n\nBut if you know how to write a react component, then building an agent will feel easy and familiar.\n\n## Why GenSX?\n\n- 🎯 **Pure Functions**: Components are pure TypeScript functions that are easily testable, reusable, and sharable\n- 🌴 **Natural Composition**: Chain LLM calls using JSX - a familiar, visual syntax that reads top-to-bottom like normal code\n- ⚡️ **Parallel by Default**: Components execute in parallel when possible while maintaining dependencies\n- 🔒 **Type-safe**: Full TypeScript support with no DSLs or special syntax - just standard language features\n- 🌊 **Streaming Built-in**: Stream responses with a single prop change, no refactoring needed\n- 🚀 **Built for Scale**: Start simple and evolve to complex patterns like agents and reflection without changing your programming model\n\nCheck out the [documentation](https://gensx.com/docs) to learn more about building LLM applications with GenSX.\n\n## Building a workflow\n\nMost LLM frameworks are graph oriented--you express your workflow with nodes, edges, and a global state object. GenSX takes a different approach--you compose your workflow with components, and GenSX handles the execution for you.\n\nComponents in GenSX look a lot like a React components:\n\n```tsx\nimport * as gensx from \"@gensx/core\";\nimport { ChatCompletion } from \"gensx/openai\";\n\n// props interface\ninterface WriteDraftProps {\n  research: string[];\n  prompt: string;\n}\n\n// return type\ntype WriteDraftOutput = string;\n\n// components are pure functions that are reusable by default\nconst WriteDraft = gensx.Component\u003cWriteDraftProps, WriteDraftOutput\u003e(\n  \"WriteDraft\",\n  ({ prompt, research }) =\u003e {\n    const systemMessage = `You're an expert technical writer.\n    Use the information when responding to users: ${research}`;\n\n    return (\n      \u003cChatCompletion\n        model=\"gpt-4o-mini\"\n        temperature={0}\n        messages={[\n          {\n            role: \"system\",\n            content: systemMessage,\n          },\n          {\n            role: \"user\",\n            content: `Write a blog post about ${prompt}`,\n          },\n        ]}\n      /\u003e\n    );\n  },\n);\n```\n\nComponents can be composed together to create more complex agents and workflows:\n\n```tsx\nimport * as gensx from \"@gensx/core\";\nimport { OpenAIProvider } from \"gensx/openai\";\nimport { Research, WriteDraft, EditDraft } from \"./writeBlog\";\n\ninterface BlogWriterProps {\n  prompt: string;\n}\n\nexport const WriteBlog = gensx.StreamComponent\u003cBlogWriterProps\u003e(\n  \"WriteBlog\",\n  ({ prompt }) =\u003e {\n    return (\n      \u003cOpenAIProvider apiKey={process.env.OPENAI_API_KEY}\u003e\n        \u003cResearch prompt={prompt}\u003e\n          {(research) =\u003e (\n            \u003cWriteDraft prompt={prompt} research={research.flat()}\u003e\n              {(draft) =\u003e \u003cEditDraft draft={draft} stream={true} /\u003e}\n            \u003c/WriteDraft\u003e\n          )}\n        \u003c/Research\u003e\n      \u003c/OpenAIProvider\u003e\n    );\n  },\n);\n\nconst workflow = gensx.Workflow(\"WriteBlogWorkflow\", WriteBlog);\nconst result = await workflow.run({\n  prompt: \"Write a blog post about AI developer tools\",\n});\n```\n\n## Getting Started\n\nCheck out the [Quickstart Guide](https://gensx.com/docs/quickstart) to build your first workflow in just a few minutes.\n\n## Examples\n\nThis repo contains a number of [examples](./examples) to help you get up and running with GenSX.\n\nRunning an example:\n\n```bash\n# From the root of the repo\n\n# Install dependencies\npnpm install\n\n# Run the example\npnpm start:example \u003cexample-name\u003e\n\n# or to run from the example directory\npnpm build\n\ncd examples/\u003cexample-name\u003e\npnpm start\n```\n\n### Basic Examples\n\n| Example                                                 | Description                                                      |\n| ------------------------------------------------------- | ---------------------------------------------------------------- |\n| 📊 [Structured Outputs](./examples/structuredOutputs)   | Shows how to use structured outputs with GenSX                   |\n| 🔄 [Reflection](./examples/reflection)                  | Shows how to use a self-reflection pattern with GenSX            |\n| 🌊 [Streaming](./examples/streaming)                    | Shows how to handle streaming responses with GenSX               |\n| 🗃️ [Contexts](./examples/contexts)                      | Shows how to use contexts to manage state in GenSX               |\n| 🔌 [Providers](./examples/providers)                    | Shows how to create a custom provider for GenSX                  |\n| 🎭 [Nested Providers](./examples/nestedProviders)       | Demonstrates how to nest and combine multiple providers in GenSX |\n| 🧩 [Reusable Components](./examples/reusableComponents) | Shows how to create and use reusable components in GenSX         |\n\n### Full Examples\n\n| Example                                                  | Description                                                                                  |\n| -------------------------------------------------------- | -------------------------------------------------------------------------------------------- |\n| 🔍 [Hacker News Analyzer](./examples/hackerNewsAnalyzer) | Analyzes HN posts and generates summaries and trends using Paul Graham's writing style       |\n| ✍️ [Blog Writer](./examples/blogWriter)                  | Generates blogs through an end-to-end workflow including topic research and content creation |\n| 🔬 [Deep Research](./examples/deepResearch)              | Generates a report from a prompt after researching and summarizing a list of research papers |\n| 💻 [Computer Use](./examples/openai-computer-use)        | Demonstrates how to use the OpenAI computer use tool with GenSX                              |\n\n## Working with this repo\n\nThis monorepo contains GenSX, its related packages, examples, and documentation. You can find more detailed instructions in [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n### Repository Structure\n\n- `packages/` - Published packages\n- `examples/` - Example applications and use cases\n- `website/` - [GenSX website](https://gensx.com)\n\n## License\n\n[Apache 2.0](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgensx-inc%2Fgensx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgensx-inc%2Fgensx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgensx-inc%2Fgensx/lists"}