How to Create an App in Lega
As a Creator, you have the ability to create an app to use yourself or share with others. There are several ways to create an app. The following is meant to serve as a guide in your app-building journey.
Use the Lega Lab đź§Ş
Easily create an app from scratch, use a template or Ask Lega for help! You submit prompts, gauge responses, and edit your settings accordingly right from within the app creation experience. Share the final app with individual users or groups in the upper right hand corner.
1) Ask Lega
Not sure where to begin? Tell Ask Lega what kind of app you want to create, and it will suggest a system prompt and parameters (optionally) as a starting point.
2) Use a template
Not sure where to start? Peruse our catalog of apps for inspiration and launch one you like!
3) Build from scratch
Go to the Lega Lab and choose Build from scratch from the tile on the right side of the page.
General:
- First you'll give your new app a name and description. This is what appears to the end user in the app's tile in the App Library, so be sure to be clear about what the app is/does.
- Next you can optionally toggle these features on or off to enable them for users within an app. When a feature is enabled, it's highlighted blue.
- Document Upload - Allows used to upload documents for use within an app.
- Voice Input - Allows users to interact with apps using their device's microphone.
- Web Access - Allows the app to use web scraping to retrieve content from specific websites or pages. It does not use search but instead leverages existing web parsing capabilities. No data is shared outside of Lega with this functionality.
- Allow Users to Change Model - When enabled, users can change the AI model used by the app during their conversation, allowing them to choose the best model for their specific needs. In order to choose a particular model, users must have had that model shared with them. This can only be done by an Admin under Admin Center > Models.
- Allow Users to Add Tools - When enabled, users can connect additional tools to this app during their conversation, extending its capabilities with new functions and integrations. Similar to to models, in order to select a particular tool, users must have had that tool shared with them. This can only be done by an Admin under Resource Library > Tools.
- Allow Users to Add Knowledge Sources - When enabled, users can add their own knowledge sources to this app during conversation, providing additional context and information for more relevant responses. Just like tools and models, in order to select add a particular knowledge source, users must have had that source shared with them. This can only be done by an Admin under Resource Library > Knowledge.
- NOTE: If you allow a user to change/add models, tools, and/or knowledge sources, the User's edits are transient and will apply only to that user conversation at that time. The changes will not affect the parent app.
- Model : First choose your model from those available in the dropdown menu. See more information on model choices under Models in your Resource Library. Next use the sliding bars to optionally change the model's related settings, e.g. Temperature, Max Tokens, and Top P.
- Temperature - controls predictability vs. creativity
- What it does: Adjusts how “creative” the AI is when generating responses. A low temperature means the LLM sticks closely to the most likely legal language and established precedents, while a high temperature allows for more variation and speculative reasoning.
- When to use:
- Low (0 - 0.2): For highly precise, fact-based legal documents, contract analysis, or when citing laws/cases.
- Medium (0.3 - 0.5): When drafting policy summaries, legal memos, or explaining legal concepts in plain language.
- High (0.6 - 1.0): For brainstorming legal arguments, generating alternative contract clauses, or exploring hypothetical scenarios.
- Use Case Examples:
- Drafting a contract? → Keep temperature low for accuracy.
- Exploring different negotiation strategies? → Increase temperature slightly to generate more varied suggestions.
- Max Tokens - controls response length
- What it does: Sets a limit on how long the LLM's response will be. Since legal language is often precise and verbose, selecting the right token limit ensures completeness without unnecessary fluff.
- When to use:
- Low (50 - 150): For quick legal definitions, contract clause suggestions, or short email responses.
- Medium (150 - 500): For memo summaries, case law explanations, or contract reviews.
- High (500+): For full legal document drafts or comprehensive legal document reviews.
- Use Case Examples:
- Need a concise summary of a Supreme Court ruling? → Medium max tokens (200-300).
- Want a full first draft of a contract? → High max tokens (750+)
- Just need a quick clause rewrite? → Low max tokens (100-150)
- Tip: If an answer gets cut off mid-sentence, increase the max tokens
- Top P - controls diversity of word choices (also called nucleus sampling)
- What it does: Limits how much randomness is introduced into the response. A low Top P keeps responses focused on the most likely (and legally sound) language, while a higher Top P introduces more varied word choices and alternative phrasings.
- When to use:
- Low (0.1 - 0.3): For strict legal compliance, court document drafts, contract clauses, and citations.
- Medium (0.4 - 0.7): For policy interpretation, legal education materials, or memo drafting.
- High (0.8 - 1.0): For brainstorming legal strategies, alternative arguments, or exploring new legal frameworks.
- Use Case Examples:
- Need a precise NDA clause? → Low Top P (0.2-0.3) to ensure standard legal phrasing
- Drafting a legal memo on regulatory trends? → Medium Top P (0.5-0.7) for a balance of structured reasoning and slight variation
- Brainstorming creative solutions for a client? → Higher Top P (0.8-1.0) to generate different approaches
- Prompts:
- System Prompt - Optionally provide the model with additional instructions. This should be the general, overarching instruction you want to give the model
- User Instructions - Provide a user with directions on how to use an app, which will appear as a chat bubble when the user first opens an app.
- Initial Prompt - Initial prompt to be submitted to the model, e.g. summarize this document. This can be as simple or complex as you like, and is editable by the app user. It can be a simple instruction to minimize the prompting by the user, e.g. "Please summarize the document attached," or a more complex instruction that initiates field to populate by the user through parameters.
- Parameters are placeholders in prompts that let you customize responses by inserting specific details when the prompt is used. For example, a parameter like
{{name}}can be replaced with a user's name, making the app’s answers more tailored and dynamic. This helps create flexible prompts that adapt to different situations without needing to rewrite them each time. - To include parameters in your initial prompt, simply put the name of the parameter in double squiggle brackets {{ }}. You can use as many parameters in a prompt as needed. For example, if you want to add a parameter to the example prompt above, you might say: Please summarize this {{document}} into 3-5 sentences. Then click on the pencil to open the Prompt Editor to further define the parameter type. You can even Ask Lega for prompting and parameter help. In the Prompt Editor you can give your parameter a:
- Name: This is what will appear above the field for the user to complete and is often the same as Name or something similar (e.g. First Name for first_name).
- Type: This defines the parameter input. You can choose from string (short text), long text, number, date, choice (multiple options), document (attachment), and URL.
- Expand More Settings to optionally add:
- Default value: Use this if you want the same parameter to be used by every user of the app, e.g. you want all users of a memo creating app to list today's date at the top.
- Instructions: This will explain what should be entered by the user (e.g. Upload the document you want to be summarized).
- Required: By checking this box, the user is required to complete the parameter field before sending the prompt to the model.
- Display to user: Choose whether this parameter should be visible to the end user or hidden to run silently in the background. For example, if you’re using a date parameter that never changes, you might hide it to keep the chat experience simple and free of unnecessary details.
- You can also use a saved or shared prompt as your initial prompt by selecting one from Prompt Library at the top of your Prompt Editor popup. Learn more about saved prompts here.
- Parameters are placeholders in prompts that let you customize responses by inserting specific details when the prompt is used. For example, a parameter like
- Knowledge: Connect existing knowledge sources to provide context to your app. Add a document set or Azure Search function to make your app a Retrieval-Augmented Generation (RAG) empowered solution that combines information retrieval systems with large language models (LLMs). Creators and Users only have access to knowledge sources that have been shared with them by an Admin. If you do not see a particular knowledge source, reach out to a Lega Admin to get access.
- Tools: Add tools and functions that your app can use to perform specific tasks, making it more agentic. Example tools include things like the EDGAR database, stock prices, etc. Creators only have access to knowledge sources that have been shared with them by an Admin. If you do not see a particular tool, reach out to a Lega Admin to get access.
- Policy: This is where you select the policy you want to govern your app. If your firm has multiple AI usage policies in effect, they will be displayed here for selection.
- Ask Lega: Not sure where to begin? Tell Ask Lega what kind of app you want to create, and it will suggest a system prompt and parameters (optionally) as a starting point.
- Start from template: Not sure where to start? Peruse our catalog of apps for inspiration and launch one for customization directly in your instance.
- Import configuration: Upload a Lega app file or sandbox configuration exported from Azure AI, edit, and save as a new app.
4) Import a configuration:
Upload a Lega app file or sandbox configuration exported from Azure AI, edit, and save as a new app. To import a configuration, visit your App Library and select Create App in the upper right hand corner. Here you have the options to create an app with Ask Lega, from scratch, a catalog template, or an imported file.
Use the Lega Sandbox đź’ˇ
Compare models from the Lega Lab or go directly to the Lega Sandbox where you can compare models, prompts, and responses to find the best fit for your needs, and save the settings you like as an app.
Use the Resource Library ⚙️
- View details on available models and knowledge sources.
- Create, edit, and share prompts from the Prompt Library to efficiently reuse go-to prompts from within any app. User parameters as placeholders to make prompts adaptable to different situations without needing to rewrite them each time.