https://github.com/blajanclaudiu/gate

https://github.com/blajanclaudiu/gate

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.0%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: blajanclaudiu
  • License: other
  • Language: TypeScript
  • Default Branch: main
  • Size: 3.21 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 6
  • Releases: 0
Created about 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme Contributing License Security

README.md

BaseAI

license

Getting Started

BaseAI is the AI framework for building serverless and composable AI agents with memory and tools. It allows you to develop AI agent pipes on your local machine with integrated agentic tools and memory (RAG). Visit our BaseAI.dev/learn guide to start with BaseAI.

Documentation (recommended)

Please check BaseAI.dev/docs and BaseAI.dev/learn to get started with full documentation.

1. Initialize a new BaseAI project

BaseAI is a TypeScript-first framework. To create a new BaseAI project, run the following command in your project:

bash npx baseai@latest init

This command will create a baseai directory in your project. This is what the directory structure looks like:

ROOT (of your app) ├── baseai | ├── baseai.config.ts | ├── memory | ├── pipes | └── tools ├── .env (your env file) └── package.json

2. Add API keys

Copy the following in your .env file and add appropriate LLM API keys:

```bash

!! SERVER SIDE ONLY !!

Keep all your API keys secret — use only on the server side.

TODO: ADD: Both in your production and local env files.

Langbase API key for your User or Org account.

How to get this API key https://langbase.com/docs/api-reference/api-keys

LANGBASEAPIKEY=

TODO: ADD: LOCAL ONLY. Add only to local env files.

Following keys are needed for local pipe runs. For providers you are using.

For Langbase, please add the key to your LLM keysets.

Read more: Langbase LLM Keysets https://langbase.com/docs/features/keysets

OPENAIAPIKEY= ANTHROPICAPIKEY= COHEREAPIKEY= FIREWORKSAPIKEY= GOOGLEAPIKEY= GROQAPIKEY= MISTRALAPIKEY= PERPLEXITYAPIKEY= TOGETHERAPIKEY= XAIAPIKEY= ```

3. Create a new AI agent

Pipe is your custom-built AI agent as an API. It's the fastest way to ship AI features/apps. Let's create a new pipe:

bash npx baseai@latest pipe

It will ask you for the name, description, and other details of the pipe step-by-step. Once done, a pipe will be created inside the /baseai/pipes directory. You can now edit the system prompt, change model params, and more. Here is what a pipe code looks like:

```ts import { PipeI } from '@baseai/core';

const pipeSummary = (): PipeI => ({ // Replace with your API key https://langbase.com/docs/api-reference/api-keys apiKey: process.env.LANGBASEAPIKEY!, name: 'summary', description: 'AI Summary agent', status: 'public', model: 'openai:gpt-4o-mini', stream: true, json: false, store: true, moderate: true, topp: 1, maxtokens: 1000, temperature: 0.7, presencepenalty: 1, frequencypenalty: 1, stop: [], toolchoice: 'auto', paralleltool_calls: true, messages: [ { role: 'system', content: You are a helpful AI agent. Make everything Less wordy. } ], variables: [], memory: [], tools: [] });

export default pipeSummary; ```

4. Integrate pipe in your app

Let's create a new index.ts file in your project root. Now we need to do the following:

  1. Import the pipe config we created.
  2. Create a new pipe instance with the pipe config.
  3. Run the pipe with a user message.
  4. Listen to the stream events.

Here is what the code looks like:

```ts import { Pipe, getRunner } from '@baseai/core'; import pipeSummarizer from './baseai/pipes/summary';

const pipe = new Pipe(pipeSummarizer());

const userMsg = Langbase studio is your playground to build, collaborate, and deploy AI. It allows you to experiment with your pipes in real-time, with real data, store messages, version your prompts, and truly helps you take your idea from building prototypes to deployed in production with LLMOps on usage, cost, and quality. A complete AI developers platform. - Collaborate: Invite all team members to collaborate on the pipe. Build AI together. - Developers & Stakeholders: All your R&D team, engineering, product, GTM (marketing and sales), literally invlove every stakeholder can collaborate on the same pipe. It's like a powerful version of GitHub x Google Docs for AI. A complete AI developers platform. ;

async function main() { const { stream } = await pipe.run({ messages: [{ role: 'user', content: userMsg }], stream: true, });

const runner = getRunner(stream);

// Method 1: Using event listeners
runner.on('connect', () => {
    console.log('Stream started.\n');
});

runner.on('content', content => {
    process.stdout.write(content);
});

runner.on('end', () => {
    console.log('\nStream ended.');
});

runner.on('error', error => {
    console.error('Error:', error);
});

}

main(); ```

