Skip to main content
The @mentions feature allows you to include external content in your prompts, similar to Cursor IDE’s mention system.

Quick Start

Mentions Include Files in Prompts

Supported Mentions

File Mention

Include file content in your prompt:
Ranking: After the first few picks, your most-used files float to the top of the @ popup automatically. See Completion Ranking.
What happens:
  1. The file content is read
  2. Content is wrapped in a code block with language detection
  3. Content is prepended to your prompt
Example with multiple files:

Relative and Absolute Paths

Bare @path form

Drop the @file: prefix and write @src/app.py — the file is still inlined, and the same syntax works in praisonai run, YAML prompts, Python, and interactive chat.
The same @src/app.py reference works from the CLI and in YAML:
Bare @path rules:
  • Only inlined when path/to/file is a real file inside the workspace.
  • Path traversal (@../anything) is rejected.
  • @ must start a token — ops@.env is not a reference.
  • Trailing . , ; : ! ? ) ] } " ' are trimmed, so @app.py, still resolves.
  • Unknown tokens like @someuser are left alone in the prompt.

Surface parity

Every prompt surface shares the same MentionsParser, so a @path reference behaves identically whether you type it in praisonai run, a YAML file, Python, or interactive chat. The interactive TUI delegates to the shared parser instead of its own regex, so the surfaces can’t drift.

Doc Mention

Include documentation from .praison/docs/:
Prerequisites:
  • Create docs using praisonai docs create
  • Or add markdown files to .praison/docs/
Example:

Web Mention

Search the web and include results:
What happens:
  1. Web search is performed using DuckDuckGo
  2. Top 3 results are included
  3. Results are prepended to your prompt
Requires duckduckgo-search package: pip install duckduckgo-search

URL Mention

Fetch and include content from a URL:
What happens:
  1. URL content is fetched
  2. HTML is converted to text
  3. Content is truncated if too long (max 10KB)

URL Safety

@url: mentions use the same URL allowlist as spider tools for security. Blocked URLs are rejected before fetching:
When a URL is blocked, the parser returns a placeholder instead of fetching:
See the spider tools documentation for the complete list of blocked URL patterns.

Rule Mention

Include a specific rule from .praison/rules/:

Multiple Mentions

Combine multiple mentions in a single prompt:
Processing order:
  1. All mentions are extracted
  2. Content is fetched for each mention
  3. All content is prepended to the cleaned prompt
  4. Agent processes the combined context

Context Format

When mentions are processed, the context is formatted as:

Doc: coding-standards

Use type hints for all functions. Follow PEP 8 style guide.

Web Search: python best practices

  1. “Python Best Practices” - realpython.com …

Task:

review and improve this code
The bare form works through the same API — same return shape as the prefixed form:

Use Cases

Code Review

Documentation

Learning

Research

Refactoring

File Size Limits

By default, file content is limited to 500,000 characters (~125K tokens), which fits comfortably in modern LLMs like GPT-4o (128K), Claude 3.5 (200K), and Gemini (1M+).

Configuring the Limit

Limit Priority

  1. Constructor parameter - Highest priority
  2. Environment variable (PRAISON_MAX_FILE_CHARS)
  3. Default - 500,000 characters

Truncation Warning

When a file is truncated, a warning is logged:
Token estimation: ~4 characters per token for English/code. Leave room for system prompt and output tokens.

Safety guards

Four guards stop email-like tokens or stray words from accidentally reading files into the prompt context.

Multiline prompts preserve formatting

Mention expansion keeps the prompt’s shape — only the @path token is removed and the file is appended as context. Given:
the newlines, blank lines, and indentation survive after expansion. This fixes the previous behaviour, where any prompt containing a mention was flattened to a single line.

Limitations

Best Practices

Be Specific

Use specific file paths rather than directories

Combine Wisely

Don’t overload with too many mentions - context has limits

Create Docs

Create reusable docs for frequently needed context

Use Rules

Reference rules for consistent coding standards

Troubleshooting

  • Docs - Manage project documentation
  • Rules - Manage project rules
  • CLI Overview - PraisonAI CLI documentation