| name | ai-integration |
| description | Use when adding LLM features to Phoenix and Elixir apps. Covers shared agent configuration, module naming, structured outputs, and freeform text/code generation. |
AI Integration
Use this folder when adding LLM-backed features to an application.
Rules
- Centralize provider keys and model names in
MyApp.Agents.
- Keep task-specific modules under
MyApp.Agents.* so they are easy to scan in code search and editor symbol lists.
- Use a topic-and-action naming style such as
MyApp.Agents.PostsWritePost.
- Use structured outputs when downstream code expects validated fields.
- Use freeform outputs when downstream code expects prose, code, markdown, or loose JSON.
- Test provider calls and boundary modules with Mimic instead of hitting real services.
- Do not store provider credentials in shared
config/config.exs; keep them in config/dev.exs.
Read Next