> For the complete documentation index, see [llms.txt](https://docs.zerve.ai/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zerve.ai/guide/notebook-view/ai-agent/code.md).

# Code

Zerve's AI agent is aware of the context and working of the canvas, this enables it to work more efficiently and create better results.&#x20;

While coding the agent can create add run blocks, add requirements and edges.&#x20;

Before starting a coding process, the agent will present you with Milestone, Summary, Required Inputs, Anticipated Future Milestones and Tickets. Post this you can accept this plan or ask the agent to make changes. Once you are satisfied with the plan you can ask the agent to proceed. Each ticket that can be run in parallel will be assigned to a coding agent. If it faces an error, it will work on fixing it. The video below shows an example of how the agent can help with coding.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIQKNeqjEeOp9UwUcB9R9%2Fuploads%2FtenjX7TPIspqsNROdHy4%2FScreen%20Recording%202025-11-27%20at%209.34.16%E2%80%AFPM.mp4?alt=media&token=a2f68feb-aa66-4f8d-ade1-c5830c512db0>" %}

The agent can help with debugging existing code as well. You can click on **Open Error Assist**. The video below shows an example process.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIQKNeqjEeOp9UwUcB9R9%2Fuploads%2FuOw5lpclpNXdp3dK4012%2FScreen%20Recording%202025-11-27%20at%209.44.03%E2%80%AFPM.mp4?alt=media&token=30de1e0a-292d-4b7c-b5cf-6243b976ad92>" %}

### AI Agent Capabilities

The AI Agent in Zerve is designed to support you throughout your development journey with a broad range of powerful features:

* **Code Generation:** Automatically generates clean, modular, and production-ready code snippets for Python, SQL, R, and more, tailored to your project context.
* **Workflow Design:** Helps you create, edit, and optimize data and AI workflows visually on the Zerve canvas, promoting best practices like modularity and parallel execution.
* **Data Integration Assistance:** Advises on how to connect and query various data sources like Snowflake, Redshift, PostgreSQL, and others within your workflows.
* **Generative AI Support:** Implements GenAI prompts for summarization, extraction, and text generation tasks seamlessly integrated into workflows.
* **Debugging & Optimization:** Suggests improvements, identifies potential errors, and helps you refactor code for better scalability and resilience.
* **Context Awareness:** Understands your canvas context, including layers, blocks, and existing variables, to provide relevant and non-conflicting suggestions.
* **Parallel Execution Guidance:** Helps you leverage Zerve’s fleet capabilities to run tasks in parallel and aggregate results efficiently.
* **API & Deployment Support:** Guides you through creating API endpoints, SageMaker deployments, and managing compute environments.

With these capabilities, the AI Agent enhances your productivity, reduces manual effort, and ensures you build high-quality AI and data solutions on Zerve with ease.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zerve.ai/guide/notebook-view/ai-agent/code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
