> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ziet.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Ziet is the first serverless platform for building AI agents. Write Python code, deploy instantly, and scale automatically. No servers, databases, or infrastructure to manage.

## What is Ziet?

Ziet is a **serverless platform** for building and deploying AI agents. Focus on writing Python code while Ziet handles all the infrastructure, scaling, and observability.

<CardGroup cols={2}>
  <Card title="No Infrastructure" icon="server">
    No servers, databases, or DevOps. Just write Python and deploy.
  </Card>

  <Card title="Auto-Scaling" icon="arrows-maximize">
    Scale from zero to millions of requests automatically.
  </Card>

  <Card title="Built-in Integrations" icon="plug">
    Google, OpenAI, Stripe, Twilio, and more—out of the box.
  </Card>

  <Card title="Observable by Default" icon="chart-line">
    Track every action, memory operation, and agent decision.
  </Card>
</CardGroup>

## How It Works

Ziet provides two powerful approaches:

**Agentic Approach**: Build intelligent agents with Actions, Memory, and Strategies\
**Application Approach**: Build serverless APIs with Endpoints and Database

<Tabs>
  <Tab title="Agentic">
    ```python theme={null}
    from ziet import Action, Agent, PickActionsStrategy, HandOffStrategy

    @Action(id="search_flights", name="Search Flights", description="Search for flights")
    def search_flights(origin: str, dest: str) -> list:
        # Your code here
        return results

    @PickActionsStrategy(picks=2, allow_repeats=False)
    @HandOffStrategy(agents=["review_agent"])
    @Agent(
        id="search_agent",
        name="FlightSearcher",
        description="Search and analyze flight options",
        instructions="""
        Search for flights using multiple sources, analyze options,
        and hand off to review agent for final recommendation.
        """,
        actions=["search_flights", "compare_prices", "check_availability"]
    )
    class FlightSearchAgent:
        pass  # Agent behavior is defined by instructions and strategies
    ```

    Deploy and invoke:

    ```bash theme={null}
    ziet deploy

    curl -X POST https://api.ziet.ai/agents/search_agent/run \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{"origin": "SFO", "dest": "NYC"}'
    ```
  </Tab>

  <Tab title="Application">
    ```python theme={null}
    from ziet import Endpoint, db

    @Endpoint(
        id="get_flights",
        method="GET",
        path="/flights"
    )
    def get_flights(origin: str, dest: str) -> dict:
        """Fetch flights from database."""
        flights = db.query("flights") \
            .where("origin", origin) \
            .where("dest", dest) \
            .all()
        
        return {
            "status": 200,
            "body": {"flights": flights}
        }

    @Endpoint(
        id="create_booking",
        method="POST",
        path="/bookings"
    )
    def create_booking(flight_id: str, user_id: str) -> dict:
        """Create booking in database."""
        booking_id = db.insert("bookings", {
            "flight_id": flight_id,
            "user_id": user_id,
            "status": "confirmed"
        })
        
        return {
            "status": 201,
            "body": {"booking_id": booking_id}
        }
    ```

    Deploy and invoke:

    ```bash theme={null}
    ziet deploy

    curl https://api.ziet.ai/flights?origin=SFO&dest=NYC

    curl -X POST https://api.ziet.ai/bookings \
      -d '{"flight_id": "f123", "user_id": "u456"}'
    ```
  </Tab>
</Tabs>

## Why Ziet?

<AccordionGroup>
  <Accordion title="Traditional Approach" icon="x">
    * Set up servers (EC2, ECS, Kubernetes)
    * Configure databases (Postgres, Redis, Vector DB)
    * Implement auth, rate limiting, monitoring
    * Write boilerplate for retries, timeouts, queues
    * Manage deployments, scaling, and infrastructure

    **Result**: Weeks of work before writing agent logic.
  </Accordion>

  <Accordion title="With Ziet" icon="check">
    * Write Python functions with `@Action` decorator
    * Define agents with `@Agent` decorator
    * Run `ziet deploy`

    **Result**: Production-ready agents in minutes.
  </Accordion>
</AccordionGroup>

## Get Started

<Steps>
  <Step title="Install Ziet">
    ```bash theme={null}
    pip install ziet
    ```
  </Step>

  <Step title="Write Your First Agent">
    Follow our [quickstart guide](/quickstart) to build a complete agent in 5 minutes.
  </Step>

  <Step title="Deploy">
    ```bash theme={null}
    ziet deploy
    ```
  </Step>
</Steps>

## Key Features

### Actions

Serverless functions with built-in retries, timeouts, and error handling.

```python theme={null}
@Action(timeout=30, retries=3)
def process_data(data: dict) -> dict:
    return transformed_data
```

[Learn more about Actions →](/core/actions)

### Agents

Autonomous agents that orchestrate multiple actions to complete complex tasks.

```python theme={null}
@PickActionsStrategy(picks=3, allow_repeats=False)
@HandOffStrategy(agents=["summarizer_agent"])
@Agent(
    id="researcher_agent",
    name="ResearchAgent",
    description="Research topics and gather information",
    instructions="""
    Research the given topic by searching multiple sources,
    picking the best 3 search actions, and gathering comprehensive data.
    Hand off to summarizer agent when complete.
    """,
    actions=["search_google", "scrape_websites", "search_news"],
    model="gpt-4o"
)
class ResearchAgent:
    pass  # Agent behavior is defined by instructions and strategies
```

[Learn more about Agents →](/core/agents)

### Memory

Built-in key-value and semantic search for agent state.

```python theme={null}
from ziet import memory

memory.add(key="best_option", value={"price": 350})
best = memory.get("best_option")
results = memory.search("cheapest flights")
```

[Learn more about Memory →](/core/memory)

### Endpoints

Serverless API endpoints—like AWS Lambda, but simpler.

```python theme={null}
@Endpoint(method="GET", path="/users/{user_id}")
def get_user(user_id: str) -> dict:
    user = db.query("users").where("id", user_id).first()
    return {"status": 200, "body": user}
```

[Learn more about Endpoints →](/application/endpoints)

### Database

Persistent storage across all runs, agents, and endpoints.

```python theme={null}
from ziet import db

# Store data permanently
user_id = db.insert("users", {"email": "alice@example.com"})

# Query anywhere
user = db.query("users").where("id", user_id).first()
```

[Learn more about Database →](/application/database)

### Integrations

Pre-built integrations with popular services.

```python theme={null}
from ziet.integrations import google, openai, stripe

results = google.search("best restaurants SF")
response = openai.chat([{"role": "user", "content": "Summarize"}])
payment = stripe.create_payment_intent(amount=5000)
```

[View all integrations →](/integrations/overview)

## Next Steps

<CardGroup cols={4}>
  <Card title="Actions" icon="bolt" href="/core/actions">
    Serverless actions
  </Card>

  <Card title="Agents" icon="robot" href="/core/agents">
    Intelligent agents
  </Card>

  <Card title="Memory" icon="memory" href="/core/memory">
    Temporary storage
  </Card>

  <Card title="Strategies" icon="chess" href="/agentic/strategies">
    Agent orchestration
  </Card>

  <Card title="Endpoints" icon="globe" href="/application/endpoints">
    REST API endpoints
  </Card>

  <Card title="Database" icon="database" href="/application/database">
    Persistent storage
  </Card>

  <Card title="Integrations" icon="plug" href="/integrations/overview">
    Built-in integrations
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    API documentation
  </Card>
</CardGroup>
