Policy Retrieval via Input Routing
Definitive, no-guessing-needed guide for builders using GLIK Studio to dynamically fetch policy files based on user context.
This page explains how to dynamically retrieve the correct policy file (e.g., .docx
, .json
, or .yaml
) based on user-provided context like user_region
, submission_type
, and user_role
.
This is a core pattern in the Global Control Copilot template, where logic and validation depend on loading the right ruleset for the right user at the right time.
Whether you're pulling from a static dataset, using in-memory config, or accessing GLIK Knowledge, this page shows you exactly how to route logic and retrieve the right file β without hardcoding anything.
π§© What This Pattern Enables
β Load MiCA, SOX, or fallback policies based on
user_region
β Adjust document-based compliance logic dynamically per session
β Inject policy text into downstream LLM blocks, classifiers, and decisions
β Enable jurisdiction-aware automation at runtime
β Keep workflows modular, reusable, and future-proof
π High-Level Pattern
This means:
You detect the input conditions
You set a policy key (e.g.,
policy_reference = "SOX"
)You fetch the associated file or memory chunk using that key
You inject the contents downstream
πΌοΈ Example Logic (Visual from Studio)
IF/ELSE Conditions:
region == EU
submission_type == Disclosure
user_role == Finance Manager
β thenSET policy_reference = "MiCA"
GET POLICY Block:
File name or memory key:
{{policy_reference}}.docx
π Example Policy Files
These files live in your GLIK Cloud Dataset or are registered in memory/knowledge.
MiCA
MiCA_EU.docx
Dataset
SOX
SOX_Controls_2025.json
Dataset or Memory
GDPR
GDPR-Disclosure.yaml
Knowledge
Fallback_Policy
InternalPolicy.pdf
Static default
Best practice: Keep the file name aligned with the variable (e.g., policy_reference = SOX
β SOX.docx
).
π‘ Tips for Builders
β
Save Point Logging
Always log the policy name for auditability and traceability.
β
Add session_label
or policy_source
tags in memory:
session_label
or policy_source
tags in memory:π‘οΈ Fallback Handling
If no policy matches the user's inputs:
Use a default case in your
IF/ELSE
block:
Add a logic check before GET POLICY:
π Dataset Access & Security
β
Public or Shared Dataset Policies:
Easy to reuse
Visible across workspaces (read-only recommended)
β
Private Dataset Policies:
Best for sensitive rules
Assign roles in the GLIK Workspace permissions
β
In-Memory Policies:
Fastest for demos
Good for SDK-based dynamic injection
π Common Questions (and Clear Answers)
β What if I want to store the policy in memory instead of a dataset?
You can. Just assign policy_reference = "MiCA"
and use the Memory Get
or direct memory block instead of GET POLICY
. Same pattern applies.
β Can I use Knowledge Retrieval
instead of GET POLICY
?
Knowledge Retrieval
instead of GET POLICY
?Yes. If your policies are stored as chunks in GLIK Knowledge, use the Knowledge Retrieval
block and query by policy_reference
.
β What if my file isnβt found?
Handle this gracefully with a fallback route:
β Can I pass the full contents of the file into the LLM?
Yes. After GET POLICY
, pipe the output into your LLM
block prompt like:
Last updated
Was this helpful?