# Using AI agents for SEO/GEO/AEO optimization of the knowledge base
Starting from v6.1.0, you can create an AI agent with the **SEO/GEO/AEO optimization** competency in Swarmica. The agent automatically fills in the SEO fields and JSON-LD markup of published articles so that search engines and AI services find and rank the knowledge base correctly.

## What the AI agent does

The agent works with published articles. For each language of an article that has a title and text, it fills in the empty fields:

*   `seo_title` — the title for search results and previews;
*   `seo_description` — a description of up to 160 characters;
*   `seo_url` — the relative address of the article;
*   `seo_image` — the first image uploaded to the article (if there is one);
*   `seo_keywords` — 3 to 7 keywords;
*   `seo_type` — `article`;
*   `seo_locale` — for example, `ru_RU`, `en_US`;
*   `jsonld` — Schema.org markup of the `TechArticle` type.

The agent follows these rules:

*   it does not change the article title or text;
*   it does not overwrite fields that are already filled in — an employee may have filled them;
*   it does not use the internal part of the article;
*   it does not fill in the `html_head` field;
*   it relies only on the article content and does not add facts of its own.

All SEO fields are described in [Configuring article SEO fields](https://support.swarmica.com/article/en/2146).

## Requirements

1.  Swarmica v6.1.0 or higher.
2.  The `__ai_mcp_agents` feature flag is enabled — see [Feature flags FEATURES](https://support.swarmica.com/article/en/596).
3.  An AI provider that supports AI agents is connected: [YandexGPT](https://support.swarmica.com/article/en/1675) or [ChatGPT](https://support.swarmica.com/article/en/1676). See the current list in [The capabilities of various LLM AI providers in Swarmica](https://support.swarmica.com/article/en/1615).
4.  The MCP service is running — see [Connecting Swarmica functions to LLMs via MCP](https://support.swarmica.com/article/en/1664).
5.  Administrator rights.

## Creating an AI agent

1.  Go to **Settings → AI functions → AI agents** and click **Create**.
2.  Select the **SEO/GEO/AEO optimization** competency.
3.  Enter the agent name — it will be displayed in the interface.
4.  Save the agent.

The agent user and the required access are created automatically.

## Automatic runs

Once a day, Swarmica automatically runs the agent for published articles that have at least one empty field among `seo_title`, `seo_description`, `seo_url`, `seo_keywords`, `seo_type`, `seo_locale` and `jsonld`. Once the fields are filled in, the article no longer gets into the agent queue.

:::tip
Every agent run consumes AI provider tokens. If the knowledge base has many articles without SEO fields, the initial processing will take several days.
:::

## Running the agent manually for a specific article

1.  Go to **Settings → AI functions → AI agents** and open the agent.
2.  Enter a task, for example: `Optimize article 1234`.
3.  Click **Run**.

The progress and status of the run are displayed on the agent page in real time.

## Checking the result

*   Open the **SEO** tab of the article and make sure the fields are filled in correctly. Any field can be edited manually — the agent will not overwrite it.
*   Check the JSON-LD markup with the validation tools — see [Configuring Schema.org markup in articles](https://support.swarmica.com/article/en/2147).
*   During [content quality checks](https://support.swarmica.com/article/en/214) (AQI), it is recommended to pay attention to whether the SEO fields are filled in and correct.

## Related articles

*   [Configuring article SEO fields (Open Graph, JSON-LD)](https://support.swarmica.com/article/en/2146)
*   [Configuring Schema.org markup in articles (JSON-LD, microdata)](https://support.swarmica.com/article/en/2147)
*   [sitemap.xml and robots.txt for the public knowledge base](https://support.swarmica.com/article/en/2149)
*   [Enabling indexing of the public knowledge base portal for LLM (llms.txt)](https://support.swarmica.com/article/en/1483)