Agent Instruction
This page gives AI agents the minimum operating instructions needed to use Etiq against a python script.
Use This File When
Use this file when an agent needs to:
scan a python script with Etiq
generate a lineage graph
inspect captured lineage objects
return a structured summary of scan outputs
Purpose
Use Etiq to scan a python file and it's run, generate lineage, and retrieve captured lineage objects such as dataframes, models, and agent states.
Project Context
Product name: Etiq
Install package:
etiq-copilotpython import namespace:
etiq_copilotMain scan result object:
CodeScannerResultfromDebuggerCodeScanner()Example target file:
test_repo/iris_pipeline.pyRelated docs:
Quickstart
Core Concepts
Scan Outputs
Setup Commands
Install with pip:
Install with uv:
Files That Matter
docs/etiq/quickstart.md: scanner setup and minimal file scan exampledocs/etiq/core-concepts.md: lineage graph and lineage object conceptsdocs/etiq/scan-results.md:CodeScannerResultmethods, captured states, source nodes, and larger-codebase entry-file scanstest_repo/iris_pipeline.py: example target script
Scan Helper
Use this helper to scan a target file and return a CodeScannerResult.
Minimum Working Routine
Default Workflow
Set the target file path explicitly.
Scan the entry file with
scan_file(...).Read
scan_results.scan_errors.If
scan_errorsis non-empty, report them before drawing conclusions.Generate lineage with
create_full_lineage_graph(graph_format="json")when another tool or agent needs to parse the graph.List captured lineage objects with
list_dataframes(),list_models(), andlist_agents().Retrieve full state objects only when names or graph output are not enough.
Use
state.node.as_string()andstate.node.scope()only when source evidence is needed.
API Commands
Use these public methods and properties.
Check scan issues
scan_results.scan_errors
Scan error details
Generate parseable lineage
scan_results.create_full_lineage_graph(graph_format="json")
JSON graph string
Generate visual lineage source
scan_results.create_full_lineage_graph(graph_format="dot")
DOT graph string
List dataset lineage objects
scan_results.list_dataframes()
list[str]
Retrieve dataset states
scan_results.get_dataframes()
Dataframe state objects
List model lineage objects
scan_results.list_models()
list[str]
Retrieve model states
scan_results.get_models()
Model state objects
List agent states
scan_results.list_agents()
list[str]
Retrieve agent states
scan_results.get_agent_states()
Agent state objects
Retrieve other captured states
scan_results.get_unstructured_states()
Unstructured state objects
Task Recipes
Summarize A Target Script
Generate Lineage For Another Agent
Return the graph as a string and state that the graph schema should not be treated as stable until a versioned schema is published.
Inspect Dataset State Objects
Use state objects when the agent needs captured values, source evidence, or Etiq metadata for a lineage object.
Inspect Source Evidence
Use this when the user asks where a lineage object came from in the code.
Inspect Model State Objects
Use this when the user asks which models were created, used, or captured.
Decision Rules
If the user asks for lineage output that another tool will parse, use
graph_format="json".If the user asks for visualization-oriented output, use
graph_format="dot".If
scan_errorsis non-empty, report the errors before summarizing lineage.If names from
list_dataframes(),list_models(), orlist_agents()are sufficient, do not retrieve full state objects.If the target workflow spans multiple files, scan the entry file that starts the run.
If source evidence or captured values are needed, retrieve state objects with the corresponding
get_*method and inspectstate.node.If the task requires installing Etiq, ask for approval before running an install command.
If the task requires deleting files, changing public APIs, or modifying generated output, ask before proceeding.
Do Not
Do not rely on private internals.
Do not assume all lineage objects are dataframes or models forever.
Do not assume graph JSON has a stable schema until that schema is published.
Do not ignore
scan_errors.Do not install dependencies without approval.
Do not reformat unrelated files when editing docs or examples.
Completion Criteria
Before finishing an agent task, report:
target file scanned
scan errors, or that no scan errors were reported
lineage object names found
graph format generated, if any
commands run
checks skipped and why
known limitations or follow-up
Use this response shape when returning structured results:
Last updated