Make sure to install and import dotenv at the top if you are using Node.js:

ts import 'dotenv/config';

5. Run the AI agent

To run the pipe locally, you need to start the BaseAI server. Run the following command in your terminal:

bash npx baseai@latest dev

Now, run the index.ts file in your terminal:

bash npx tsx index.ts

You should see the following output in your terminal:

```md Stream started.

Langbase Studio is your AI development playground. Experiment in real-time with real data, store messages, and version prompts to move from prototype to production seamlessly.

Key Features: - Collaborate: Invite team members to build AI together. - Inclusive Teams: Engage all stakeholders—R&D, engineering, product, and marketing—in a shared space. It’s like GitHub combined with Google Docs for AI development. Stream ended. ```

[!TIP] You can also run RAG locally with BaseAI. Check out the memory agent quickstart guide for more details.

Contributing

We welcome contributions to BaseAI. Please see our Contributing Guide for more information.

Authors

The following are the original authors of BaseAI:

Security

If you've found a security vulnerability in BaseAI, please report it privately by emailing security@langbase.com. Please do not open a public issue. For more details on Langbase security and how to report, visit this link.

Learn more by clicking and browsing our website, docs, and a free /learn AI course on building AI agents, with agentic tools, and agentic memory.

baseai.dev

Owner

  • Login: blajanclaudiu
  • Kind: user

GitHub Events

Total
  • Issues event: 1
  • Delete event: 21
  • Issue comment event: 24
  • Pull request event: 52
  • Create event: 28
Last Year
  • Issues event: 1
  • Delete event: 21
  • Issue comment event: 24
  • Pull request event: 52
  • Create event: 28

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 1
  • Total pull requests: 31
  • Average time to close issues: N/A
  • Average time to close pull requests: 7 days
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.55
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 31
Past Year
  • Issues: 1
  • Pull requests: 31
  • Average time to close issues: N/A
  • Average time to close pull requests: 7 days
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.55
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 31
Top Authors
Issue Authors
  • blajanclaudiu (1)
Pull Request Authors
  • dependabot[bot] (31)
Top Labels
Issue Labels
Pull Request Labels
dependencies (31) javascript (31)

Dependencies

apps/baseai.dev/package.json npm
  • @cloudflare/next-on-pages ^1.11.0 development
  • @types/uuid ^10.0.0 development
  • enquirer ^2.4.1 development
  • eslint ^8.56.0 development
  • eslint-config-next ^14.0.4 development
  • prettier ^3.1.1 development
  • prettier-plugin-tailwindcss ^0.5.11 development
  • sharp 0.33.1 development
  • wrangler ^3.50.0 development
  • @algolia/autocomplete-core ^1.7.3
  • @cloudflare/workers-types ^4.20240405.0
  • @headlessui/react ^1.7.15
  • @headlessui/tailwindcss ^0.2.0
  • @heroicons/react ^2.1.3
  • @intercom/messenger-js-sdk ^0.0.14
  • @mdx-js/loader ^3.0.0
  • @mdx-js/react ^3.0.0
  • @next/mdx ^14.0.4
  • @radix-ui/react-accordion ^1.2.0
  • @radix-ui/react-dialog ^1.0.5
  • @radix-ui/react-slot ^1.0.2
  • @radix-ui/react-tooltip ^1.1.2
  • @sindresorhus/slugify ^2.1.1
  • @tailwindcss/typography ^0.5.10
  • @types/mdx ^2.0.8
  • @types/node ^20.10.8
  • @types/react ^18.2.47
  • @types/react-dom ^18.2.18
  • @types/react-highlight-words ^0.16.4
  • @types/three ^0.168.0
  • @xyflow/react ^12.0.4
  • acorn ^8.8.1
  • autoprefixer ^10.4.7
  • class-variance-authority ^0.7.0
  • clsx ^2.1.1
  • dayjs ^1.11.12
  • fast-glob ^3.3.0
  • flexsearch ^0.7.31
  • framer-motion ^10.18.0
  • gray-matter ^4.0.3
  • html2canvas ^1.4.1
  • lucide-react ^0.378.0
  • mdast-util-to-string ^4.0.0
  • mdx-annotations ^0.1.1
  • mxcn ^2.0.0
  • next ^14.0.4
  • next-mdx-remote ^5.0.0
  • next-themes ^0.2.1
  • react ^18.2.0
  • react-dom ^18.2.0
  • react-highlight-words ^0.20.0
  • recoil ^0.7.7
  • remark ^15.0.1
  • remark-gfm ^4.0.0
  • remark-mdx ^3.0.0
  • shiki ^0.14.7
  • simple-functional-loader ^1.2.1
  • tailwind-merge ^2.3.0
  • tailwindcss ^3.4.1
  • tailwindcss-animate ^1.0.7
  • three ^0.168.0
  • typescript ^5.3.3
  • unist-util-filter ^5.0.1
  • unist-util-visit ^5.0.0
  • uuid ^10.0.0
  • vaul ^0.9.1
  • zustand ^4.3.2
