{"id":17782169,"url":"https://github.com/i-am-bee/bee-api","last_synced_at":"2025-03-16T00:31:28.799Z","repository":{"id":258521003,"uuid":"873685940","full_name":"i-am-bee/bee-api","owner":"i-am-bee","description":"API backend for Bee","archived":false,"fork":false,"pushed_at":"2024-10-29T09:49:57.000Z","size":566,"stargazers_count":16,"open_issues_count":4,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-29T10:02:17.420Z","etag":null,"topics":["agents","ai","api","assistants-api","bee-agent-framework","fastify"],"latest_commit_sha":null,"homepage":"","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/i-am-bee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2024-10-16T14:49:14.000Z","updated_at":"2024-10-29T09:14:55.000Z","dependencies_parsed_at":"2024-10-19T11:40:54.569Z","dependency_job_id":"b882e15d-3eda-4b76-bdec-a865da515798","html_url":"https://github.com/i-am-bee/bee-api","commit_stats":{"total_commits":39,"total_committers":11,"mean_commits":"3.5454545454545454","dds":0.6666666666666667,"last_synced_commit":"aba5f3a6e9f6df6f1b10f5119e33a9e8646ae48f"},"previous_names":["i-am-bee/bee-api"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-am-bee%2Fbee-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-am-bee%2Fbee-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-am-bee%2Fbee-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-am-bee%2Fbee-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-am-bee","download_url":"https://codeload.github.com/i-am-bee/bee-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801635,"owners_count":20350107,"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":["agents","ai","api","assistants-api","bee-agent-framework","fastify"],"created_at":"2024-10-27T05:04:05.520Z","updated_at":"2025-03-16T00:31:28.793Z","avatar_url":"https://github.com/i-am-bee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"/docs/assets/Bee_logo_white.svg\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"/docs/assets/Bee_logo_black.svg\"\u003e\n    \u003cimg alt=\"Bee Framework logo\" height=\"90\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eBee API\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ch4 align=\"center\"\u003eOpenAI-compatible Assistants API backed by \u003ca href=\"https://github.com/i-am-bee/bee-agent-framework\"\u003eBee Agent Framework\u003c/a\u003e\u003c/h4\u003e\n\u003c/p\u003e\n\n## Getting started\n\n\u003e [!TIP]\n\u003e\n\u003e 🚀 The fastest way to setup Bee (UI + API) is through [Bee Stack](https://github.com/i-am-bee/bee-stack).\n\n1. Create `.env` (from `.env.example`) and fill in values.\n2. Run `pnpm install` to install dependencies.\n3. Start the server with `pnpm start:dev`\n\n## Technologies\n\n- [Fastify](https://fastify.dev/) as the web framework\n- [MikroORM](https://mikro-orm.io/) backed by [MongoDB](https://www.mongodb.com/) as the database layer\n- [BullMQ](https://docs.bullmq.io/guide/jobs) backed by [Redis](https://redis.io/) as the job executor\n- [Bee Agent Framework](https://github.com/i-am-bee/bee-agent-framework) as the agent execution engine\n\n## Architecture overview\n\nThe Assistants API consists mostly of CRUDL endpoints for managing API resources like assistants, threads, runs and more. Furthermore, some resources are asynchronous in a sense that they contain `status` changing over time as the background execution progresses. Clients use polling or streaming to watch for status updates of such resources.\n\n### Infrastructure\n\nThe infrastructure consists of:\n\n- REST API server\n- MongoDB\n- Redis\n\nThe REST API server stores resources in MongoDB database. Redis is used by BullMQ, rate limiter and as pub/sub broker for event streaming. Agent execution is performed by the Bee Agent Framework using various adapters for inference and embeddings.\n\n### Server\n\nThe codebase contains several types of modules:\n\n- `*.modules.ts` containing endpoint handlers\n- `*.services.ts` containing services for the handlers\n- `dtos/*.ts` containing JSON schema definitions for resources\n- `*.entity.ts` containing ORM definitions for database entities\n- `*.queue.ts` containing BullMQ queues and workers for asynchronous execution\n\nThese modules are connected in the following manner\n\n```\nmodule ---\u003e dto\n       ---\u003e service ---\u003e entity\n                    ---\u003e queue ---\u003e entity\n```\n\nOpenAPI schema is auto-generated from the `dtos` and exposed on the `/docs` endpoint.\n\n## Starting the bee-api infrastructure\n\nThe easiest way to run all the dependencies for the bee-api is to:\n\n- Clone the bee-stack repository https://github.com/i-am-bee/bee-stack\n- Navigate to the bee-stack directory.\n- Run the infrastructure:\n\n```\n./bee-stack.sh clean\n./bee-stack.sh start:infra\n```\n\n- Then navigate back to the bee-api repository.\n- Install packages:\n\n```\npnpm install\n```\n\n- When running for the first time seed the database:\n\n```\npnpm mikro-orm seeder:run\n```\n\n- copy .env.example to .env\n\n```\ncp .env.example .env\n```\n\n- Add values the env vars: CRYPTO_CIPHER_KEY, AI_BACKEND and API key for which ever provider you have chosen.\n\n- Run the bee-api:\n\n```\npnpm start:dev\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-am-bee%2Fbee-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-am-bee%2Fbee-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-am-bee%2Fbee-api/lists"}