# Genkit

> Genkit is Google's open-source framework for building AI-powered apps and agents in TypeScript, Go, Python, and Dart. Use Gemini, Claude, OpenAI, and more.

Genkit is an open-source AI SDK and toolkit for building full-stack agentic experiences for any platform. Available in TypeScript, Go, Dart, and Python

Example: a ticketing app built with Genkit. Someone asks for two seats at Saturday's show. The app calls your findSeats tool, answers with a seat map and seat options they can tap instead of text (GenUI), and buys the seats they pick with your buyTickets tool.

- Website: https://genkit.dev
- Documentation: https://genkit.dev/docs/get-started
- Source code (Apache 2.0): https://github.com/genkit-ai/genkit
- Full documentation for LLMs: https://genkit.dev/llms.txt

## Get started

Install the SDK for your language, then follow its quickstart.

| Language | Status | Install | Quickstart |
| --- | --- | --- | --- |
| TypeScript | Generally available | `npm i genkit @genkit-ai/google-genai` | https://genkit.dev/docs/js/get-started/ |
| Go | Generally available | `go get github.com/firebase/genkit/go` | https://genkit.dev/docs/go/get-started/ |
| Python | Preview | `pip install genkit genkit-google-genai` | https://genkit.dev/docs/python/get-started/ |
| Dart | Preview | `dart pub add genkit genkit_google_genai` | https://genkit.dev/docs/dart/get-started/ |

### Agent skills

Genkit agent skills teach Antigravity, Claude Code, Cursor, and other coding agents to build with Genkit.

```sh
npx skills add genkit-ai/skills
```