examples/agents/it-systems-triage-agent/package.json npm
  • baseai ^0.9.19 development
  • @baseai/core ^0.9.19
  • dotenv ^16.4.5
  • inquirer ^12.0.0
  • ora ^8.1.0
examples/agents/readme-writer-agent/package.json npm
  • baseai ^0.9.20 development
  • @baseai/core ^0.9.20
  • @clack/prompts ^0.7.0
  • chalk ^5.3.0
  • clear-any-console ^1.16.2
  • figures ^6.1.0
  • picocolors ^1.1.0
  • tsup ^8.3.0
examples/astro/package.json npm
  • baseai ^0.9.42 development
  • @astrojs/check ^0.9.3
  • @astrojs/node ^8.3.4
  • @astrojs/react ^3.6.2
  • @astrojs/tailwind ^5.1.1
  • @astrojs/vercel ^7.8.1
  • @baseai/core ^0.9.42
  • @radix-ui/react-slot ^1.1.0
  • @types/react ^18.3.9
  • @types/react-dom ^18.3.0
  • astro ^4.15.9
  • class-variance-authority ^0.7.0
  • clsx ^2.1.1
  • mathjs ^13.1.1
  • react ^18.3.1
  • react-dom ^18.3.1
  • tailwind-merge ^2.5.2
  • tailwindcss ^3.4.13
  • tailwindcss-animate ^1.0.7
  • typescript ^5.6.2
examples/nextjs/package.json npm
  • @types/node ^20 development
  • @types/react ^18 development
  • @types/react-dom ^18 development
  • baseai ^0.9.42 development
  • eslint ^8 development
  • eslint-config-next 14.2.5 development
  • mini-css-extract-plugin ^2.9.0 development
  • postcss ^8 development
  • tailwindcss ^3.4.1 development
  • typescript ^5 development
  • @baseai/core ^0.9.42
  • @radix-ui/react-slot ^1.1.0
  • class-variance-authority ^0.7.0
  • clsx ^2.1.1
  • lucide-react ^0.416.0
  • mathjs ^13.1.1
  • mxcn ^2.0.0
  • next 14.2.5
  • openai ^4.53.0
  • react ^18
  • react-dom ^18
  • tailwind-merge ^2.4.0
  • tailwindcss-animate ^1.0.7
examples/nodejs/package.json npm
  • baseai ^0.9.42 development
  • tsx ^4.19.0 development
  • @baseai/core ^0.9.42
  • dotenv ^16.4.5
examples/remix/package.json npm
  • @remix-run/dev 2.12.0 development
  • @types/react ^18.2.20 development
  • @types/react-dom ^18.2.7 development
  • @typescript-eslint/eslint-plugin ^6.7.4 development
  • @typescript-eslint/parser ^6.7.4 development
  • @vercel/remix 2.12.0 development
  • autoprefixer ^10.4.20 development
  • baseai ^0.9.42 development
  • eslint ^8.38.0 development
  • eslint-import-resolver-typescript ^3.6.1 development
  • eslint-plugin-import ^2.28.1 development
  • eslint-plugin-jsx-a11y ^6.7.1 development
  • eslint-plugin-react ^7.33.2 development
  • eslint-plugin-react-hooks ^4.6.0 development
  • postcss ^8.4.44 development
  • tailwindcss ^3.4.10 development
  • typescript ^5.1.6 development
  • vite ^5.0.0 development
  • vite-tsconfig-paths ^4.2.1 development
  • @baseai/core ^0.9.42
  • @radix-ui/react-slot ^1.1.0
  • @remix-run/node 2.12.0
  • @remix-run/react 2.12.0
  • @remix-run/serve 2.12.0
  • class-variance-authority ^0.7.0
  • clsx ^2.1.1
  • isbot ^4.1.0
  • mathjs ^13.1.1
  • react ^18.2.0
  • react-dom ^18.2.0
  • tailwind-merge ^2.5.2
  • tailwindcss-animate ^1.0.7
