> ## Documentation Index
> Fetch the complete documentation index at: https://arka-agent-mintlify-f21cea86.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompt optimization

> Prompts को अधिक स्पष्ट बनाएँ, LLM calls से पहले verbose input को compact करें, और उपयोगकर्ता के सटीक इरादे को संरक्षित करें।

```bash theme={null}
arka prompt_optimize "summarize this research paper" --rounds 3 --role "research assistant"
arka "optimize this prompt: explain the experiment and cite assumptions"
```

Arka bounded refinement passes लागू करता है जो objectives, constraints,
missing-information व्यवहार, verification, और output structure को स्पष्ट करते हैं।
यह एक मौलिक कार्यान्वयन है, जो
[Prompt Optimizer](https://github.com/linshenkx/prompt-optimizer) द्वारा वर्णित
evaluation-oriented workflow से प्रेरित है, जिसका repository AGPL-3.0-only
licensed है। कोई source code copy या bundle नहीं किया गया है।

## Compact intermediate form

Verbose natural-language inputs के लिए, Arka LLM को भेजने से पहले आपके
text को एक compact intermediate representation में भी बदल देता है। मूल text अब भी
symbolic routing, security checks, exact-command detection, और audit metadata के
लिए उपयोग होता है।

Compact form रखता है:

* high-signal आवश्यकताएँ
* थोड़ा-सा context
* literal URLs, file paths, code blocks, JSON, और shell commands
* anti-hallucination constraints

यह हटाता या compress करता है:

* दोहराए गए वाक्य
* low-signal filler
* अतिरिक्त whitespace

Configuration:

```env theme={null}
ARKA_PROMPT_OPTIMIZE=1
ARKA_PROMPT_COMPACT=1
ARKA_PROMPT_COMPACT_MIN_CHARS=900
ARKA_PROMPT_COMPACT_MAX_ITEMS=24
```

जब सटीक शब्दों को मॉडल तक पहुँचाना ज़रूरी हो तो opt out करें:

```bash theme={null}
ARKA_PROMPT_COMPACT=0 arka ask "..."
arka llm complete --system "You are Arka" --user "..." --no-compact
```

Routing prompts और पहले से compact `Task IR:` prompts के लिए compaction skip किया
जाता है ताकि recursive rewriting से बचा जा सके।


## Related topics

- [Workflow templates](/hi/guides/workflow-templates.md)
- [Research optimization](/hi/guides/optimization.md)
- [Local model optimization और setup](/hi/guides/local-models.md)
- [AI agent guide — MCP पर Arka उपयोग करें](/hi/guides/ai-agents.md)
- [Project structure improvement prompt](/hi/guides/project-structure-prompt.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.