More: [Set up agent skills](https://genkit.dev/docs/develop-with-ai)

## What will you build?

### Chat assistants

Support, shopping, and in-app help that answers in real time.

Example: A chat assistant recommends the right pricing plan for a team of five.

Learn more: [Agents and chat](https://genkit.dev/docs/agents/overview), [Streaming](https://genkit.dev/docs/flows#streaming-flows)

### Documents into data

Turn receipts, invoices, and PDFs into clean, structured data.

Example: A photo of a café receipt becomes structured fields for merchant, date, total, and category.

Learn more: [Structured output](https://genkit.dev/docs/models#structured-output), [Multimodal input](https://genkit.dev/docs/models#multimodal-input)

### Answers from your content

Ask your docs, help center, or files. Get answers with sources.

Example: An assistant answers a vacation policy question and cites the employee handbook.

Learn more: [Retrieval (RAG)](https://genkit.dev/docs/rag), [MCP](https://genkit.dev/docs/model-context-protocol)

### Images and media

Generate product shots, art, and marketing copy from a prompt.

Example: One text prompt generates product photos of a speckled mug in three glazes.

Learn more: [Image generation](https://genkit.dev/docs/models#generating-media), [Prompt templates](https://genkit.dev/docs/dotprompt)

### Agents that take action

Look things up, call your APIs, and ask a person before anything important.

Example: An agent looks up an order, checks the refund policy, and waits for a person to approve the refund.

Learn more: [Tool calling](https://genkit.dev/docs/tool-calling), [Human approval](https://genkit.dev/docs/agents/interrupts)

### GenUI

Answer with charts, forms, and buttons people can tap, not walls of text.

Example: Asked how the quarter went, an assistant answers with an interactive revenue chart instead of a paragraph.

Learn more: [GenUI (A2UI)](https://genkit.dev/docs/agents/a2ui), [Client SDKs](https://genkit.dev/docs/client)

Live demos: https://examples.genkit.dev/

## Any model. Your language. Every step visible.

Genkit connects your app to AI models, calls your code, and shows every step to you and to your coding agent.

1. **Build it with your coding agent.** Genkit gives coding agents guardrails, not guesswork. Agent skills teach Antigravity, Claude Code, and Cursor today's Genkit APIs. The Genkit MCP server lets them run your flows and read the traces, so they check their own work before you review it. [Set up agent skills](https://genkit.dev/docs/develop-with-ai), [Connect the MCP server](https://genkit.dev/docs/mcp-server)
2. **Pick any model.** Gemini, Claude, OpenAI, open models with Ollama, and more. Switching is one line. [Browse model providers](https://genkit.dev/docs/integrations/model-providers)
3. **Build in your language.** Official SDKs for TypeScript, Go, Python, and Dart, built on the same concepts. [Choose your SDK](https://genkit.dev/docs/get-started)
4. **Test it, then ship it.** See every prompt, tool call, and response in the local Developer UI. Then deploy to Cloud Run, Firebase, or anywhere your code runs. [Explore the Developer UI](https://genkit.dev/docs/devtools), [Deploy your app](https://genkit.dev/docs/deployment/overview)

## Example

Give a model a tool that calls your code, so it can answer with live data. The same app in each SDK:

### TypeScript (`index.ts`)

```ts
import { genkit, z } from 'genkit';
import { googleAI } from '@genkit-ai/google-genai';

const ai = genkit({ plugins: [googleAI()] });

// Give the model a tool that calls your code
const lookupOrder = ai.defineTool({
  name: 'lookupOrder',
  description: 'Get the shipping status of an order',
  inputSchema: z.object({ orderId: z.string() }),
}, async ({ orderId }) => getOrderStatus(orderId));

const { text } = await ai.generate({
  model: googleAI.model('gemini-flash-latest'),
  prompt: "Where's my order #1042?",
  tools: [lookupOrder],
});
```

### Go (`main.go`)

```go
g := genkit.Init(ctx,
	genkit.WithPlugins(&googlegenai.GoogleAI{}),
)

type OrderInput struct {
	OrderID string `json:"orderId"`
}

// Give the model a tool that calls your code
lookupOrder := genkit.DefineTool(g, "lookupOrder",
	"Get the shipping status of an order",
	func(ctx *ai.ToolContext, in OrderInput) (string, error) {
		return getOrderStatus(in.OrderID)
	})

resp, err := genkit.Generate(ctx, g,
	ai.WithModelName("googleai/gemini-flash-latest"),
	ai.WithPrompt("Where's my order #1042?"),
	ai.WithTools(lookupOrder),
)
```

### Python (`main.py`)

```python
from genkit import Genkit
from genkit_google_genai import GoogleAI
from pydantic import BaseModel

ai = Genkit(plugins=[GoogleAI()])

class OrderInput(BaseModel):
    order_id: str

# Give the model a tool that calls your code
@ai.tool()
async def lookup_order(input: OrderInput) -> str:
    """Get the shipping status of an order."""
    return await get_order_status(input.order_id)

response = await ai.generate(
    model='googleai/gemini-flash-latest',
    prompt="Where's my order #1042?",
    tools=[lookup_order],
)
```

### Dart (`main.dart`)

```dart
@Schema()
abstract class $OrderInput {
  String get orderId;
}

final ai = Genkit(plugins: [googleAI()]);

// Give the model a tool that calls your code
final lookupOrder = ai.defineTool(
  name: 'lookupOrder',
  description: 'Get the shipping status of an order',
  inputSchema: OrderInput.$schema,
  fn: (input, _) async => getOrderStatus(input.orderId),
);

final response = await ai.generate(
  model: googleAI.gemini('gemini-flash-latest'),
  prompt: "Where's my order #1042?",
  tools: [lookupOrder],
);
```

## Frequently asked questions

### What is Genkit?

Genkit is an open-source framework from Google for building AI features into apps. It gives you one consistent way to call AI models, connect them to your data and code, and test and deploy the results, in TypeScript, Go, Python, or Dart.

### Do I need to be an AI expert to use Genkit?

No. If you can build an app, you can build with Genkit. Common features like chat, structured data, and answers from your content take a few lines of code. You can also install Genkit skills so AI coding assistants like Antigravity, Claude Code, and Cursor can write Genkit code for you. [Build with AI coding assistants](https://genkit.dev/docs/develop-with-ai)

### How is Genkit different from calling a model's API directly?

A model API sends a prompt and returns a response. Genkit adds what real apps need on top: one API across model providers, structured output, tool calling, retrieval, streaming, agents, and a local Developer UI that traces every step. You can switch models without rewriting your app.

### Which AI models does Genkit support?

Gemini (through the Gemini API or Gemini Enterprise), Anthropic Claude, OpenAI, xAI Grok, DeepSeek, models hosted on AWS Bedrock and Azure AI Foundry, open models like Gemma and Llama through Ollama, and any OpenAI-compatible API. [See all model providers](https://genkit.dev/docs/integrations/model-providers)

### Which programming languages can I use?

Genkit has official SDKs for TypeScript and JavaScript, Go, Python, and Dart. [Get started in your language](https://genkit.dev/docs/get-started)

### Is Genkit free?

Yes. Genkit is free and open source under the Apache 2.0 license. You only pay for the models and hosting you choose to use. [View the source on GitHub](https://github.com/genkit-ai/genkit)

### Where can I deploy Genkit apps?

Anywhere your code runs. The docs include guides for Cloud Run, Firebase, AWS Lambda, and Azure Functions, and you can run Genkit on any server that supports your language. [Read the deployment guides](https://genkit.dev/docs/deployment/overview)

## Resources for AI agents

- [llms.txt](https://genkit.dev/llms.txt): index of the complete documentation, per language
- [GENKIT.js.md](https://genkit.dev/GENKIT.js.md): rules and examples for building with Genkit in TypeScript and JavaScript
- [GENKIT.go.md](https://genkit.dev/GENKIT.go.md): rules and examples for building with Genkit in Go
- Every documentation page is also available as markdown: append `.md` to its URL.

## Community

- [Star on GitHub](https://github.com/genkit-ai/genkit)
- [Chat on Discord](https://discord.gg/qXt5zzQKpc)
- [Try live demos](https://examples.genkit.dev/)
- [Read the blog](https://genkit.dev/blog)
