|
| 1 | +--- |
| 2 | +title: Building with AI |
| 3 | +description: Use Stellar documentation with AI assistants and Large Language Models |
| 4 | +sidebar_label: Building with AI |
| 5 | +sidebar_position: 118 |
| 6 | +--- |
| 7 | + |
| 8 | +# Building with AI |
| 9 | + |
| 10 | +Stellar provides resources to help AI assistants and Large Language Models (LLMs) understand our documentation, making it easier for you to get accurate answers about Stellar development. |
| 11 | + |
| 12 | +## Using llms.txt |
| 13 | + |
| 14 | +[`llms.txt`](https://developers.stellar.org/llms.txt) is a standardized way to provide documentation context to AI systems. This file contains a structured overview of Stellar's developer documentation optimized for LLM consumption. |
| 15 | + |
| 16 | +When you ask an AI assistant about Stellar, it can reference this file to: |
| 17 | + |
| 18 | +- Understand the structure of our documentation |
| 19 | +- Find relevant pages for your questions |
| 20 | +- Provide more accurate, up-to-date answers |
| 21 | + |
| 22 | +## Using with AI assistants |
| 23 | + |
| 24 | +### ChatGPT, Claude, and other LLMs |
| 25 | + |
| 26 | +You can paste the contents of `llms.txt` into your conversation to give the AI context about Stellar: |
| 27 | + |
| 28 | +``` |
| 29 | +Please read this documentation overview and help me with Stellar development: |
| 30 | +[paste contents of https://developers.stellar.org/llms.txt] |
| 31 | +``` |
| 32 | + |
| 33 | +### AI-powered coding assistants |
| 34 | + |
| 35 | +Tools like GitHub Copilot, Cursor, Claude or Gemini can benefit from having `llms.txt` in your project context when working on Stellar-related code. |
| 36 | + |
| 37 | +#### Cursor |
| 38 | + |
| 39 | +You can provide Cursor with Stellar development context in two ways: |
| 40 | + |
| 41 | +**Option 1: Using Cursor Settings** |
| 42 | + |
| 43 | +1. Open **Cursor Settings** (the gear icon in the sidebar) |
| 44 | +2. Navigate to **Rules** (under the **Features** section) |
| 45 | +3. Click **Add Rule** |
| 46 | +4. Add your Stellar development guidelines and save |
| 47 | + |
| 48 | +**Option 2: Using a `.cursorrules` file** |
| 49 | + |
| 50 | +Create a `.cursorrules` file in your project root: |
| 51 | + |
| 52 | +```text title=".cursorrules" |
| 53 | +When developing on Stellar, refer to the official documentation at https://developers.stellar.org |
| 54 | +
|
| 55 | +For comprehensive documentation context, fetch and reference: https://developers.stellar.org/llms.txt |
| 56 | +
|
| 57 | +Key resources: |
| 58 | +- Smart Contracts: https://developers.stellar.org/docs/build/smart-contracts |
| 59 | +- Stellar CLI: https://developers.stellar.org/docs/tools/cli |
| 60 | +- SDKs: https://developers.stellar.org/docs/tools/sdks |
| 61 | +``` |
| 62 | + |
| 63 | +The Settings approach applies rules globally across all projects, while `.cursorrules` files are project-specific. |
| 64 | + |
| 65 | +#### ChatGPT |
| 66 | + |
| 67 | +ChatGPT offers two ways to provide persistent context: |
| 68 | + |
| 69 | +- **Custom Instructions**: Go to Settings → Personalization → Custom Instructions to add information about yourself and how you'd like ChatGPT to respond. You can include that you're a Stellar developer and prefer references to official documentation. |
| 70 | + |
| 71 | +- **Custom GPTs**: Create a custom GPT with Stellar documentation context built in. You can configure it to reference `llms.txt` and provide specialized Stellar development assistance. |
| 72 | + |
| 73 | +#### Claude |
| 74 | + |
| 75 | +Claude provides context customization through: |
| 76 | + |
| 77 | +- **Projects**: Create a project and add custom instructions along with knowledge files. You can upload relevant documentation or add instructions to always reference the Stellar docs. |
| 78 | + |
| 79 | +- **Memory**: Claude can remember details from past conversations. You can ask Claude to remember that you're working on Stellar development, and it will retain this context across sessions. |
| 80 | + |
| 81 | +#### Gemini |
| 82 | + |
| 83 | +Google's Gemini offers context customization through: |
| 84 | + |
| 85 | +- **Gems**: Create custom Gems (specialized AI assistants) with specific instructions for Stellar development. Go to the Gems section in Gemini and create a new Gem with your Stellar context and guidelines. |
| 86 | + |
| 87 | +- **Saved Info**: In Gemini settings, you can add saved information about yourself, including that you're a Stellar developer, which Gemini will reference in future conversations. |
| 88 | + |
| 89 | +### Custom AI applications |
| 90 | + |
| 91 | +If you're building an AI application that answers questions about Stellar, you can fetch and include `llms.txt` in your prompt context: |
| 92 | + |
| 93 | +```javascript |
| 94 | +const response = await fetch("https://developers.stellar.org/llms.txt"); |
| 95 | +const stellarContext = await response.text(); |
| 96 | + |
| 97 | +// Include stellarContext in your LLM prompt |
| 98 | +``` |
| 99 | + |
| 100 | +## Stella: Your Stellar AI Assistant |
| 101 | + |
| 102 | +In addition to `llms.txt`, Stellar provides [Stella](https://developers.stellar.org/docs/tools/developer-tools/ai-bot), an AI assistant specifically trained on Stellar documentation, code examples, and community knowledge. |
| 103 | + |
| 104 | +Stella can help you with: |
| 105 | + |
| 106 | +- Smart contract development questions |
| 107 | +- Understanding Stellar concepts |
| 108 | +- Debugging and troubleshooting |
| 109 | +- Finding relevant documentation |
| 110 | + |
| 111 | +You can chat with Stella right here by clicking the yellow icon at the bottom of this page, or join the `#stella-help` channel in the [Stellar Developer Discord](https://discord.gg/stellardev). |
| 112 | + |
| 113 | +## Additional resources |
| 114 | + |
| 115 | +- [Stella AI Bot](https://developers.stellar.org/docs/tools/developer-tools/ai-bot) - Stellar's built-in AI assistant |
| 116 | +- [Stellar Developer Discord](https://discord.gg/stellardev) - Ask questions in #stella-help |
0 commit comments