package.json npm
  • @baseai/eslint-config workspace:* development
  • @changesets/cli ^2.27.8 development
  • @types/node ^22.6.1 development
  • eslint ^8.57.0 development
  • husky ^9.1.6 development
  • lint-staged ^15.2.7 development
  • nodemon ^3.1.7 development
  • prettier ^3.3.2 development
  • publint ^0.2.11 development
  • turbo ^2.1.2 development
  • vitest ^1.6.0 development
  • dotenv ^16.4.5
packages/baseai/package.json npm
  • @baseai/eslint-config workspace:* development
  • @baseai/tsconfig workspace:* development
  • @types/node ^22.6.1 development
  • tsup ^8.3.0 development
  • tsx ^4.19.1 development
  • typescript ^5.6.2 development
  • vitest 1.6.0 development
  • @antfu/ni ^0.23.0
  • @clack/core ^0.3.4
  • @clack/prompts ^0.7.0
  • @hono/node-server ^1.13.1
  • @hono/zod-openapi ^0.16.0
  • @sindresorhus/slugify ^2.2.1
  • camelcase ^8.0.0
  • chalk ^5.3.0
  • cli-alerts ^2.0.0
  • cli-handle-error ^4.4.0
  • cli-handle-unhandled ^1.1.1
  • cli-meow-help ^4.0.0
  • cli-table3 ^0.6.5
  • cli-welcome ^3.0.0
  • compute-cosine-similarity ^1.1.0
  • cosmiconfig ^9.0.0
  • cosmiconfig-typescript-loader ^5.0.0
  • dotenv ^16.4.5
  • execa ^9.4.0
  • fast-glob ^3.3.2
  • figures ^6.1.0
  • get-package-json-file ^2.0.0
  • hono ^4.5.11
  • js-tiktoken ^1.0.14
  • log-symbols ^7.0.0
  • lowdb ^7.0.1
  • meow ^13.2.0
  • node-fetch ^3.3.2
  • open ^10.1.0
  • openai ^4.63.0
  • p-map ^7.0.2
  • picocolors ^1.1.0
  • prettier ^3.3.3
  • source-map-support ^0.5.21
  • unpdf ^0.11.0
  • uuid ^10.0.0
  • xlsx ^0.18.5
  • zod ^3.23.8
  • zod-error ^1.5.0
  • zod-validation-error ^3.4.0
packages/core/package.json npm
  • @baseai/eslint-config workspace:* development
  • @baseai/tsconfig workspace:* development
  • @edge-runtime/vm ^4.0.3 development
  • @playwright/test ^1.47.2 development
  • @testing-library/react ^16.0.1 development
  • @types/node ^22.6.1 development
  • @types/react ^18.3.9 development
  • @vitejs/plugin-react ^4.3.1 development
  • eslint ^8.57.0 development
  • eslint-config-prettier ^9.1.0 development
  • eslint-plugin-prettier ^5.2.1 development
  • jsdom ^25.0.1 development
  • react ^18 development
  • tsup ^8.3.0 development
  • typescript ^5.6.2 development
  • vitest 1.6.0 development
  • openai ^4.63.0
  • zod ^3.23.8
pnpm-lock.yaml npm
  • 529 dependencies
tools/eslint-config/package.json npm
  • @next/eslint-plugin-next ^14.1.4 development
  • @typescript-eslint/eslint-plugin ^7.1.0 development
  • @typescript-eslint/parser ^7.1.0 development
  • @vercel/style-guide ^5.2.0 development
  • eslint-config-prettier ^9.1.0 development
  • eslint-config-turbo ^2.0.0 development
  • eslint-plugin-only-warn ^1.1.0 development
  • typescript ^5.3.3 development
tools/tsconfig/package.json npm