{"id":44974188,"url":"https://github.com/fleek-platform/persona-generator","last_synced_at":"2026-02-18T16:30:35.285Z","repository":{"id":287059068,"uuid":"963408614","full_name":"fleek-platform/persona-generator","owner":"fleek-platform","description":"The persona-generator is a library designed to transform user input (natural language processing) into structured JSON files representing AI agent personas. It converts user friendly descriptions into detailed character profiles, including secrets, biographical information, lore, and knowledge topics, an utility for building AI-driven apps.","archived":false,"fork":false,"pushed_at":"2025-05-01T09:58:46.000Z","size":563,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-05-01T10:37:31.212Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fleek-platform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-09T16:28:55.000Z","updated_at":"2025-05-01T09:58:49.000Z","dependencies_parsed_at":"2025-04-16T20:22:51.616Z","dependency_job_id":null,"html_url":"https://github.com/fleek-platform/persona-generator","commit_stats":null,"previous_names":["fleek-platform/persona-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fleek-platform/persona-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleek-platform%2Fpersona-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleek-platform%2Fpersona-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleek-platform%2Fpersona-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleek-platform%2Fpersona-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fleek-platform","download_url":"https://codeload.github.com/fleek-platform/persona-generator/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleek-platform%2Fpersona-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29585531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T13:56:48.962Z","status":"ssl_error","status_checked_at":"2026-02-18T13:54:34.145Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-02-18T16:30:32.174Z","updated_at":"2026-02-18T16:30:35.275Z","avatar_url":"https://github.com/fleek-platform.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡️Fleek Platform Persona Generator\n\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-blue.svg)](https://conventionalcommits.org)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThe persona-generator is a library designed to transform user input (natural language processing) into structured JSON files representing AI agent personas. It converts user friendly descriptions into detailed character profiles, including secrets, biographical information, lore, and knowledge topics, an utility for building AI-driven apps.\n\nYou'll find the project located in [packages/persona-generator](./packages/persona-generator), alongside there's the service built as lambda [packages/persona-generator-service](packages/persona-generator-service).\n\n## Overview\n\n- [🤖 Install](#-install)\n- [👷 Development](#-development)\n  - [Environment variables](#environment-variables)\n  - [Preview](#preview-server)\n- [⚕ Lambda](#lambda)\n  - [Details](#details)\n  - [Commands](#commands)\n  - [Lint Serverless setup](#lint-serverless-setup)\n  - [Service Preview](#service-preview)\n  - [Endpoints](#endpoints)\n- [🔎 Changeset](#changeset)\n- [👾 Command-line interface](#command-line-interface)\n- [🙏 Contributing](#-contributing)\n  - [Branching strategy](#branching-strategy)\n  - [Conventional commits](#conventional-commits)\n\n\u003e [!NOTE]  \n\u003e If you're planning to contribute as a developer, you must install [bun](https://github.com/oven-sh/bun), otherwise most commands will fail.\n\n## 👷 Development\n\nFor developers looking to contribute to the `@fleek-platform/persona-generator`, [clone](https://github.com/fleek-platform/persona-generator) the repository and follow the [contribution guide](#-contributing).\n\nFor runtime we utilize [https://bun.sh](https://bun.sh) and as the package manager.\n\nNext, install the project dependencies:\n\n```sh\nbun i\n```\n\n### Environment variables\n\nIf you'll be interacting with services, you'll need to set up the environment variables.\n\nCreate a local file named `.env` and declare the following environment variables for the environment you're interested:\n\n```sh\nPUBLIC_FLEEK_REST_API_URL=\"https://api.fleek.xyz\"\nPUBLIC_OPENAI_COMPATIBLE_API_URL=***\nPUBLIC_OPENAI_COMPATIBLE_MODEL=***\nPUBLIC_PERSONA_GENERATOR_ENVIRONMENT=***\nPUBLIC_PERSONA_GENERATOR_CUSTOM_DOMAIN_NAME=***\nPUBLIC_PERSONA_GENERATOR_CERTIFICATE_ARN=***\nPUBLIC_SOCIAL_AGENT_API_URL=***\nPRIVATE_OPENAI_COMPATIBLE_API_KEY=***\nPRIVATE_STACK_NAME_PREFIX=***\n```\n\nThe application uses the [getDefined](./src/defined.ts) to lookup for environment variables.\n\n### Dev server\n\nA preview server's available for development purposes. It restarts everytime a project file's modified.\n\n\u003e [!WARNING]  \n\u003e The public API's provided as a lambda. Local environment preview might not reflect the actual behaviour of lambda, which you must test to avoid disappointment. If you'd like to test lambda's locally, learm more about it in [Lambda](#lambda) section.\n\nTo start the dev server run:\n\n```sh\nbun run dev\n```\n\nYou'll find information about the local server in the output.\n\n\u003e [!IMPORTANT]  \n\u003e Every request apart from /health requires a valid access token, which at time of writing assumes the token includes a project id, e.g. \"Authorization: Bearer \u003cUser-Access-Token\u003e\"\n\nUse your favourite client to make requests, e.g. cURL:\n\n```sh\ncurl \\\n  -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -H 'authorization: Bearer \u003cUSER-ACCESS-TOKEN\u003e' \\\n  -d '{\n    \"content\": \"Create an agent called Robocop, that has the following treats, its funny, likes to dance, travel the world, but he needs the internet. Use my openai api key abcd-efgh-ijkl-mnop-qrst and my twitter username robocopkid16\"\n  }' \\\n  http://127.0.0.1:3000/v1/generate\n```\n\nAn example using fetch:\n\n```ts\nfetch('http://localhost:3030/v1/generate', {\n  method: 'POST',\n  headers: {\n    'Content-Type': 'application/json',\n    'Authorization': 'Bearer \u003cUSER-ACCESS-TOKEN\u003e',\n  },\n  body: JSON.stringify({\n    content: \"Create an agent called Robocop, that has the following treats, its funny, likes to dance, travel the world, but he needs the internet. Use my openai api key abcd-efgh-ijkl-mnop-qrst and my twitter username robocopkid16\"\n  })\n});\n```\n\nHere's a response:\n\n```js\n{\n  \"data\": {\n    \"clients\": [\n      \"discord\",\n      \"twitter\",\n      \"telegram\"\n    ],\n    \"modelProvider\": \"openai\",\n    \"name\": \"Robocop\",\n    \"settings\": {\n      \"bio\": [\n        \"A humorous law enforcer with a penchant for dancing and globe\ntrotting, relying on the internet to stay updated on crime.\"\n      ],\n      \"knowledge\": [\n        \"Street criminal behavior patterns\",\n        \"Drug trafficking methods\",\n        \"Car jacking techniques\",\n        \"Gambling scams and operations\",\n        \"Cybercrime tactics\",\n        \"Local crime hotspots\",\n        \"Emergency response protocols\"\n      ],\n      \"lore\": [],\n      \"messageExamples\": [\n        [\n          {\n            \"content\": {\n              \"text\": \"Hey Robocop, what's the latest on the streets?\"\n            },\n            \"user\": \"{{user1}}\"\n          },\n          {\n            \"content\": {\n              \"text\": \"Well, {{user1}}, it seems some digital bandits\n            },\n            \"user\": \"Robocop\"\n          },\n          {\n            \"content\": {\n              \"text\": \"Dance-off? Really?\"\n            },\n            \"user\": \"{{user1}}\"\n          },\n          {\n            \"content\": {\n              \"text\": \"Gotta keep things interesting, {{user1}}. Keeps\n            },\n            \"user\": \"Robocop\"\n          }\n        ]\n      ],\n      \"plugins\": [],\n      \"style\": {\n        \"all\": [\n          \"humorous\",\n          \"witty\",\n          \"upbeat\",\n          \"informative\",\n          \"street-smart\",\n          \"sarcastic\"\n        ],\n        \"chat\": [],\n        \"post\": []\n      },\n      \"topics\": [\n        \"Current crime trends\",\n        \"Global travel destinations\",\n        \"Dancing styles\",\n        \"Internet safety tips\",\n        \"Law enforcement strategies\",\n        \"Community safety initiatives\"\n      ],\n      \"adjectives\": [\n        \"humorous\",\n        \"vigilant\",\n        \"resourceful\",\n        \"dedicated\",\n        \"analytical\",\n        \"charming\"\n      ],\n      \"secrets\": {\n        \"ENABLE_ACTION_PROCESSING\": \"true\",\n        \"MAX_ACTIONS_PROCESSING\": \"10\",\n        \"OPENAI_API_KEY\": \"xxx-yyyy-zzzz-rrrr-1111\",\n        \"POST_IMMEDIATELY\": \"true\",\n        \"POST_INTERVAL_MAX\": \"180\",\n        \"POST_INTERVAL_MIN\": \"90\",\n        \"TWITTER_2FA_SECRET\": null,\n        \"TWITTER_EMAIL\": null,\n        \"TWITTER_PASSWORD\": null,\n        \"TWITTER_POLL_INTERVAL\": \"120\",\n        \"TWITTER_SPACES_ENABLE\": \"false\",\n        \"TWITTER_USERNAME\": null,\n        \"ACTION_TIMELINE_TYPE\": \"foryou\"\n      },\n      \"voice\": {\n        \"model\": \"en_GB-alan-medium\"\n      },\n      \"postExamples\": []\n    }\n  },\n  \"error\": null,\n  \"status\": \"success\"\n}\n```\n\n## Lambda\n\nThe application's serviced by AWS Lambda leveraging a serverless setup. Our lambda's handler based in [Hono](https://hono.dev). Our project setup's based on [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html).\n\nFind the [template.yaml](./template.yaml) in the root directory. Also, the [samconfig.toml](samconfig.toml).\n\n\u003e [!IMPORTANT]  \n\u003e When customising DNS remember to flush your local DNS cache, e.g. macOS:\n\u003e sudo dscacheutil -flushcache \n\u003e sudo killall -HUP mDNSResponder\n\nTo operate locally, you must have aws configured. For example, its common to have previously configured it by:\n\n```\naws configure\n```\n\nYou must have the `~/.aws` configuration and credentials. For example `~/.aws/credentials`:\n\n```sh\n[default]\naws_access_key_id = \u003cAWS-ACCESS-KEY-ID\u003e\naws_secret_access_key = \u003cAWS-SECRET-ACCESS-KEY\u003e\n```\n\n\u003e [!IMPORTANT]  \n\u003e Find the AWS Access key in the AWS Dashboard's **IAM \u003e Users \u003e Username**. The AWS Secret Access key requires you to create a new access key.\n\nHere's an example for `~/.aws/config`\n\n```sh\n[default]\nregion = \u003cREGION\u003e\noutput = json\n```\n\n### Details\n\nThe application routes computes requests allowed by our [serverless](./serverless.yml) setup. You may find that a wildcard's declared to allow any income or method request. Otherwise, specificity's required to allow it to reach into the app to resolve it. Thus, if you find in a situation which you can't ping an endpoint it might be that wildcards' disabled, requiring to expose the route in the serverless settings.\n\nHere's an example of quick health checkup via the production hostname:\n\n```sh\ncurl -X GET \\\n  https://persona-generator-service.flkservices.io/v1/health\n```\n\nFor any other routes, read the [packages/persona-generator-service/src/service.ts](./packages/persona-generator-service/src/service.ts).\n\n### Commands\n\nThe following commands require you to have an AWS account with permissions to interact with the resources.\n\nDev Mode redirects live AWS Lambda events to local:\n\n```sh\nbun run dev\n```\n\nDeploy the lambda service:\n\n```sh\nbun run service:deploy\n```\n\nGet service details:\n\n```sh\nbun run service:info\n```\n\n### Lint Serverless setup\n\nThe Lint Serverless validates infrastructure-as-code template against recommended practices by [AWS Serverless team](https://awslabs.github.io/serverless-rules/).\n\n\u003e [!INFO]\n\u003e You must have the python libraries installed, check the instructions [here](https://awslabs.github.io/serverless-rules/cfn-lint/)\n\n```sh\nbun run lint:serverless\n```\n\n### Service Preview\n\nThe service previewer provides the mechnanism to start the dev mode of what AWS provides as a service.\n\n\u003e [!WARNING]  \n\u003e To operate locally, you must have aws configured.\n\n\u003e [!WARNING]  \n\u003e The public API's provided as a lambda. Local environment preview might not reflect the actual behaviour of lambda, which you must test to avoid disappointment.\n\n\u003e [!WARNING]\n\u003e Find a solution to replace node-fetch of openai\ndue to `Error: Dynamic require of \"stream\" is not supported`\nwhich cause need to prebuild running lambda, e.g. sls dev\n\nStart the lambda preview locally by:\n\n```sh\npnpm service:preview\n```\n\n### Endpoints\n\nLocate the endpoints at [service.ts](packages/persona-generator-service/src/service.ts)\n\nFor example:\n\n```\nGET /health\nPOST v2/improve_prompt/stream\nPOST v2/generate\nPOST v2/assistant/stream\nPOST v1/generate\nPOST v1/assistant/stream\n```\n\n## Changeset\n\nManage the versioning of changelog entries.\n\nDeclare an intent to release by executing the command and answering the wizard's questions:\n\n```sh\npnpm changeset:add\n```\n\n## Command-line interface\n\nUsage: persona-generator [options] \u003ccontent\u003e\n\n```sh\nArguments:\n  content               Text description of the persona to generate\n\nOptions:\n  -V, --version         output the version number\n  -k, --api-key \u003ckey\u003e   OpenAI API key (defaults to env var\n                        PRIVATE_OPENAI_COMPATIBLE_API_KEY)\n  -u, --base-url \u003curl\u003e  OpenAI compatible API URL (defaults to env\n                        var PUBLIC_OPENAI_COMPATIBLE_API_URL)\n  -m, --model \u003cmodel\u003e   OpenAI compatible model (defaults to env var\n                        PUBLIC_OPENAI_COMPATIBLE_MODEL)\n  -h, --help            display help for command\n```\n\nThe package can be installed globally, allowing the user to make calls to the bin `persona-generator`:\n\n```sh\npersonagen \\\n  '\u003cUser description\u003e'\n```\n\nAlternatively, execute it by running it from root as follows:\n\n```sh\n./bin \\\n  '\u003cUser description\u003e'\n```\n\nOnce successful, you'll get a JSON [characterfile](https://github.com/elizaOS/characterfile).\n\n## 🙏 Contributing\n\nThis section guides you through the process of contributing to our open-source project. From creating a feature branch to submitting a pull request, get started by:\n\n1. Fork the project [here](https://github.com/fleekxyz/cli)\n2. Create your feature branch using our [branching strategy](#branching-strategy), e.g. `git checkout -b feat/my-new-feature`\n3. Run the tests: `pnpm test`\n4. Commit your changes by following our [commit conventions](#conventional-commits), e.g. `git commit -m 'chore: 🤖 my contribution description'`\n5. Push to the branch, e.g. `git push origin feat/my-new-feature`\n6. Create new Pull Request following the corresponding template guidelines\n\n### Branching strategy\n\nThe develop branch serves as the main integration branch for features, enhancements, and fixes. It is always in a deployable state and represents the latest development version of the application.\n\nFeature branches are created from the develop branch and are used to develop new features or enhancements. They should be named according to the type of work being done and the scope of the feature and in accordance with conventional commits [here](#conventional-commits).\n\n### Conventional commits\n\nWe prefer to commit our work following [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) conventions. Conventional Commits are a simple way to write commit messages that both people and computers can understand. It help us keep track fo changes in a consistent manner, making it easier to see what was added, changed, or fixed in each commit or update.\n\nThe commit messages are formatted as **[type]/[scope]**\nThe **type** is a short descriptor indicating the nature of the work (e.g., feat, fix, docs, style, refactor, test, chore). This follows the conventional commit types.\n\nThe **scope** is a more detailed description of the feature or fix. This could be the component or part of the codebase affected by the change.\n\nHere's an example of different conventional commits messages that you should follow:\n\n```txt\ntest: 💍 Adding missing tests\nfeat: 🎸 A new feature\nfix: 🐛 A bug fix\nchore: 🤖 Build process or auxiliary tool changes\ndocs: 📝 Documentation only changes\nrefactor: 💡 A code change that neither fixes a bug or adds a feature\nstyle: 💄 Markup, white-space, formatting, missing semi-colons...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleek-platform%2Fpersona-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffleek-platform%2Fpersona-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleek-platform%2Fpersona-generator/lists"}